| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) { | 175 RUNTIME_FUNCTION(Runtime_ClearThreadInWasm) { |
| 176 trap_handler::ClearThreadInWasm(); | 176 trap_handler::ClearThreadInWasm(); |
| 177 return isolate->heap()->undefined_value(); | 177 return isolate->heap()->undefined_value(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { | 180 RUNTIME_FUNCTION(Runtime_WasmRunInterpreter) { |
| 181 DCHECK_EQ(3, args.length()); | 181 DCHECK_EQ(3, args.length()); |
| 182 HandleScope scope(isolate); | 182 HandleScope scope(isolate); |
| 183 CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); | 183 CONVERT_ARG_HANDLE_CHECKED(WasmInstanceObject, instance, 0); |
| 184 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); | 184 CONVERT_NUMBER_CHECKED(int32_t, func_index, Int32, args[1]); |
| 185 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); | 185 CONVERT_ARG_HANDLE_CHECKED(Object, arg_buffer_obj, 2); |
| 186 CHECK(WasmInstanceObject::IsWasmInstanceObject(*instance_obj)); | |
| 187 Handle<WasmInstanceObject> instance = | |
| 188 Handle<WasmInstanceObject>::cast(instance_obj); | |
| 189 | 186 |
| 190 // The arg buffer is the raw pointer to the caller's stack. It looks like a | 187 // The arg buffer is the raw pointer to the caller's stack. It looks like a |
| 191 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just | 188 // Smi (lowest bit not set, as checked by IsSmi), but is no valid Smi. We just |
| 192 // cast it back to the raw pointer. | 189 // cast it back to the raw pointer. |
| 193 CHECK(!arg_buffer_obj->IsHeapObject()); | 190 CHECK(!arg_buffer_obj->IsHeapObject()); |
| 194 CHECK(arg_buffer_obj->IsSmi()); | 191 CHECK(arg_buffer_obj->IsSmi()); |
| 195 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); | 192 uint8_t* arg_buffer = reinterpret_cast<uint8_t*>(*arg_buffer_obj); |
| 196 | 193 |
| 197 // Set the current isolate's context. | 194 // Set the current isolate's context. |
| 198 DCHECK_NULL(isolate->context()); | 195 DCHECK_NULL(isolate->context()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 241 |
| 245 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { | 242 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { |
| 246 DCHECK(args.length() == 0); | 243 DCHECK(args.length() == 0); |
| 247 HandleScope scope(isolate); | 244 HandleScope scope(isolate); |
| 248 | 245 |
| 249 return *wasm::CompileLazy(isolate); | 246 return *wasm::CompileLazy(isolate); |
| 250 } | 247 } |
| 251 | 248 |
| 252 } // namespace internal | 249 } // namespace internal |
| 253 } // namespace v8 | 250 } // namespace v8 |
| OLD | NEW |