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 14 matching lines...) Expand all Loading... |
25 Handle<JSObject> module_instance; | 25 Handle<JSObject> module_instance; |
26 | 26 |
27 { | 27 { |
28 // Get the module JSObject | 28 // Get the module JSObject |
29 DisallowHeapAllocation no_allocation; | 29 DisallowHeapAllocation no_allocation; |
30 const Address entry = Isolate::c_entry_fp(isolate->thread_local_top()); | 30 const Address entry = Isolate::c_entry_fp(isolate->thread_local_top()); |
31 Address pc = | 31 Address pc = |
32 Memory::Address_at(entry + StandardFrameConstants::kCallerPCOffset); | 32 Memory::Address_at(entry + StandardFrameConstants::kCallerPCOffset); |
33 Code* code = | 33 Code* code = |
34 isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code; | 34 isolate->inner_pointer_to_code_cache()->GetCacheEntry(pc)->code; |
35 Object* undefined = *isolate->factory()->undefined_value(); | 35 Object* owning_instance = wasm::GetOwningWasmInstance(code); |
36 Object* owning_instance = wasm::GetOwningWasmInstance(undefined, code); | |
37 CHECK_NOT_NULL(owning_instance); | 36 CHECK_NOT_NULL(owning_instance); |
38 CHECK_NE(owning_instance, undefined); | |
39 module_instance = handle(JSObject::cast(owning_instance), isolate); | 37 module_instance = handle(JSObject::cast(owning_instance), isolate); |
40 } | 38 } |
41 | 39 |
42 Address old_mem_start, new_mem_start; | 40 Address old_mem_start, new_mem_start; |
43 uint32_t old_size, new_size; | 41 uint32_t old_size, new_size; |
44 | 42 |
45 // Get mem buffer associated with module object | 43 // Get mem buffer associated with module object |
46 MaybeHandle<JSArrayBuffer> maybe_mem_buffer = | 44 MaybeHandle<JSArrayBuffer> maybe_mem_buffer = |
47 wasm::GetInstanceMemory(isolate, module_instance); | 45 wasm::GetInstanceMemory(isolate, module_instance); |
48 Handle<JSArrayBuffer> old_buffer; | 46 Handle<JSArrayBuffer> old_buffer; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 Object* exception = args[0]; | 133 Object* exception = args[0]; |
136 // The unwinder will only deliver exceptions to wasm if the exception is a | 134 // The unwinder will only deliver exceptions to wasm if the exception is a |
137 // Number or a Smi (which we have just converted to a Number.) This logic | 135 // Number or a Smi (which we have just converted to a Number.) This logic |
138 // lives in Isolate::is_catchable_by_wasm(Object*). | 136 // lives in Isolate::is_catchable_by_wasm(Object*). |
139 CHECK(exception->IsNumber()); | 137 CHECK(exception->IsNumber()); |
140 return exception; | 138 return exception; |
141 } | 139 } |
142 | 140 |
143 } // namespace internal | 141 } // namespace internal |
144 } // namespace v8 | 142 } // namespace v8 |
OLD | NEW |