| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.first.data(), disassembly.first.length()); | 185 String16 source(disassembly.first.data(), disassembly.first.length()); |
| 186 | 186 |
| 187 Local<DebugInterface::Script> script_wrapper = | 187 Local<DebugInterface::Script> script_wrapper = |
| 188 DebugInterface::Script::Wrap(isolate, script_.Get(isolate)) | 188 DebugInterface::Script::Wrap(isolate, script_.Get(isolate)) |
| 189 .ToLocalChecked(); | 189 .ToLocalChecked(); |
| 190 loc->translation->AddFakeScript( | 190 loc->translation->AddFakeScript( |
| 191 V8DebuggerScript::CreateWasm(script_wrapper, std::move(fake_script_id), | 191 V8DebuggerScript::CreateWasm( |
| 192 std::move(fake_script_url), | 192 script_wrapper, loc->translation, std::move(fake_script_id), |
| 193 std::move(source)), | 193 std::move(fake_script_url), std::move(source)), |
| 194 this, loc->context_group_id); | 194 this, loc->context_group_id); |
| 195 | 195 |
| 196 return it->second; | 196 return it->second; |
| 197 } | 197 } |
| 198 | 198 |
| 199 const OffsetTable *GetReverseTable(int func_index) { | 199 const OffsetTable *GetReverseTable(int func_index) { |
| 200 auto it = reverse_tables_.find(func_index); | 200 auto it = reverse_tables_.find(func_index); |
| 201 if (it != reverse_tables_.end()) return &it->second; | 201 if (it != reverse_tables_.end()) return &it->second; |
| 202 | 202 |
| 203 // Find offset table, copy and sort it to get reverse table. | 203 // Find offset table, copy and sort it to get reverse table. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } | 301 } |
| 302 | 302 |
| 303 void WasmTranslation::AddFakeScript( | 303 void WasmTranslation::AddFakeScript( |
| 304 std::unique_ptr<V8DebuggerScript> fake_script, TranslatorImpl *translator, | 304 std::unique_ptr<V8DebuggerScript> fake_script, TranslatorImpl *translator, |
| 305 int context_group_id) { | 305 int context_group_id) { |
| 306 bool inserted = | 306 bool inserted = |
| 307 fake_scripts_.insert(std::make_pair(fake_script->scriptId(), translator)) | 307 fake_scripts_.insert(std::make_pair(fake_script->scriptId(), translator)) |
| 308 .second; | 308 .second; |
| 309 DCHECK(inserted); | 309 DCHECK(inserted); |
| 310 USE(inserted); | 310 USE(inserted); |
| 311 DCHECK_NE(-1, context_group_id); |
| 311 V8DebuggerAgentImpl *agent = | 312 V8DebuggerAgentImpl *agent = |
| 312 debugger_->inspector()->enabledDebuggerAgentForGroup(context_group_id); | 313 debugger_->inspector()->enabledDebuggerAgentForGroup(context_group_id); |
| 313 agent->didParseSource(std::move(fake_script), true); | 314 agent->didParseSource(std::move(fake_script), true); |
| 314 } | 315 } |
| OLD | NEW |