Chromium Code Reviews| 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 // Reset the current isolate's context. | |
| 173 isolate->set_context(*instance->compiled_module()->native_context()); | |
|
titzer
2017/01/25 10:04:09
Do we need to set it back when returning, or will
Yang
2017/01/25 10:12:22
We have a SaveContext scope. Is that something you
Clemens Hammacher
2017/01/25 11:41:57
I am not sure if resetting is needed, but since th
| |
| 174 | |
| 172 instance->debug_info()->RunInterpreter(func_index, arg_buffer); | 175 instance->debug_info()->RunInterpreter(func_index, arg_buffer); |
| 173 return isolate->heap()->undefined_value(); | 176 return isolate->heap()->undefined_value(); |
| 174 } | 177 } |
| 175 | 178 |
| 176 } // namespace internal | 179 } // namespace internal |
| 177 } // namespace v8 | 180 } // namespace v8 |
| OLD | NEW |