| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return exception; | 152 return exception; |
| 153 } | 153 } |
| 154 | 154 |
| 155 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { | 155 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { |
| 156 DCHECK(args.length() == 3); | 156 DCHECK(args.length() == 3); |
| 157 HandleScope scope(isolate); | 157 HandleScope scope(isolate); |
| 158 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); | 158 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); |
| 159 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); | 159 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); |
| 160 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); | 160 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); |
| 161 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj)); | 161 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj)); |
| 162 Handle<WasmInstanceObject> instance = |
| 163 Handle<WasmInstanceObject>::cast(instance_obj); |
| 162 | 164 |
| 163 // 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 |
| 164 // 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 |
| 165 // cast it back to the raw pointer. | 167 // cast it back to the raw pointer. |
| 166 CHECK(!arg_buffer_obj->IsHeapObject()); | 168 CHECK(!arg_buffer_obj->IsHeapObject()); |
| 167 CHECK(arg_buffer_obj->IsSmi()); | 169 CHECK(arg_buffer_obj->IsSmi()); |
| 168 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); | 170 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); |
| 169 | 171 |
| 170 Handle<WasmInstanceObject> instance = | 172 instance->debug_info()->RunInterpreter(func_index, arg_buffer); |
| 171 Handle<WasmInstanceObject>::cast(instance_obj); | |
| 172 Handle<WasmDebugInfo> debug_info = | |
| 173 WasmInstanceObject::GetOrCreateDebugInfo(instance); | |
| 174 WasmDebugInfo::RunInterpreter(debug_info, func_index, arg_buffer); | |
| 175 return isolate->heap()->undefined_value(); | 173 return isolate->heap()->undefined_value(); |
| 176 } | 174 } |
| 177 | 175 |
| 178 } // namespace internal | 176 } // namespace internal |
| 179 } // namespace v8 | 177 } // namespace v8 |
| OLD | NEW |