Skip to content

Commit a951e9a

Browse files
committedAug 6, 2016
Convert instructions to inlined functions.
The instructions themselves are snippets of code that mutate state. The *interpreter* executes the functions and moves the instruction pointer (IP) to the next instruction, essentially operating as a loop (implemented by tail calls) over the instruction (opcode) vector. The naive JIT *linearizes* the sequence of function calls to the instructions and introduces control flow directly (instead of it being an artifact of iterating over the opcode vector).
1 parent 58aa59f commit a951e9a

File tree

197 files changed

+1150
-1214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+1150
-1214
lines changed
 

Diff for: ‎machine/call_frame.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ namespace rubinius {
169169
return ip_++;
170170
}
171171

172+
void next_ip() {
173+
}
174+
175+
void exception_ip() {
176+
}
177+
172178
/**
173179
* Initialize frame for the given stack size.
174180
*/

Diff for: ‎machine/instructions/add_scope.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
#include "interpreter/instructions.hpp"
2+
3+
inline void rubinius::instruction_add_scope(STATE, CallFrame* call_frame) {
14
Object* obj = stack_pop();
25
Module* mod = as<Module>(obj);
36
LexicalScope* scope = LexicalScope::create(state);
47
scope->module(state, mod);
58
scope->parent(state, call_frame->lexical_scope());
69
call_frame->lexical_scope_ = scope;
10+
}

0 commit comments

Comments
 (0)