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 <unordered_map> | 5 #include <unordered_map> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/assert-scope.h" | 8 #include "src/assert-scope.h" |
9 #include "src/compiler/wasm-compiler.h" | 9 #include "src/compiler/wasm-compiler.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 instance_.mem_start = | 87 instance_.mem_start = |
88 reinterpret_cast<byte*>(mem_buffer->backing_store()); | 88 reinterpret_cast<byte*>(mem_buffer->backing_store()); |
89 CHECK(mem_buffer->byte_length()->ToUint32(&instance_.mem_size)); | 89 CHECK(mem_buffer->byte_length()->ToUint32(&instance_.mem_size)); |
90 } else { | 90 } else { |
91 DCHECK_EQ(0, instance_.module->min_mem_pages); | 91 DCHECK_EQ(0, instance_.module->min_mem_pages); |
92 instance_.mem_start = nullptr; | 92 instance_.mem_start = nullptr; |
93 instance_.mem_size = 0; | 93 instance_.mem_size = 0; |
94 } | 94 } |
95 | 95 |
96 // Set pointer to globals storage. | 96 // Set pointer to globals storage. |
97 if (instance->has_globals_buffer()) { | 97 instance_.globals_start = |
98 instance_.globals_start = | 98 debug_info->wasm_instance()->compiled_module()->GetGlobalsStartOrNull(); |
99 reinterpret_cast<byte*>(instance->globals_buffer()->backing_store()); | |
100 } | |
101 } | 99 } |
102 | 100 |
103 ~InterpreterHandle() { | 101 ~InterpreterHandle() { |
104 DCHECK_EQ(0, activations_.size()); | 102 DCHECK_EQ(0, activations_.size()); |
105 } | 103 } |
106 | 104 |
107 static ModuleBytesEnv GetBytesEnv(WasmInstance* instance, | 105 static ModuleBytesEnv GetBytesEnv(WasmInstance* instance, |
108 WasmDebugInfo* debug_info) { | 106 WasmDebugInfo* debug_info) { |
109 // Return raw pointer into heap. The WasmInterpreter will make its own copy | 107 // Return raw pointer into heap. The WasmInterpreter will make its own copy |
110 // of this data anyway, and there is no heap allocation in-between. | 108 // of this data anyway, and there is no heap allocation in-between. |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 } | 541 } |
544 | 542 |
545 void WasmDebugInfo::Unwind(Address frame_pointer) { | 543 void WasmDebugInfo::Unwind(Address frame_pointer) { |
546 return GetInterpreterHandle(this)->Unwind(frame_pointer); | 544 return GetInterpreterHandle(this)->Unwind(frame_pointer); |
547 } | 545 } |
548 | 546 |
549 uint64_t WasmDebugInfo::NumInterpretedCalls() { | 547 uint64_t WasmDebugInfo::NumInterpretedCalls() { |
550 auto handle = GetInterpreterHandleOrNull(this); | 548 auto handle = GetInterpreterHandleOrNull(this); |
551 return handle ? handle->NumInterpretedCalls() : 0; | 549 return handle ? handle->NumInterpretedCalls() : 0; |
552 } | 550 } |
OLD | NEW |