OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/compiler/wasm-compiler.h" | 9 #include "src/compiler/wasm-compiler.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Handle<WasmInstanceObject> instance = | 162 Handle<WasmInstanceObject> instance = |
163 Handle<WasmInstanceObject>::cast(instance_obj); | 163 Handle<WasmInstanceObject>::cast(instance_obj); |
164 | 164 |
165 // The arg buffer is the raw pointer to the caller's stack. It looks like a | 165 // The arg buffer is the raw pointer to the caller's stack. It looks like a |
166 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just | 166 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just |
167 // cast it back to the raw pointer. | 167 // cast it back to the raw pointer. |
168 CHECK(!arg_buffer_obj->IsHeapObject()); | 168 CHECK(!arg_buffer_obj->IsHeapObject()); |
169 CHECK(arg_buffer_obj->IsSmi()); | 169 CHECK(arg_buffer_obj->IsSmi()); |
170 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); | 170 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); |
171 | 171 |
| 172 // Set the current isolate's context, saving the previous one. |
| 173 SaveContext save(isolate); |
| 174 isolate->set_context(*instance->compiled_module()->native_context()); |
| 175 |
172 instance->debug_info()->RunInterpreter(func_index, arg_buffer); | 176 instance->debug_info()->RunInterpreter(func_index, arg_buffer); |
173 return isolate->heap()->undefined_value(); | 177 return isolate->heap()->undefined_value(); |
174 } | 178 } |
175 | 179 |
176 } // namespace internal | 180 } // namespace internal |
177 } // namespace v8 | 181 } // namespace v8 |
OLD | NEW |