OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/wasm/wasm-objects.h" | 5 #include "src/wasm/wasm-objects.h" |
6 #include "src/utils.h" | 6 #include "src/utils.h" |
7 | 7 |
8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 v8::debug::WasmDisassembly::OffsetTable offset_table; | 1034 v8::debug::WasmDisassembly::OffsetTable offset_table; |
1035 | 1035 |
1036 PrintWasmText(module(), module_bytes, static_cast<uint32_t>(func_index), | 1036 PrintWasmText(module(), module_bytes, static_cast<uint32_t>(func_index), |
1037 disassembly_os, &offset_table); | 1037 disassembly_os, &offset_table); |
1038 | 1038 |
1039 return {disassembly_os.str(), std::move(offset_table)}; | 1039 return {disassembly_os.str(), std::move(offset_table)}; |
1040 } | 1040 } |
1041 | 1041 |
1042 bool WasmCompiledModule::GetPossibleBreakpoints( | 1042 bool WasmCompiledModule::GetPossibleBreakpoints( |
1043 const v8::debug::Location& start, const v8::debug::Location& end, | 1043 const v8::debug::Location& start, const v8::debug::Location& end, |
1044 std::vector<v8::debug::Location>* locations) { | 1044 std::vector<v8::debug::BreakLocation>* locations) { |
1045 DisallowHeapAllocation no_gc; | 1045 DisallowHeapAllocation no_gc; |
1046 | 1046 |
1047 std::vector<WasmFunction>& functions = module()->functions; | 1047 std::vector<WasmFunction>& functions = module()->functions; |
1048 if (start.GetLineNumber() < 0 || start.GetColumnNumber() < 0 || | 1048 if (start.GetLineNumber() < 0 || start.GetColumnNumber() < 0 || |
1049 (!end.IsEmpty() && | 1049 (!end.IsEmpty() && |
1050 (end.GetLineNumber() < 0 || end.GetColumnNumber() < 0))) | 1050 (end.GetLineNumber() < 0 || end.GetColumnNumber() < 0))) |
1051 return false; | 1051 return false; |
1052 | 1052 |
1053 // start_func_index, start_offset and end_func_index is inclusive. | 1053 // start_func_index, start_offset and end_func_index is inclusive. |
1054 // end_offset is exclusive. | 1054 // end_offset is exclusive. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 BytecodeIterator iterator(module_start + func.code_start_offset, | 1097 BytecodeIterator iterator(module_start + func.code_start_offset, |
1098 module_start + func.code_end_offset, &locals); | 1098 module_start + func.code_end_offset, &locals); |
1099 DCHECK_LT(0u, locals.encoded_size); | 1099 DCHECK_LT(0u, locals.encoded_size); |
1100 for (uint32_t offset : iterator.offsets()) { | 1100 for (uint32_t offset : iterator.offsets()) { |
1101 uint32_t total_offset = func.code_start_offset + offset; | 1101 uint32_t total_offset = func.code_start_offset + offset; |
1102 if (total_offset >= end_offset) { | 1102 if (total_offset >= end_offset) { |
1103 DCHECK_EQ(end_func_index, func_idx); | 1103 DCHECK_EQ(end_func_index, func_idx); |
1104 break; | 1104 break; |
1105 } | 1105 } |
1106 if (total_offset < start_offset) continue; | 1106 if (total_offset < start_offset) continue; |
1107 locations->push_back(v8::debug::Location(func_idx, offset)); | 1107 locations->emplace_back(func_idx, offset, debug::kCommonBreakLocation); |
1108 } | 1108 } |
1109 } | 1109 } |
1110 return true; | 1110 return true; |
1111 } | 1111 } |
1112 | 1112 |
1113 bool WasmCompiledModule::SetBreakPoint( | 1113 bool WasmCompiledModule::SetBreakPoint( |
1114 Handle<WasmCompiledModule> compiled_module, int* position, | 1114 Handle<WasmCompiledModule> compiled_module, int* position, |
1115 Handle<Object> break_point_object) { | 1115 Handle<Object> break_point_object) { |
1116 Isolate* isolate = compiled_module->GetIsolate(); | 1116 Isolate* isolate = compiled_module->GetIsolate(); |
1117 | 1117 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; | 1180 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; |
1181 Isolate* isolate = array->GetIsolate(); | 1181 Isolate* isolate = array->GetIsolate(); |
1182 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && | 1182 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && |
1183 !array->get(kNextInstanceWrapper)->IsFixedArray()) | 1183 !array->get(kNextInstanceWrapper)->IsFixedArray()) |
1184 return false; | 1184 return false; |
1185 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && | 1185 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && |
1186 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1186 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
1187 return false; | 1187 return false; |
1188 return true; | 1188 return true; |
1189 } | 1189 } |
OLD | NEW |