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/inspector/wasm-translation.h" | 5 #include "src/inspector/wasm-translation.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
10 #include "src/inspector/protocol/Debugger.h" | 10 #include "src/inspector/protocol/Debugger.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 return func_index; | 165 return func_index; |
166 } | 166 } |
167 | 167 |
168 const OffsetTable &GetOffsetTable(const TransLocation *loc) { | 168 const OffsetTable &GetOffsetTable(const TransLocation *loc) { |
169 int func_index = loc->line; | 169 int func_index = loc->line; |
170 auto it = offset_tables_.find(func_index); | 170 auto it = offset_tables_.find(func_index); |
171 if (it != offset_tables_.end()) return it->second; | 171 if (it != offset_tables_.end()) return it->second; |
172 | 172 |
173 v8::Isolate *isolate = loc->translation->isolate_; | 173 v8::Isolate *isolate = loc->translation->isolate_; |
174 debug::WasmDisassembly disassembly_result = | 174 debug::WasmDisassembly disassembly_result = |
175 DebugInterface::DisassembleWasmFunction(isolate, script_.Get(isolate), | 175 debug::DebugInterface::DisassembleWasmFunction( |
176 func_index); | 176 isolate, script_.Get(isolate), func_index); |
177 | 177 |
178 it = offset_tables_ | 178 it = offset_tables_ |
179 .insert(std::make_pair(func_index, | 179 .insert(std::make_pair(func_index, |
180 std::move(disassembly_result.offset_table))) | 180 std::move(disassembly_result.offset_table))) |
181 .first; | 181 .first; |
182 | 182 |
183 String16 fake_script_id = GetFakeScriptId(loc); | 183 String16 fake_script_id = GetFakeScriptId(loc); |
184 String16 fake_script_url = GetFakeScriptUrl(loc); | 184 String16 fake_script_url = GetFakeScriptUrl(loc); |
185 String16 source(disassembly_result.disassembly.data(), | 185 String16 source(disassembly_result.disassembly.data(), |
186 disassembly_result.disassembly.length()); | 186 disassembly_result.disassembly.length()); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 int context_group_id) { | 299 int context_group_id) { |
300 bool inserted = | 300 bool inserted = |
301 fake_scripts_.insert(std::make_pair(fake_script->scriptId(), translator)) | 301 fake_scripts_.insert(std::make_pair(fake_script->scriptId(), translator)) |
302 .second; | 302 .second; |
303 DCHECK(inserted); | 303 DCHECK(inserted); |
304 USE(inserted); | 304 USE(inserted); |
305 V8DebuggerAgentImpl *agent = | 305 V8DebuggerAgentImpl *agent = |
306 debugger_->inspector()->enabledDebuggerAgentForGroup(context_group_id); | 306 debugger_->inspector()->enabledDebuggerAgentForGroup(context_group_id); |
307 agent->didParseSource(std::move(fake_script), true); | 307 agent->didParseSource(std::move(fake_script), true); |
308 } | 308 } |
OLD | NEW |