Skip to content
This repository
Browse code

Checkout. Add CallFrame

  • Loading branch information...
commit 77c68c4b3d7d2170353ee9d5228a91a6568eec9c 1 parent 4e76e69
authored February 02, 2009

Showing 47 changed files with 916 additions and 627 deletions. Show diff stats Hide diff stats

  1. 1  rakelib/vm.rake
  2. 10  vm/builtin/access_variable.cpp
  3. 2  vm/builtin/access_variable.hpp
  4. 111  vm/builtin/block_environment.cpp
  5. 21  vm/builtin/block_environment.hpp
  6. 9  vm/builtin/block_wrapper.cpp
  7. 4  vm/builtin/block_wrapper.hpp
  8. 21  vm/builtin/channel.cpp
  9. 2  vm/builtin/channel.hpp
  10. 8  vm/builtin/compiledmethod.cpp
  11. 4  vm/builtin/compiledmethod.hpp
  12. 2  vm/builtin/contexts.cpp
  13. 10  vm/builtin/contexts.hpp
  14. 4  vm/builtin/executable.cpp
  15. 2  vm/builtin/executable.hpp
  16. 4  vm/builtin/machine_method.cpp
  17. 2  vm/builtin/machine_method.hpp
  18. 6  vm/builtin/nativefunction.cpp
  19. 2  vm/builtin/nativefunction.hpp
  20. 11  vm/builtin/nativemethod.cpp
  21. 2  vm/builtin/nativemethod.hpp
  22. 2  vm/builtin/nativemethodcontext.cpp
  23. 9  vm/builtin/object.cpp
  24. 4  vm/builtin/object.hpp
  25. 20  vm/builtin/sendsite.cpp
  26. 10  vm/builtin/sendsite.hpp
  27. 102  vm/builtin/task.cpp
  28. 24  vm/builtin/task.hpp
  29. 53  vm/builtin/variable_scope.cpp
  30. 82  vm/builtin/variable_scope.hpp
  31. 96  vm/call_frame.cpp
  32. 157  vm/call_frame.hpp
  33. 22  vm/codegen/field_extract.rb
  34. 22  vm/codegen/instructions_gen.rb
  35. 8  vm/compiled_file.cpp
  36. 4  vm/executor.hpp
  37. 4  vm/globals.hpp
  38. 442  vm/instructions.rb
  39. 4  vm/jit_state.h
  40. 108  vm/llvm/instructions.cpp
  41. 1  vm/message.cpp
  42. 22  vm/message.hpp
  43. 4  vm/primitives.cpp
  44. 2  vm/primitives.hpp
  45. 14  vm/unwind_info.hpp
  46. 75  vm/vmmethod.cpp
  47. 14  vm/vmmethod.hpp
1  rakelib/vm.rake
@@ -120,6 +120,7 @@ field_extract_headers = %w[
120 120
   vm/builtin/autoload.hpp
121 121
   vm/builtin/machine_method.hpp
122 122
   vm/builtin/block_wrapper.hpp
  123
+  vm/builtin/variable_scope.hpp
123 124
 ]
124 125
 
125 126
 BC          = "vm/instructions.bc"
10  vm/builtin/access_variable.cpp
@@ -27,7 +27,7 @@ namespace rubinius {
27 27
 
28 28
   /* Run when an AccessVariable is executed. Uses the details in msg.method
29 29
    * to access instance variables of msg.recv */
30  
-  ExecuteStatus AccessVariable::access_execute(STATE, Task* task, Message& msg) {
  30
+  Object* AccessVariable::access_execute(STATE, CallFrame* call_frame, Task* task, Message& msg) {
31 31
     AccessVariable* access = as<AccessVariable>(msg.method);
32 32
 
33 33
     /* The writer case. */
@@ -38,17 +38,15 @@ namespace rubinius {
38 38
 
39 39
       /* Fall through, handle it as a normal ivar. */
40 40
       msg.recv->set_ivar(state, access->name(), msg.get_argument(0));
41  
-      task->primitive_return(msg.get_argument(0), msg);
42  
-      return cExecuteContinue;
  41
+      return msg.get_argument(0);
43 42
     }
44 43
 
45 44
     /* The read case. */
46 45
     if(msg.args() != 0) {
47 46
       Exception::argument_error(state, 0, msg.args());
  47
+      return Qnil;
48 48
     } else {
49  
-      task->primitive_return(msg.recv->get_ivar(state, access->name()), msg);
  49
+      return msg.recv->get_ivar(state, access->name());
50 50
     }
51  
-
52  
-    return cExecuteContinue;
53 51
   }
54 52
 }
2  vm/builtin/access_variable.hpp
@@ -30,7 +30,7 @@ namespace rubinius {
30 30
     static void init(STATE);
31 31
     // Ruby.primitive :accessvariable_allocate
32 32
     static AccessVariable* allocate(STATE);
33  
-    static ExecuteStatus access_execute(STATE, Task* task, Message& msg);
  33
+    static Object* access_execute(STATE, CallFrame* call_frame, Task* task, Message& msg);
34 34
 
35 35
     class Info : public TypeInfo {
36 36
     public:
111  vm/builtin/block_environment.cpp
@@ -34,29 +34,45 @@ namespace rubinius {
34 34
     return env;
35 35
   }
36 36
 
37  
-  void BlockEnvironment::call(STATE, Task* task, size_t args) {
  37
+  Object* BlockEnvironment::call(STATE, Task* task, CallFrame* call_frame, size_t args) {
38 38
     Object* val;
39 39
     if(args > 0) {
40 40
       Tuple* tup = Tuple::create(state, args);
  41
+      int sp = 0;
41 42
       for(int i = args - 1; i >= 0; i--) {
42  
-        tup->put(state, i, task->pop());
  43
+        tup->put(state, i, call_frame->stack_back(sp++));
43 44
       }
44 45
 
45 46
       val = tup;
46 47
     } else {
47 48
       val = Qnil;
48 49
     }
49  
-    task->pop(); // Remove this from the stack.
50  
-    BlockContext* ctx = create_context(state, task->active());
51 50
 
52  
-    if(unlikely(task->profiler)) task->profiler->enter_block(state, home_, method_);
  51
+    VariableScope* scope = (VariableScope*)alloca(sizeof(VariableScope) +
  52
+                               (vmm->number_of_locals * sizeof(Object*)));
53 53
 
54  
-    task->make_active(ctx);
55  
-    task->push(val);
56  
-    ctx->run(ctx->vmm, task, ctx);
  54
+    scope->setup_as_block(top_scope_, scope_, vmm->number_of_locals);
  55
+
  56
+    CallFrame* cf = (CallFrame*)alloca(sizeof(CallFrame) + (vmm->stack_size * sizeof(Object*)));
  57
+    cf->setup(vmm->stack_size);
  58
+
  59
+    cf->is_block = true;
  60
+    cf->previous = call_frame;
  61
+    cf->name =     (Symbol*)Qnil;
  62
+    cf->cm =       method_;
  63
+    cf->args =     args;
  64
+    cf->scope =    scope;
  65
+    cf->top_scope = top_scope_;
  66
+    cf->run =      vmm->run;
  67
+    cf->vmm =      vmm;
  68
+
  69
+    // if(unlikely(task->profiler)) task->profiler->enter_block(state, home_, method_);
  70
+
  71
+    cf->push(val);
  72
+    return cf->run(vmm, task, cf);
57 73
   }
58 74
 
59  
-  void BlockEnvironment::call(STATE, Task* task, Message& msg) {
  75
+  Object* BlockEnvironment::call(STATE, Task* task, CallFrame* call_frame, Message& msg) {
60 76
     Object* val;
61 77
     if(msg.args() > 0) {
62 78
       Tuple* tup = Tuple::create(state, msg.args());
@@ -68,62 +84,51 @@ namespace rubinius {
68 84
     } else {
69 85
       val = Qnil;
70 86
     }
71  
-    BlockContext* ctx = create_context(state, task->active());
72 87
 
73  
-    if(unlikely(task->profiler)) task->profiler->enter_block(state, home_, method_);
  88
+    VariableScope* scope = (VariableScope*)alloca(sizeof(VariableScope) +
  89
+                               (vmm->number_of_locals * sizeof(Object*)));
74 90
 
75  
-    // HACK: manually clear the stack used as args.
76  
-    task->active()->clear_stack(msg.stack);
  91
+    scope->setup_as_block(top_scope_, scope_, vmm->number_of_locals);
77 92
 
78  
-    task->make_active(ctx);
79  
-    task->push(val);
80  
-    ctx->run(ctx->vmm, task, ctx);
81  
-  }
  93
+    CallFrame* cf = (CallFrame*)alloca(sizeof(CallFrame) + (vmm->stack_size * sizeof(Object*)));
  94
+    cf->setup(vmm->stack_size);
  95
+
  96
+    cf->is_block = true;
  97
+    cf->previous = call_frame;
  98
+    cf->name =     (Symbol*)Qnil;
  99
+    cf->cm =       method_;
  100
+    cf->args =     msg.args();
  101
+    cf->scope =    scope;
  102
+    cf->top_scope = top_scope_;
  103
+    cf->run =      vmm->run;
  104
+    cf->vmm =      vmm;
82 105
 
83  
-  // TODO - Untested!!!!!!!!!!
84  
-  ExecuteStatus BlockEnvironment::call_prim(STATE, Executable* exec, Task* task, Message& msg) {
85  
-    call(state, task, msg);
86  
-    return cExecuteRestart;
  106
+    // if(unlikely(task->profiler)) task->profiler->enter_block(state, home_, method_);
  107
+
  108
+    cf->push(val);
  109
+    return cf->run(vmm, task, cf);
87 110
   }
88 111
 
89  
-  /*
90  
-   * Allocates a context, adjusting the initial stack pointer by the number of
91  
-   * locals the method requires.
92  
-   */
93  
-  BlockContext* BlockEnvironment::create_context(STATE, MethodContext* sender) {
94  
-    BlockContext* ctx = BlockContext::create(state, method_->stack_size()->to_native());
95  
-    ctx->sender(state, sender);
96  
-    ctx->block(state, this);
97  
-    ctx->cm(state, method_);
98  
-    ctx->home(state, home_);
99  
-
100  
-    ctx->vmm = vmm ? vmm : method_->backend_method_;
101  
-    ctx->run = ctx->vmm->run;
102  
-
103  
-    ctx->ip = 0;
104  
-    // HACK dup'd from MethodContext
105  
-    ctx->position_stack(method_->number_of_locals() - 1);
106  
-
107  
-    return ctx;
  112
+  Object* BlockEnvironment::call_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg) {
  113
+    return call(state, task, call_frame, msg);
108 114
   }
109 115
 
110  
-  BlockEnvironment* BlockEnvironment::under_context(STATE, CompiledMethod* cm,
111  
-      MethodContext* parent, MethodContext* active, size_t index) {
  116
+  BlockEnvironment* BlockEnvironment::under_call_frame(STATE, CompiledMethod* cm,
  117
+      CallFrame* call_frame, size_t index) {
112 118
 
113 119
     BlockEnvironment* be = state->new_object<BlockEnvironment>(G(blokenv));
114 120
 
115  
-
116 121
     VMMethod* vmm;
117  
-    if((vmm = active->vmm->blocks[index]) == NULL) {
  122
+    if((vmm = call_frame->vmm->blocks[index]) == NULL) {
118 123
       vmm = new VMMethod(state, cm);
119  
-      if(active->vmm->type) {
120  
-        vmm->specialize(state, active->vmm->type);
  124
+      if(call_frame->vmm->type) {
  125
+        vmm->specialize(state, call_frame->vmm->type);
121 126
       }
122  
-      active->vmm->blocks[index] = vmm;
  127
+      call_frame->vmm->blocks[index] = vmm;
123 128
     }
124 129
 
125  
-    be->home(state, parent);
126  
-    be->home_block(state, active);
  130
+    be->scope(state, call_frame->scope);
  131
+    be->top_scope(state, call_frame->top_scope);
127 132
     be->method(state, cm);
128 133
     be->local_count(state, cm->local_count());
129 134
     be->vmm = vmm;
@@ -134,8 +139,8 @@ namespace rubinius {
134 139
   BlockEnvironment* BlockEnvironment::dup(STATE) {
135 140
     BlockEnvironment* be = state->new_object<BlockEnvironment>(G(blokenv));
136 141
 
137  
-    be->home(state, home_);
138  
-    be->home_block(state, home_block_);
  142
+    be->scope(state, scope_);
  143
+    be->top_scope(state, top_scope_);
139 144
     be->method(state, method_);
140 145
     be->local_count(state, local_count_);
141 146
     be->vmm = this->vmm;
@@ -148,8 +153,8 @@ namespace rubinius {
148 153
     BlockEnvironment* be = as<BlockEnvironment>(self);
149 154
 
150 155
     class_header(state, self);
151  
-    indent_attribute(++level, "home"); be->home()->show(state, level);
152  
-    indent_attribute(level, "home_block"); be->home_block()->show(state, level);
  156
+    //indent_attribute(++level, "scope"); be->scope()->show(state, level);
  157
+    // indent_attribute(level, "top_scope"); be->top_scope()->show(state, level);
153 158
     indent_attribute(level, "local_count"); be->local_count()->show(state, level);
154 159
     indent_attribute(level, "method"); be->method()->show(state, level);
155 160
     close_body(level);
21  vm/builtin/block_environment.hpp
@@ -6,7 +6,8 @@
6 6
 
7 7
 namespace rubinius {
8 8
   class CompiledMethod;
9  
-  class MethodContext;
  9
+  class VariableScope;
  10
+  class CallFrame;
10 11
   class BlockContext;
11 12
   class Message;
12 13
   class VMMethod;
@@ -18,8 +19,8 @@ namespace rubinius {
18 19
     const static object_type type = BlockEnvironmentType;
19 20
 
20 21
   private:
21  
-    MethodContext* home_;       // slot
22  
-    MethodContext* home_block_; // slot
  22
+    VariableScope* scope_;      // slot
  23
+    VariableScope* top_scope_;  // slot
23 24
     Object* local_count_;       // slot
24 25
     CompiledMethod* method_;    // slot
25 26
 
@@ -29,8 +30,8 @@ namespace rubinius {
29 30
 
30 31
   public:
31 32
     /* accessors */
32  
-    attr_accessor(home, MethodContext);
33  
-    attr_accessor(home_block, MethodContext);
  33
+    attr_accessor(scope, VariableScope);
  34
+    attr_accessor(top_scope, VariableScope);
34 35
     attr_accessor(local_count, Object);
35 36
     attr_accessor(method, CompiledMethod);
36 37
 
@@ -41,15 +42,15 @@ namespace rubinius {
41 42
     // Ruby.primitive :blockenvironment_allocate
42 43
     static BlockEnvironment* allocate(STATE);
43 44
 
44  
-    static BlockEnvironment* under_context(STATE, CompiledMethod* cm,
45  
-        MethodContext* parent, MethodContext* active, size_t index);
  45
+    static BlockEnvironment* BlockEnvironment::under_call_frame(STATE, CompiledMethod* cm,
  46
+      CallFrame* call_frame, size_t index);
46 47
 
47  
-    void call(STATE, Task* task, size_t args);
48  
-    void call(STATE, Task* task, Message& msg);
  48
+    Object* call(STATE, Task* task, CallFrame* call_frame, size_t args);
  49
+    Object* call(STATE, Task* task, CallFrame* call_frame, Message& msg);
49 50
     BlockContext* create_context(STATE, MethodContext* sender);
50 51
 
51 52
     // Ruby.primitive? :block_call
52  
-    ExecuteStatus call_prim(STATE, Executable* exec, Task* task, Message& msg);
  53
+    Object* call_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg);
53 54
 
54 55
     BlockEnvironment* dup(STATE);
55 56
 
9  vm/builtin/block_wrapper.cpp
@@ -25,12 +25,11 @@ namespace rubinius {
25 25
     return wrapper;
26 26
   }
27 27
 
28  
-  void BlockWrapper::call(STATE, Task* task, size_t args) {
29  
-    block_->call(state, task, args);
  28
+  Object* BlockWrapper::call(STATE, Task* task, CallFrame* call_frame, size_t args) {
  29
+    return block_->call(state, task, call_frame, args);
30 30
   }
31 31
 
32  
-  ExecuteStatus BlockWrapper::call_prim(STATE, Executable* exec, Task* task, Message& msg) {
33  
-    block_->call(state, task, msg);
34  
-    return cExecuteRestart;
  32
+  Object* BlockWrapper::call_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg) {
  33
+    return block_->call(state, task, call_frame, msg);
35 34
   }
36 35
 }
4  vm/builtin/block_wrapper.hpp
@@ -22,10 +22,10 @@ namespace rubinius {
22 22
     // Ruby.primitive :block_wrapper_allocate
23 23
     static BlockWrapper* create(STATE, Object* self);
24 24
 
25  
-    void call(STATE, Task* task, size_t args);
  25
+    Object* call(STATE, Task* task, CallFrame* call_frame, size_t args);
26 26
 
27 27
     // Ruby.primitive? :block_wrapper_call
28  
-    ExecuteStatus call_prim(STATE, Executable* exec, Task* task, Message& msg);
  28
+    Object* call_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg);
29 29
 
30 30
     // Ruby.primitive :block_wrapper_from_env
31 31
     static BlockWrapper* from_env(STATE, BlockEnvironment* env);
21  vm/builtin/channel.cpp
@@ -53,39 +53,30 @@ namespace rubinius {
53 53
    * @todo   The list management is iffy. Should probably just
54 54
    *          always assume it is a list. --rue
55 55
    */
56  
-  ExecuteStatus Channel::receive_prim(STATE, Executable* exec, Task* task, Message& msg) {
  56
+  Object* Channel::receive_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg) {
57 57
     Thread* current = state->globals.current_thread.get();
58 58
 
59  
-    task->active()->clear_stack(msg.stack);
60  
-
  59
+top:
61 60
     // @todo  check arity
62 61
     if(!value_->nil_p()) {
63 62
       List* list = as<List>(value_);
64 63
 
65  
-      task->push(list->shift(state));
  64
+      Object* ret = list->shift(state);
66 65
 
67 66
       if(list->size() == 0) {
68 67
         value(state, Qnil);
69 68
       }
70 69
 
71  
-      return cExecuteContinue;
  70
+      return ret;
72 71
     }
73 72
 
74  
-    /* Saves space plus if thread woken forcibly, it gets the Qfalse. */
75  
-    task->push(Qfalse);
76  
-
77 73
     current->sleep_for(state, this);
78 74
     waiting_->append(state, current);
79 75
 
  76
+    // Blocks?
80 77
     state->check_events();
81 78
 
82  
-    /* This sets the Task to continue from the next
83  
-     * opcode when it eventually reactivates. Its
84  
-     * stack will then have either the real received
85  
-     * value or the default Qfalse if the thread
86  
-     * was forced to stop waiting for us.
87  
-     */
88  
-    return cExecuteRestart;
  79
+    goto top;
89 80
   }
90 81
 
91 82
   Object* Channel::receive(STATE) {
2  vm/builtin/channel.hpp
@@ -42,7 +42,7 @@ namespace rubinius {
42 42
     Object* send(STATE, Object*);
43 43
 
44 44
     // Ruby.primitive? :channel_receive
45  
-    ExecuteStatus receive_prim(STATE, Executable* exec, Task* task, Message& msg);
  45
+    Object* receive_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg);
46 46
 
47 47
     Object* receive(STATE);
48 48
     bool has_readers_p();
8  vm/builtin/compiledmethod.cpp
@@ -107,10 +107,10 @@ namespace rubinius {
107 107
     return this;
108 108
   }
109 109
 
110  
-  ExecuteStatus CompiledMethod::default_executor(STATE, Task* task, Message& msg) {
  110
+  Object* CompiledMethod::default_executor(STATE, CallFrame* call_frame, Task* task, Message& msg) {
111 111
     CompiledMethod* cm = as<CompiledMethod>(msg.method);
112 112
     cm->formalize(state, false);
113  
-    return cm->execute(state, task, msg);
  113
+    return cm->execute(state, call_frame, task, msg);
114 114
   }
115 115
 
116 116
   void CompiledMethod::post_marshal(STATE) {
@@ -121,7 +121,7 @@ namespace rubinius {
121 121
     return local_count_->to_native();
122 122
   }
123 123
 
124  
-  ExecuteStatus CompiledMethod::activate(STATE, Executable* exec, Task* task, Message& msg) {
  124
+  Object* CompiledMethod::activate(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg) {
125 125
     CompiledMethod* meth = as<CompiledMethod>(msg.recv);
126 126
     Object* recv = msg.get_argument(0);
127 127
     Module* mod  = as<Module>(msg.get_argument(1));
@@ -140,7 +140,7 @@ namespace rubinius {
140 140
     // push the name given, because there really isn't one. So if
141 141
     // this is used to call a method_missing, you have to supply all
142 142
     // the args.
143  
-    return meth->execute(state, task, msg);
  143
+    return meth->execute(state, call_frame, task, msg);
144 144
   }
145 145
 
146 146
   MachineMethod* CompiledMethod::make_machine_method(STATE) {
4  vm/builtin/compiledmethod.hpp
@@ -72,7 +72,7 @@ namespace rubinius {
72 72
     VMMethod* formalize(STATE, bool ondemand=true);
73 73
     void specialize(STATE, TypeInfo* ti);
74 74
 
75  
-    static ExecuteStatus default_executor(STATE, Task*, Message&);
  75
+    static Object* default_executor(STATE, CallFrame*, Task*, Message&);
76 76
 
77 77
     // Ruby.primitive :compiledmethod_compile
78 78
     Object* compile(STATE);
@@ -81,7 +81,7 @@ namespace rubinius {
81 81
     MachineMethod* make_machine_method(STATE);
82 82
 
83 83
     // Ruby.primitive? :compiledmethod_activate
84  
-    ExecuteStatus activate(STATE, Executable* exec, Task* task, Message& msg);
  84
+    Object* activate(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg);
85 85
 
86 86
     bool is_rescue_target(STATE, int ip);
87 87
 
2  vm/builtin/contexts.cpp
@@ -241,6 +241,7 @@ namespace rubinius {
241 241
       }
242 242
     }
243 243
 
  244
+    /*
244 245
     for(MethodContext* ctx = ret; !ctx->sender()->nil_p(); ctx = ctx->sender()) {
245 246
       if(ctx->obj_type == BlockContextType) {
246 247
         BlockEnvironment* old_env = as<BlockContext>(ctx)->env();
@@ -251,6 +252,7 @@ namespace rubinius {
251 252
         ctx->block(state, new_env);
252 253
       }
253 254
     }
  255
+    */
254 256
 
255 257
     for(MethodContext* ctx = this; !ctx->sender()->nil_p(); ctx = ctx->sender()) {
256 258
       if(ctx->obj_type == MethodContextType) {
10  vm/builtin/contexts.hpp
@@ -6,6 +6,7 @@
6 6
 #include "type_info.hpp"
7 7
 #include "vmmethod.hpp"
8 8
 #include "jit_state.h"
  9
+#include "unwind_info.hpp"
9 10
 
10 11
 namespace rubinius {
11 12
   class BlockContext;
@@ -16,19 +17,10 @@ namespace rubinius {
16 17
   class Tuple;
17 18
   class Module;
18 19
 
19  
-  // TODO figure out if this is a good number
20  
-  const int kMaxUnwindInfos = 20;
21  
-
22 20
   class MethodContext : public Object {
23 21
   public:
24 22
     const static object_type type = MethodContextType;
25 23
 
26  
-  public: // Types
27  
-    struct UnwindInfo {
28  
-      uint32_t target_ip;
29  
-      uint32_t stack_depth;
30  
-    };
31  
-
32 24
   private:
33 25
     MethodContext* sender_; // slot
34 26
 
4  vm/builtin/executable.cpp
@@ -30,11 +30,11 @@ namespace rubinius {
30 30
     return executable;
31 31
   }
32 32
 
33  
-  ExecuteStatus Executable::default_executor(STATE, Task* task, Message& msg) {
  33
+  Object* Executable::default_executor(STATE, CallFrame* call_frame, Task* task, Message& msg) {
34 34
     msg.unshift_argument2(state, msg.recv, msg.name);
35 35
     msg.name = state->symbol("call");
36 36
     msg.recv = msg.method;
37 37
     msg.lookup_from = msg.recv->lookup_begin(state);
38  
-    return task->send_message_slowly(msg);
  38
+    return task->send_message_slowly(call_frame, msg);
39 39
   }
40 40
 }
2  vm/builtin/executable.hpp
@@ -30,7 +30,7 @@ namespace rubinius {
30 30
     /* interface */
31 31
 
32 32
     static void init(STATE);
33  
-    static ExecuteStatus default_executor(STATE, Task* task, Message& msg);
  33
+    static Object* default_executor(STATE, CallFrame* call_frame, Task* task, Message& msg);
34 34
 
35 35
     // Ruby.primitive :executable_allocate
36 36
     static Executable* allocate(STATE, Object* self);
4  vm/builtin/machine_method.cpp
@@ -87,11 +87,11 @@ namespace rubinius {
87 87
   }
88 88
 
89 89
   void MachineMethod::run_code(VMMethod* const vmm, Task* const task,
90  
-      MethodContext* const ctx) {
  90
+      CallFrame* const call_frame) {
91 91
 #ifdef IS_X86
92 92
     MachineMethod* mm = vmm->machine_method();
93 93
     void* func = mm->function();
94  
-    ((Runner)func)(vmm, task, ctx);
  94
+    ((Runner)func)(vmm, task, call_frame);
95 95
 #else
96 96
     Assertion::raise("Only supported on x86");
97 97
 #endif
2  vm/builtin/machine_method.hpp
@@ -32,7 +32,7 @@ namespace rubinius {
32 32
     }
33 33
 
34 34
     // Used for debugging. Gives us a place to break on before entering jit'd code
35  
-    static void run_code(VMMethod* const vmm, Task* const task, MethodContext* const ctx);
  35
+    static void run_code(VMMethod* const vmm, Task* const task, CallFrame* const call_frame);
36 36
 
37 37
     // Ruby.primitive :machine_method_show
38 38
     Object* show();
6  vm/builtin/nativefunction.cpp
@@ -43,14 +43,12 @@ namespace rubinius {
43 43
 
44 44
   /* Run when a NativeFunction is executed.  Executes the related C function.
45 45
    */
46  
-  ExecuteStatus NativeFunction::execute(STATE, Task* task, Message& msg) {
  46
+  Object* NativeFunction::execute(STATE, CallFrame* call_frame, Task* task, Message& msg) {
47 47
     NativeFunction* nfunc = as<NativeFunction>(msg.method);
48 48
 
49 49
     Object* obj = nfunc->call(state, &msg);
50 50
 
51  
-    task->push(obj);
52  
-
53  
-    return cExecuteContinue;
  51
+    return obj;
54 52
   }
55 53
 
56 54
   size_t NativeFunction::type_size(size_t type) {
2  vm/builtin/nativefunction.hpp
@@ -34,7 +34,7 @@ namespace rubinius {
34 34
     static void init(STATE);
35 35
 
36 36
     static NativeFunction* create(STATE, Object* name, int args);
37  
-    static ExecuteStatus execute(STATE, Task* task, Message& msg);
  37
+    static Object* execute(STATE, CallFrame* call_frame, Task* task, Message& msg);
38 38
 
39 39
     // Ruby.primitive :nativefunction_bind
40 40
     static NativeFunction* bind(STATE, Object* library, String* name, Array* args, Object* ret);
11  vm/builtin/nativemethod.cpp
@@ -55,7 +55,8 @@ namespace rubinius {
55 55
        *  So, we return from here which then allows the CM to really
56 56
        *  execute.
57 57
        */
58  
-      return context->task()->send_message_slowly(context->message_from_c());
  58
+      context->task()->send_message_slowly(NULL, context->message_from_c());
  59
+      return cExecuteRestart;
59 60
 
60 61
     case NativeMethodContext::RETURNED_BACK_TO_C:
61 62
       jump_to_execution_point_in(context->inside_c_method_point());
@@ -76,13 +77,15 @@ namespace rubinius {
76 77
     return cExecuteRestart;
77 78
   }
78 79
 
79  
-  ExecuteStatus NativeMethod::executor_implementation(STATE, Task* task, Message& message) {
  80
+  Object* NativeMethod::executor_implementation(STATE, CallFrame* call_frame, Task* task, Message& message) {
  81
+    abort();
  82
+    return Qnil;
  83
+    /*
80 84
     NativeMethodContext* context = NativeMethodContext::create(state,
81 85
         &message, task, as<NativeMethod>(message.method));
82 86
 
83  
-    task->active(state, context);
84  
-
85 87
     return activate_from(context);
  88
+    */
86 89
   }
87 90
 
88 91
   NativeMethod* NativeMethod::load_extension_entry_point(STATE, String* path, String* name) {
2  vm/builtin/nativemethod.hpp
@@ -156,7 +156,7 @@ namespace rubinius {
156 156
     /**
157 157
      *  Enter a new NativeMethod the first time.
158 158
      */
159  
-    static ExecuteStatus executor_implementation(VM* state, Task* task, Message& message);
  159
+    static Object* executor_implementation(STATE, CallFrame* call_frame, Task* task, Message& message);
160 160
 
161 161
     /**
162 162
      *  Attempt to load a C extension library and its main function.
2  vm/builtin/nativemethodcontext.cpp
@@ -86,7 +86,7 @@ namespace rubinius {
86 86
     nmc->handles_->push_back(Qnil);
87 87
     nmc->handles_->push_back(Qundef);
88 88
 
89  
-    nmc->message_from_c_->set_caller(nmc);
  89
+    // nmc->message_from_c_->set_caller(nmc);
90 90
 
91 91
     return nmc;
92 92
   }
9  vm/builtin/object.cpp
@@ -314,19 +314,20 @@ namespace rubinius {
314 314
   }
315 315
 
316 316
   bool Object::send_on_task(STATE, Task* task, Symbol* name, Array* args) {
  317
+    abort();
317 318
     Message msg(state);
318 319
     msg.name = name;
319 320
     msg.recv = this;
320 321
     msg.lookup_from = this->lookup_begin(state);
321 322
     msg.stack = 0;
322  
-    msg.set_caller(task->active());
  323
+    // msg.set_caller(task->active());
323 324
 
324 325
     msg.set_arguments(state, args);
325 326
 
326  
-    return task->send_message_slowly(msg);
  327
+    return task->send_message_slowly(NULL, msg);
327 328
   }
328 329
 
329  
-  ExecuteStatus Object::send_prim(STATE, Executable* exec, Task* task, Message& msg) {
  330
+  Object* Object::send_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg) {
330 331
     Object* meth = msg.shift_argument(state);
331 332
     Symbol* sym = try_as<Symbol>(meth);
332 333
 
@@ -336,7 +337,7 @@ namespace rubinius {
336 337
 
337 338
     msg.name = sym;
338 339
     msg.priv = true;
339  
-    return task->send_message_slowly(msg);
  340
+    return task->send_message_slowly(call_frame, msg);
340 341
   }
341 342
 
342 343
   void Object::set_field(STATE, size_t index, Object* val) {
4  vm/builtin/object.hpp
@@ -194,11 +194,9 @@ namespace rubinius {
194 194
      *  Perform a send from Ruby.
195 195
      *
196 196
      *  Uses Task::send_message_slowly().
197  
-     *
198  
-     *  @todo Add more information, when is this used? --rue
199 197
      */
200 198
     // Ruby.primitive? :object_send
201  
-    ExecuteStatus send_prim(STATE, Executable* exec, Task* task, Message& msg);
  199
+    Object* send_prim(STATE, Executable* exec, CallFrame* call_frame, Task* task, Message& msg);
202 200
 
203 201
 
204 202
   public:   /* Ruby interface */
20  vm/builtin/sendsite.cpp
@@ -15,7 +15,7 @@ namespace rubinius {
15 15
      * method missing, so it must not be installed if method missing
16 16
      * was used.
17 17
      */
18  
-    ExecuteStatus mono_performer(STATE, Task* task, Message& msg) {
  18
+    Object* mono_performer(STATE, CallFrame* call_frame, Task* task, Message& msg) {
19 19
       if(likely(msg.lookup_from == msg.send_site->recv_class())) {
20 20
         msg.module = msg.send_site->module();
21 21
         msg.method = msg.send_site->method();
@@ -23,17 +23,17 @@ namespace rubinius {
23 23
         msg.send_site->hits++;
24 24
       } else {
25 25
         msg.send_site->misses++;
26  
-        return basic_performer(state, task, msg);
  26
+        return basic_performer(state, call_frame, task, msg);
27 27
       }
28 28
 
29  
-      return msg.method->execute(state, task, msg);
  29
+      return msg.method->execute(state, call_frame, task, msg);
30 30
     }
31 31
 
32 32
     /**
33 33
      * A simple monomorphic cache for when the destination method is
34 34
      * a method_missing style dispatch.
35 35
      */
36  
-    ExecuteStatus mono_mm_performer(STATE, Task* task, Message& msg) {
  36
+    Object* mono_mm_performer(STATE, CallFrame* call_frame, Task* task, Message& msg) {
37 37
       if(likely(msg.lookup_from == msg.send_site->recv_class())) {
38 38
         msg.module = msg.send_site->module();
39 39
         msg.method = msg.send_site->method();
@@ -41,16 +41,16 @@ namespace rubinius {
41 41
         msg.send_site->hits++;
42 42
       } else {
43 43
         msg.send_site->misses++;
44  
-        return basic_performer(state, task, msg);
  44
+        return basic_performer(state, call_frame, task, msg);
45 45
       }
46 46
 
47 47
       msg.unshift_argument(state, msg.name);
48 48
 
49  
-      return msg.method->execute(state, task, msg);
  49
+      return msg.method->execute(state, call_frame, task, msg);
50 50
 
51 51
     }
52 52
 
53  
-    ExecuteStatus basic_performer(STATE, Task* task, Message& msg) {
  53
+    Object* basic_performer(STATE, CallFrame* call_frame, Task* task, Message& msg) {
54 54
       Symbol* original_name = msg.name;
55 55
 
56 56
       if(!GlobalCacheResolver::resolve(state, msg)) {
@@ -79,7 +79,7 @@ namespace rubinius {
79 79
         msg.send_site->performer = mono_performer;
80 80
       }
81 81
 
82  
-      return msg.method->execute(state, task, msg);
  82
+      return msg.method->execute(state, call_frame, task, msg);
83 83
     }
84 84
   }
85 85
 
@@ -147,7 +147,7 @@ namespace rubinius {
147 147
     return true;
148 148
   }
149 149
 
150  
-  bool SendSite::check_serial(STATE, MethodContext* current, Object* recv, int serial) {
  150
+  bool SendSite::check_serial(STATE, CallFrame* call_frame, Object* recv, int serial) {
151 151
     // If empty, fill.
152 152
     if(method_ == Qnil) {
153 153
       Message msg(state);
@@ -155,7 +155,7 @@ namespace rubinius {
155 155
       msg.lookup_from = recv->lookup_begin(state);
156 156
       msg.name = name_;
157 157
       msg.priv = false;
158  
-      msg.set_caller(current);
  158
+      msg.set_caller(call_frame);
159 159
 
160 160
       // Can't be resolved initially? bail.
161 161
       if(!GlobalCacheResolver::resolve(state, msg)) {
10  vm/builtin/sendsite.hpp
@@ -17,7 +17,7 @@ namespace rubinius {
17 17
   public:
18 18
     static const object_type type = SendSiteType;
19 19
 
20  
-    typedef ExecuteStatus (*Performer)(STATE, Task* task, Message& msg);
  20
+    typedef Object* (*Performer)(STATE, CallFrame* call_frame, Task* task, Message& msg);
21 21
 
22 22
   private:
23 23
     Symbol* name_;            // slot
@@ -66,7 +66,7 @@ namespace rubinius {
66 66
 
67 67
     // Check and see if the method referenced has the given serial
68 68
     // Sideffect: populates the sendsite if empty
69  
-    bool check_serial(STATE, MethodContext* current, Object* reciever, int serial);
  69
+    bool check_serial(STATE, CallFrame* call_frame, Object* reciever, int serial);
70 70
 
71 71
     class Info : public TypeInfo {
72 72
     public:
@@ -76,9 +76,9 @@ namespace rubinius {
76 76
   };
77 77
 
78 78
   namespace performer {
79  
-    ExecuteStatus basic_performer(STATE, Task* task, Message& msg);
80  
-    ExecuteStatus mono_performer(STATE, Task* task, Message& msg);
81  
-    ExecuteStatus mono_mm_performer(STATE, Task* task, Message& msg);
  79
+    Object* basic_performer(STATE, CallFrame*, Task* task, Message& msg);
  80
+    Object* mono_performer(STATE, CallFrame*, Task* task, Message& msg);
  81
+    Object* mono_mm_performer(STATE, CallFrame*, Task* task, Message& msg);
82 82
   }
83 83
 
84 84
   /**
102  vm/builtin/task.cpp
@@ -52,8 +52,8 @@ namespace rubinius {
52 52
     msg.name = meth->name() ? meth->name() : state->symbol("__weird_unnamed_method__");
53 53
     msg.module = recv->class_object(state);
54 54
     msg.method = meth;
55  
-    msg.set_caller(task->active());
56  
-    meth->execute(state, task, msg);
  55
+    // msg.set_caller(task->active());
  56
+    // meth->execute(state, task, msg);
57 57
 
58 58
     return task;
59 59
   }
@@ -90,15 +90,15 @@ namespace rubinius {
90 90
     return state->globals.current_task.get();
91 91
   }
92 92
 
93  
-  ExecuteStatus Task::set_current(STATE, Executable* exec, Task* task_, Message& msg) {
94  
-
  93
+  Object* Task::set_current(STATE, Executable* exec, Task* task_, Message& msg) {
  94
+    abort();
95 95
     Task* tsk = try_as<Task>(msg.get_argument(0));
96 96
 
97 97
     Thread::current(state)->task(state, tsk);
98 98
     state->globals.current_task.set(tsk);
99 99
 
100 100
     state->interrupts.check = true; // HACK, forcing jump out of Task::execute() loop
101  
-    return cExecuteRestart;
  101
+    return Qnil;
102 102
   }
103 103
 
104 104
   MethodContext* Task::current_context(STATE) {
@@ -136,15 +136,15 @@ namespace rubinius {
136 136
 
137 137
   /* For details in msg, locate the proper method and begin execution
138 138
    * of it. */
139  
-  ExecuteStatus Task::send_message(Message& msg) {
  139
+  Object* Task::send_message(CallFrame* call_frame, Message& msg) {
140 140
     if(!msg.send_site->locate(state, msg)) tragic_failure(msg);
141 141
 
142 142
     if(!probe_->nil_p()) probe_->execute_method(state, this, msg);
143 143
 
144  
-    return msg.method->execute(state, this, msg);
  144
+    return msg.method->execute(state, call_frame, this, msg);
145 145
   }
146 146
 
147  
-  ExecuteStatus Task::send_message_slowly(Message& msg) {
  147
+  Object* Task::send_message_slowly(CallFrame* call_frame, Message& msg) {
148 148
     Symbol* original_name = msg.name;
149 149
     if(!GlobalCacheResolver::resolve(state, msg)) {
150 150
       msg.method_missing = true;
@@ -161,14 +161,16 @@ namespace rubinius {
161 161
 
162 162
     if(!probe_->nil_p()) probe_->execute_method(state, this, msg);
163 163
 
164  
-    return msg.method->execute(state, this, msg);
  164
+    return msg.method->execute(state, call_frame, this, msg);
165 165
   }
166 166
 
167 167
   bool Task::passed_arg_p(size_t pos) {
  168
+    abort();
168 169
     return active_->args >= pos;
169 170
   }
170 171
 
171 172
   Object* Task::call_object(STATE, Object* recv, Symbol* meth, Array* args) {
  173
+    abort();
172 174
     recv->send_on_task(state, this, meth, args);
173 175
 
174 176
     // HACK by calling directly into another Task, the context cache gets
@@ -180,6 +182,7 @@ namespace rubinius {
180 182
   }
181 183
 
182 184
   void Task::restore_sender() {
  185
+    abort();
183 186
     MethodContext *target = active_->sender();
184 187
 
185 188
     if(unlikely(profiler)) profiler->leave_method();
@@ -192,6 +195,7 @@ namespace rubinius {
192 195
   /* @todo Mirrors restore_sender too much, unify. */
193 196
   void Task::native_return(Object* return_value)
194 197
   {
  198
+    assert(0);
195 199
     if (profiler) {
196 200
       profiler->leave_method();
197 201
     }
@@ -214,7 +218,7 @@ namespace rubinius {
214 218
 
215 219
   /* Called after a primitive has executed and wants to return a value. */
216 220
   void Task::primitive_return(Object* value, Message& msg) {
217  
-    active_->clear_stack(msg.stack);
  221
+    assert(0);
218 222
     push(value);
219 223
   }
220 224
 
@@ -229,22 +233,6 @@ namespace rubinius {
229 233
 
230 234
     assert(current_ep);
231 235
     current_ep->return_to(this);
232  
-
233  
-    abort();
234  
-
235  
-    for(;;) {
236  
-      if(active_->has_unwinds_p()) {
237  
-        MethodContext::UnwindInfo& info = active_->pop_unwind();
238  
-        active_->position_stack(info.stack_depth);
239  
-        set_ip(info.target_ip);
240  
-        return;
241  
-      }
242  
-
243  
-      if(active_->sender()->nil_p()) break;
244  
-      if(profiler) profiler->leave_method();
245  
-
246  
-      restore_sender();
247  
-    }
248 236
   }
249 237
 
250 238
   Tuple* Task::locate_method_on(Object* recv, Symbol* sel, Object* priv_p) {
@@ -254,7 +242,7 @@ namespace rubinius {
254 242
     msg.lookup_from = recv->lookup_begin(state);
255 243
     msg.name = sel;
256 244
     msg.priv = (priv_p == Qtrue);
257  
-    msg.set_caller(active_);
  245
+    msg.set_caller(NULL); // HACK
258 246
 
259 247
     if(!GlobalCacheResolver::resolve(state, msg)) {
260 248
       return (Tuple*)Qnil;
@@ -270,7 +258,7 @@ namespace rubinius {
270 258
     return Tuple::from(state, 2, msg.method, msg.module);
271 259
   }
272 260
 
273  
-  void Task::attach_method(Object* recv, Symbol* name, CompiledMethod* method) {
  261
+  void Task::attach_method(CallFrame* call_frame, Object* recv, Symbol* name, CompiledMethod* method) {
274 262
     if(kind_of<Module>(recv)) {
275 263
       StaticScope* ss = StaticScope::create(state);
276 264
       ss->module(state, (Module*)recv);
@@ -278,14 +266,14 @@ namespace rubinius {
278 266
       method->scope(state, ss);
279 267
     } else {
280 268
       /* Push the current scope down. */
281  
-      method->scope(state, active_->cm()->scope());
  269
+      method->scope(state, call_frame->cm->scope());
282 270
     }
283 271
 
284  
-    add_method(recv->metaclass(state), name, method);
  272
+    add_method(call_frame, recv->metaclass(state), name, method);
285 273
   }
286 274
 
287  
-  void Task::add_method(Module* mod, Symbol* name, CompiledMethod* method) {
288  
-    method->scope(state, active_->cm()->scope());
  275
+  void Task::add_method(CallFrame* call_frame, Module* mod, Symbol* name, CompiledMethod* method) {
  276
+    method->scope(state, call_frame->cm->scope());
289 277
     method->serial(state, Fixnum::from(0));
290 278
     mod->method_table()->store(state, name, method);
291 279
     state->global_cache->clear(mod, name);
@@ -349,13 +337,14 @@ namespace rubinius {
349 337
    *
350 338
    * Returns the LookupTableAssociation object used to store the constant
351 339
    */
352  
-  LookupTableAssociation* Task::const_get_association(Symbol* name, bool* found) {
  340
+  LookupTableAssociation* Task::const_get_association(CallFrame* call_frame,
  341
+                                Symbol* name, bool* found) {
353 342
     StaticScope *cur;
354 343
     LookupTableAssociation* result;
355 344
 
356 345
     *found = false;
357 346
 
358  
-    cur = active_->cm()->scope();
  347
+    cur = call_frame->cm->scope();
359 348
     while(!cur->nil_p()) {
360 349
       if(cur->module() == G(object)) break;
361 350
 
@@ -365,7 +354,7 @@ namespace rubinius {
365 354
       cur = cur->parent();
366 355
     }
367 356
 
368  
-    Module* mod = active_->cm()->scope()->module();
  357
+    Module* mod = call_frame->cm->scope()->module();
369 358
     while(!mod->nil_p()) {
370 359
       result = mod->get_const_association(state, name, found);
371 360
       if(*found) return result;
@@ -380,8 +369,8 @@ namespace rubinius {
380 369
     return reinterpret_cast<LookupTableAssociation*>(Qnil);
381 370
   }
382 371
 
383  
-  Object* Task::const_get(Symbol* name, bool* found) {
384  
-    LookupTableAssociation* assoc = const_get_association(name, found);
  372
+  Object* Task::const_get(CallFrame* call_frame, Symbol* name, bool* found) {
  373
+    LookupTableAssociation* assoc = const_get_association(call_frame, name, found);
385 374
     if(*found) {
386 375
       return assoc->value();
387 376
     } else {
@@ -393,8 +382,8 @@ namespace rubinius {
393 382
     mod->set_const(state, name, val);
394 383
   }
395 384
 
396  
-  void Task::const_set(Symbol* name, Object* val) {
397  
-    active_->cm()->scope()->module()->set_const(state, name, val);
  385
+  void Task::const_set(CallFrame* call_frame, Symbol* name, Object* val) {
  386
+    call_frame->cm->scope()->module()->set_const(state, name, val);
398 387
   }
399 388
 
400 389
   void Task::yield_debugger() {
@@ -414,7 +403,7 @@ namespace rubinius {
414 403
 
415 404
     //sassert(chan->has_readers_p());
416 405
 
417  
-    active_->reference(state);
  406
+    // active_->reference(state);
418 407
 
419 408
     Thread* thr = G(current_thread);
420 409
     thr->frozen_stack(state, Qtrue);
@@ -455,13 +444,13 @@ namespace rubinius {
455 444
     return cls;
456 445
   }
457 446
 
458  
-  Class* Task::open_class(Object* super, Symbol* name, bool* created) {
  447
+  Class* Task::open_class(CallFrame* call_frame, Object* super, Symbol* name, bool* created) {
459 448
     Module* under;
460 449
 
461  
-    if(active_->cm()->scope()->nil_p()) {
  450
+    if(call_frame->cm->scope()->nil_p()) {
462 451
       under = G(object);
463 452
     } else {
464  
-      under = active_->cm()->scope()->module();
  453
+      under = call_frame->cm->scope()->module();
465 454
     }
466 455
 
467 456
     return open_class(under, super, name, created);
@@ -479,11 +468,11 @@ namespace rubinius {
479 468
     return add_class(state, under, super, name);
480 469
   }
481 470
 
482  
-  Module* Task::open_module(Symbol* name) {
  471
+  Module* Task::open_module(CallFrame* call_frame, Symbol* name) {
483 472
     Module* under = state->globals.object.get();
484 473
 
485  
-    if(!active_->cm()->scope()->nil_p()) {
486  
-      under = active_->cm()->scope()->module();
  474
+    if(!call_frame->cm->scope()->nil_p()) {
  475
+      under = call_frame->cm->scope()->module();
487 476
     }
488 477
 
489 478
     return open_module(under, name);
@@ -511,42 +500,51 @@ namespace rubinius {
511 500
   /* Used only in debugging and testing. Direct access to the stack
512 501
    * can be dangerous. */
513 502
   Object** Task::current_stack() {
  503
+    abort();
514 504
     return active_->stk;
515 505
   }
516 506
 
517 507
   void Task::push(Object* val) {
  508
+    abort();
518 509
     active_->push(val);
519 510
   }
520 511
 
521 512
   Object* Task::pop() {
  513
+    abort();
522 514
     return active_->pop();
523 515
   }
524 516
 
525 517
   Object* Task::stack_top() {
  518
+    abort();
526 519
     return active_->top();
527 520
   }
528 521
 
529 522
   /* Retrieve the object at position +pos+ in the current context */
530 523
   Object* Task::stack_at(size_t pos) {
  524
+    abort();
531 525
     return active_->stack_at(pos);
532 526
   }
533 527
 
534 528
   int Task::calculate_sp() {
  529
+    abort();
535 530
     return active_->calculate_sp();
536 531
   }
537 532
 
538 533
   /* Set the local variable at +pos+ to +val+ in the current context. */
539 534
   void Task::set_local(int pos, Object* val) {
  535
+    abort();
540 536
     active_->set_local(pos, val);
541 537
   }
542 538
 
543 539
   /* Get local variable at +pos+ in the current context. */
544 540
   Object* Task::get_local(int pos) {
  541
+    abort();
545 542
     return active_->get_local(pos);
546 543
   }
547 544
 
548 545
   /* Move the active context to executing instruction +ip+. */
549 546
   void Task::set_ip(int ip) {
  547
+    abort();
550 548
     active_->ip = ip;
551 549
     if(active_->native_ip != NULL) {
552 550
       MachineMethod* mm = active_->vmm->machine_method();
@@ -558,6 +556,7 @@ namespace rubinius {
558 556
 
559 557
   /* Returns the current instruction the active context is on. */
560 558
   int Task::current_ip() {
  559
+    abort();
561 560
     return active_->ip;
562 561
   }
563 562
 
@@ -579,6 +578,8 @@ namespace rubinius {
579 578
 
580 579
   /* This should only ever run for CompiledMethods currently. */
581 580
   void Task::execute() {
  581
+    abort();
  582
+    /*
582 583
     try {
583 584
       for(;;) {
584 585
         VMMethod* const vmm = active_->vmm;
@@ -600,6 +601,7 @@ namespace rubinius {
600 601
       Exception* e = Exception::make_type_error(state, exc.type, exc.object, exc.reason);
601 602
       raise_exception(e);
602 603
     }
  604
+    */
603 605
   }
604 606
 
605 607
   /** @todo Refactor the hell out of this with streams. */
@@ -688,7 +690,7 @@ namespace rubinius {
688 690
     close_body(level);
689 691
   }
690 692
 
691  
-  ExecuteStatus Task::task_dup(STATE, Executable* exec, Task* task_, Message& msg) {
  693
+  Object* Task::task_dup(STATE, Executable* exec, CallFrame* call_frame, Task* task_, Message& msg) {
692 694
 
693 695
     Task* recv = try_as<Task>(msg.recv);
694 696
 
@@ -705,13 +707,9 @@ namespace rubinius {
705 707
 
706 708
     ret->active(state, recv->active()->dup_chain(state));
707 709
 
708  
-    ret->active()->clear_stack(msg.stack);
709 710
     ret->active()->push((Object*)Qnil);
710 711
 
711  
-    msg.caller()->clear_stack(msg.stack);
712  
-    msg.caller()->push(ret);
713  
-
714  
-    return cExecuteContinue;
  712
+    return ret;
715 713
   }
716 714
 }
717 715
 
24  vm/builtin/task.hpp
@@ -81,7 +81,7 @@ namespace rubinius {
81 81
     static Task* current(STATE);
82 82
 
83 83
     // Ruby.primitive? :task_set_current
84  
-    static ExecuteStatus set_current(STATE, Executable* exec, Task* task_, Message& msg);
  84
+    static Object* set_current(STATE, Executable* exec, Task* task_, Message& msg);
85 85
 
86 86