Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: src/wasm/wasm-debug.cc

Issue 2784453002: [wasm] Fix serialization after instantiation (Closed)
Patch Set: feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698