diff --git a/Chapters/4-Interpreter/figures/interpreter_activation-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_activation-ascii.txt index 5536ea2..4b917a0 100644 --- a/Chapters/4-Interpreter/figures/interpreter_activation-ascii.txt +++ b/Chapters/4-Interpreter/figures/interpreter_activation-ascii.txt @@ -1,5 +1,5 @@ || The Stack | | - || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -._ + + || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ \/ Down | | | callerFramePointer | | method | @@ -9,10 +9,10 @@ | temporary 1 | | temporary 2 | | ... | - | stack value n (send receiver) ------+--> someObject - | stack value n+1 (send argument 1 ) | + | "stack value n (send receiver)" ----+--> someObject + | "stack value n+1 (send argument 1 ) " | | ... | ^ - | stack value n+m (send argument n ) | | + | "stack value n+m (send argument n )" | | | instructionPointer | | framePointer ----->+--------------------------------------+ | | callerFramePointer | | diff --git a/Chapters/4-Interpreter/figures/interpreter_activation.pdf b/Chapters/4-Interpreter/figures/interpreter_activation.pdf index bc34e84..2af8945 100644 Binary files a/Chapters/4-Interpreter/figures/interpreter_activation.pdf and b/Chapters/4-Interpreter/figures/interpreter_activation.pdf differ diff --git a/Chapters/4-Interpreter/figures/interpreter_dnu-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_dnu-ascii.txt new file mode 100644 index 0000000..d587568 --- /dev/null +++ b/Chapters/4-Interpreter/figures/interpreter_dnu-ascii.txt @@ -0,0 +1,36 @@ + Before | | || The Stack + +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ || Grows + +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ \/ Down + +---------------------------------------+ +framePointer ---->+ callerFramePointer | + | method | + | context | + | flags Caller's frame | + | receiver | + | temporary 1 | + | temporary 2 | + | ... | + | "stack value n (send receiver)" ---+-------------->+--+<-. + | "stack value n+1 (send argument 1)"---+---->+--+<---. +--+ | + | ... | +--+ | | +stackPointer ---->+ "stack value n+m (send argument n)"---+-->+--+<---. | | + +---------------------------------------+ +--+ | | | + | | | +Before Send | | | +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + - - - - - - +After Send | | | +---+<--. + | | | | `-+-1 | | + +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ | | +---+ | + +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ | `---------+-2 | | + +---------------------------------------+ | +---+ | +framePointer ---->+ callerFramePointer | `-----------+-3 | | + | method | +---+ | + | context | message object | + | flags Caller's frame | .->+---------------+ | + | receiver | | | selector --+-> ... | + | temporary 1 | | | arguments --+----------' + | temporary 2 | | | lookupClass --+-> ... + | ... | | +---------------+ + | "stack value n (send receiver)" | | +stackPointer ---->+ "stack value n+1 (send argument 1)"---+-' + +---------------------------------------+ \ No newline at end of file diff --git a/Chapters/4-Interpreter/figures/interpreter_dnu.pdf b/Chapters/4-Interpreter/figures/interpreter_dnu.pdf new file mode 100644 index 0000000..ce3820e Binary files /dev/null and b/Chapters/4-Interpreter/figures/interpreter_dnu.pdf differ diff --git a/Chapters/4-Interpreter/figures/interpreter_flags-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_flags-ascii.txt index e9b7cd8..7392380 100644 --- a/Chapters/4-Interpreter/figures/interpreter_flags-ascii.txt +++ b/Chapters/4-Interpreter/figures/interpreter_flags-ascii.txt @@ -1,7 +1,7 @@ +63 ------------------ 56 +55 - 32 +31 -- 24 +23 ----- 16 +15 --- 8 +7 ----- 0 + -| backjumpCount (JIT VM ) | unused | isBlock | hasContext | numArgs | 00000001 | +| "backjumpCount (JIT VM)"| unused | isBlock | hasContext | numArgs | 00000001 | +-------------------------+--------+---------+------------+---------+----------+ +31 -------------------------- 24 +23 ----- 16 +15 --- 8 +7 ----- 0 + -| backjumpCount (JIT VM )/isBlock | hasContext | numArgs | 00000001 | +| "backjumpCount (JIT VM)/isBlock"| hasContext | numArgs | 00000001 | +---------------------------------+------------+---------+----------+ \ No newline at end of file diff --git a/Chapters/4-Interpreter/figures/interpreter_flags.pdf b/Chapters/4-Interpreter/figures/interpreter_flags.pdf index 920525f..4187f48 100644 Binary files a/Chapters/4-Interpreter/figures/interpreter_flags.pdf and b/Chapters/4-Interpreter/figures/interpreter_flags.pdf differ diff --git a/Chapters/4-Interpreter/figures/interpreter_return-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_return-ascii.txt index d4172e3..1dff140 100644 --- a/Chapters/4-Interpreter/figures/interpreter_return-ascii.txt +++ b/Chapters/4-Interpreter/figures/interpreter_return-ascii.txt @@ -1,7 +1,7 @@ Before return : After return : || The Stack | | : | | - || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -._ + : +._ _ _.- - -._ _ _.- - -._ _ _.- - -._ + + || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ : +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ \/ Down +---------------------------------------+ : framePointer ---->+---------------------------------------+ | callerFramePointer | : | callerFramePointer | | method | : | method | @@ -14,7 +14,7 @@ | stack value n "(send receiver)" | : stackPointer ---->| stack value n "(return value)" | | stack value n+1 "(send argument 1)" | : +---------------------------------------+ | ... | : - | stack value n+m "(send argument n )" | : .--------------. + | stack value n+m "(send argument n)" | : .--------------. | saved instructionPointer -------------|--. : instructionPointer --. |object header | framePointer ----->+--------------------------------------+ | : | |literal 0 | | callerFramePointer | | : | |... | diff --git a/Chapters/4-Interpreter/figures/interpreter_return.pdf b/Chapters/4-Interpreter/figures/interpreter_return.pdf index c78b74b..3a05baf 100644 Binary files a/Chapters/4-Interpreter/figures/interpreter_return.pdf and b/Chapters/4-Interpreter/figures/interpreter_return.pdf differ diff --git a/Chapters/4-Interpreter/figures/interpreter_send-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_send-ascii.txt index 9cbb324..3cc1479 100644 --- a/Chapters/4-Interpreter/figures/interpreter_send-ascii.txt +++ b/Chapters/4-Interpreter/figures/interpreter_send-ascii.txt @@ -1,8 +1,8 @@ || The Stack | | - || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -._ + - \/ Down +._ _ _.- - -._ _ _.- - -._ _ _.- - -._ + + || Grows +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ + \/ Down +._ _ _.- - -._ _ _.- - -._ _ _.- - -.__+ +---------------------------------------+ -framePointer ----->+callerFramePointer | +framePointer ---->+ callerFramePointer | | method | | context | | flags Caller's frame | @@ -10,8 +10,8 @@ framePointer ----->+callerFramePointer | | temporary 1 | | temporary 2 | | ... | - | stack value n (send receiver) + - | stack value n+1 (send argument 1 ) | + | stack value n "(send receiver)" + + | stack value n+1 "(send argument 1 )" | | ... | -stackPointer -----> stack value n+m (send argument n ) | +stackPointer -----> stack value n+m "(send argument n )" | +---------------------------------------+ \ No newline at end of file diff --git a/Chapters/4-Interpreter/figures/interpreter_send.pdf b/Chapters/4-Interpreter/figures/interpreter_send.pdf index 1ea9bf2..235db6a 100644 Binary files a/Chapters/4-Interpreter/figures/interpreter_send.pdf and b/Chapters/4-Interpreter/figures/interpreter_send.pdf differ diff --git a/Chapters/4-Interpreter/figures/interpreter_variables-ascii.txt b/Chapters/4-Interpreter/figures/interpreter_variables-ascii.txt index d4f4e7d..0012181 100644 --- a/Chapters/4-Interpreter/figures/interpreter_variables-ascii.txt +++ b/Chapters/4-Interpreter/figures/interpreter_variables-ascii.txt @@ -1,7 +1,5 @@ - - framePointer ----------->+---------------------+ -stackPointer --------. | callerFramePointer -+---> null (bottom of stack) +stackPointer --------. | callerFramePointer -+---> null "(bottom of stack)" instructionPointer -. | | method -------------+--. | | | context | \ | | | flags | '-->.--------------. diff --git a/Chapters/4-Interpreter/figures/interpreter_variables.pdf b/Chapters/4-Interpreter/figures/interpreter_variables.pdf index 01645d2..49cfb08 100644 Binary files a/Chapters/4-Interpreter/figures/interpreter_variables.pdf and b/Chapters/4-Interpreter/figures/interpreter_variables.pdf differ diff --git a/Chapters/4-Interpreter/theInterpreter.md b/Chapters/4-Interpreter/theInterpreter.md index aa4cfa8..b33a0f0 100644 --- a/Chapters/4-Interpreter/theInterpreter.md +++ b/Chapters/4-Interpreter/theInterpreter.md @@ -742,6 +742,9 @@ Then the original message reification is set up by: - allocating an array to hold all the original arguments - popping the arguments from the stack and store them in the new array - allocating a message object and storing in it the original selector, argument array and lookup class + +![Reifying the message for does not understand.](figures/interpreter_dnu.pdf?label=dnu_message) + Then, the `messageSelector` interpreter variable is overwritten with the `doesNotUnderstand:` selector found in the special objects array, and the lookup is restarted. ```caption=The lookup method revisited with `doesNotUnderstand:` support