40#if V8_ENABLE_WEBASSEMBLY
61 if (from == to)
return;
76 if (IsJSObject(*obj) &&
Cast<JSObject>(obj)->GetEmbedderFieldCount()) {
87 bool disabled =
false;
108 if (include_adjacent) {
111 if (it->second <=
end)
return it;
115 if (it->second <
end)
return it;
134 end = std::max(
end, it->first);
145 if (it ==
regions_.end())
return false;
150 Address existing_start = it->second;
151 Address existing_end = it->first;
173 hook_on_function_call_(false),
174 is_suppressed_(false),
175 break_disabled_(false),
176 break_points_active_(true),
177 break_on_caught_exception_(false),
178 break_on_uncaught_exception_(false),
179 side_effect_check_failed_(false),
180 debug_infos_(isolate),
190 if (debug_info->CanBreakAtEntry()) {
198 return it.GetBreakLocation();
208 bool* has_break_points) {
211 debug_info->GetBreakPointCount(
isolate_));
212 int break_points_hit_count = 0;
213 bool has_break_points_at_all =
false;
214 for (
size_t i = 0;
i < break_locations.size();
i++) {
215 bool location_has_break_points;
217 debug_info, &break_locations[
i], &location_has_break_points);
218 has_break_points_at_all |= location_has_break_points;
222 int num_objects = break_points_current_hit->length();
223 for (
int j = 0; j < num_objects; ++j) {
224 break_points_hit->set(break_points_hit_count++,
225 break_points_current_hit->get(j));
229 *has_break_points = has_break_points_at_all;
230 if (break_points_hit_count == 0)
return {};
232 break_points_hit->RightTrim(
isolate_, break_points_hit_count);
233 return break_points_hit;
238 std::vector<BreakLocation>* result_out) {
239 DCHECK(!debug_info->CanBreakAtEntry());
244 if (IsCode(*abstract_code, cage_base))
offset =
offset - 1;
245 int statement_position;
249 statement_position = it.statement_position();
252 if (it.statement_position() == statement_position) {
253 result_out->push_back(it.GetBreakLocation());
274 int closest_break = 0;
280 if (it.code_offset() <=
offset &&
offset - it.code_offset() < distance) {
281 closest_break = it.break_index();
282 distance =
offset - it.code_offset();
284 if (distance == 0)
break;
287 return closest_break;
293 if (!debug_info->HasBreakInfo() ||
294 !debug_info->HasBreakPoint(isolate,
position_)) {
297 if (debug_info->CanBreakAtEntry()) {
299 return debug_info->BreakAtEntry();
328 : debug_info_(debug_info),
330 source_position_iterator_(
332 position_ = debug_info->shared()->StartPosition();
342 if (source_position <=
position()) {
387 if (bytecode == interpreter::Bytecode::kDebugger) {
389 }
else if (bytecode == interpreter::Bytecode::kReturn) {
391 }
else if (bytecode == interpreter::Bytecode::kSuspendGenerator) {
434 int generator_object_reg_index = -1;
435 int generator_suspend_id = -1;
448 interpreter::Bytecode::kSuspendGenerator);
450 generator_object_reg_index = generator_obj_reg.
index();
457 generator_object_reg_index, generator_suspend_id);
507 DCHECK(current_frame_count >= target_frame_count);
509 while (current_frame_count > target_frame_count) {
513 DCHECK(current_frame_count == target_frame_count);
541 Root::kDebug,
nullptr,
556 list_.push_back(location);
557 map_.emplace(sfi->unique_id(), location);
563 auto it =
map_.find(sfi->unique_id());
564 if (it ==
map_.end())
return false;
571 auto it =
map_.find(sfi->unique_id());
572 if (it ==
map_.end())
return {};
580 for (; it.HasNext(); it.Advance()) {
582 if (debug_info->shared() != sfi)
continue;
601 auto it =
map_.find(sfi->unique_id());
657 const bool hitInstrumentationBreak =
659 bool shouldPauseAfterInstrumentation =
false;
660 if (hitInstrumentationBreak) {
665 shouldPauseAfterInstrumentation =
true;
669 shouldPauseAfterInstrumentation =
false;
678 bool has_break_points;
679 bool scheduled_break =
687 if (scheduled_break) {
693 if (is_debugger_statement) {
703 lastStepAction, break_reasons);
705 if (is_debugger_statement) {
714 DCHECK(debug_info->BreakAtEntry());
733 if (current_frame_count > target_frame_count)
return;
739 bool step_break =
false;
740 switch (step_action) {
742 if (has_break_points) {
748 if (current_frame_count > target_frame_count)
return;
753 if (current_frame_count > target_frame_count)
return;
772 const bool frame_or_statement_changed =
773 current_frame_count != last_frame_count ||
779 const bool potential_single_statement_loop =
780 current_frame_count == last_frame_count &&
782 step_break = step_break || location.
IsReturn() ||
783 potential_single_statement_loop ||
784 frame_or_statement_changed;
798 if (is_debugger_statement) {
805 if (is_debugger_statement) {
818 bool has_break_points_to_check =
820 if (!has_break_points_to_check)
return {};
825 if (!IsFixedArray(*break_points)) {
831 for (
int i = 0;
i < array->
length(); ++
i) {
832 const auto break_point =
843 if (!function->HasBytecodeArray()) {
847 function->GetBytecodeArray(
isolate_);
850 return bytecode == interpreter::Bytecode::kDebugger;
860 bool* has_break_points) {
862 bool has_break_points_to_check =
864 if (!has_break_points_to_check) {
865 *has_break_points =
false;
875 const std::vector<BreakLocation>& locations) {
898#if V8_ENABLE_WEBASSEMBLY
915 if (!debug_info.has_value())
return false;
916 *out =
handle(debug_info.value(), isolate);
924 bool is_break_at_entry) {
933 if (!break_point->condition()->length())
return true;
938 if (is_break_at_entry) {
943 const int inlined_jsframe_index = 0;
944 const bool throw_on_side_effect =
false;
951 bool exception_thrown =
true;
953 exception_thrown =
false;
966 exception_thrown, v8::Utils::ToLocal(maybe_exception));
974 int* source_position) {
999 int* source_position,
int*
id) {
1004#if V8_ENABLE_WEBASSEMBLY
1005 if (script->type() == Script::Type::kWasm) {
1006 RecordWasmScriptWithBreakpoints(script);
1033 int source_position) {
1035 if (debug_info->CanBreakAtEntry()) {
1038 DCHECK(debug_info->HasInstrumentedBytecodeArray());
1040 it.SkipToPosition(source_position);
1041 return it.position();
1048 if (debug_info->CanBreakAtEntry()) {
1049 debug_info->SetBreakAtEntry();
1051 if (!debug_info->HasInstrumentedBytecodeArray())
return;
1053 for (
int i = 0;
i < break_points->length();
i++) {
1054 if (IsUndefined(break_points->get(
i),
isolate_))
continue;
1056 if (info->GetBreakPointCount(
isolate_) == 0)
continue;
1057 DCHECK(debug_info->HasInstrumentedBytecodeArray());
1059 it.SkipToPosition(info->source_position());
1068 if (debug_info->CanBreakAtEntry()) {
1069 debug_info->ClearBreakAtEntry();
1073 if (!debug_info->HasInstrumentedBytecodeArray() ||
1074 !debug_info->HasBreakInfo()) {
1080 it.ClearDebugBreak();
1090 for (; it.HasNext(); it.Advance()) {
1092 if (!debug_info->HasBreakInfo())
continue;
1100 if (debug_info->GetBreakPointCount(
isolate_) == 0) {
1101 debug_info->ClearBreakInfo(
isolate_);
1102 if (debug_info->IsEmpty()) it.DeleteNext();
1115 int id = debug_info->debugging_id();
1118 debug_info->set_debugging_id(
id);
1134 int source_position = 0;
1135#if V8_ENABLE_WEBASSEMBLY
1136 if (shared->HasWasmExportedFunctionData()) {
1138 shared->wasm_exported_function_data();
1139 int func_index = function_data->function_index();
1141 CHECK(function_data->instance_data()->has_instance_object());
1143 function_data->instance_data()->instance_object()->module_object();
1146 script, func_index, breakpoint);
1159#if V8_ENABLE_WEBASSEMBLY
1160void Debug::SetInstrumentationBreakpointForWasmScript(
1163 DCHECK_EQ(Script::Type::kWasm, script->type());
1168 RecordWasmScriptWithBreakpoints(script);
1172void Debug::RemoveBreakpointForWasmScript(DirectHandle<Script> script,
int id) {
1174 if (script->type() == Script::Type::kWasm) {
1179void Debug::RecordWasmScriptWithBreakpoints(DirectHandle<Script> script) {
1181 if (wasm_scripts_with_break_points_.is_null()) {
1182 DirectHandle<WeakArrayList> new_list =
1184 wasm_scripts_with_break_points_ =
1189 for (
int idx = wasm_scripts_with_break_points_->length() - 1; idx >= 0;
1192 if (wasm_scripts_with_break_points_->Get(idx).GetHeapObject(
1194 wasm_script == *script) {
1199 DirectHandle<WeakArrayList> new_list =
1201 MaybeObjectDirectHandle{script});
1202 if (*new_list != *wasm_scripts_with_break_points_) {
1204 wasm_scripts_with_break_points_.location());
1205 wasm_scripts_with_break_points_ =
1218#if V8_ENABLE_WEBASSEMBLY
1220 if (!wasm_scripts_with_break_points_.is_null()) {
1222 for (
int idx = wasm_scripts_with_break_points_->length() - 1; idx >= 0;
1225 if (wasm_scripts_with_break_points_->Get(idx).GetHeapObject(
1226 &raw_wasm_script)) {
1229 wasm_script->wasm_native_module()->GetDebugInfo()->RemoveIsolate(
1239 bool returns_only) {
1248 DCHECK(debug_info->HasInstrumentedBytecodeArray());
1250 if (returns_only && !it.GetBreakLocation().IsReturnOrSuspend())
continue;
1276 bool is_break_at_entry = debug_info->BreakAtEntry();
1278 if (!IsFixedArray(*break_points)) {
1285 break_points_hit->set(0, *break_points);
1286 return break_points_hit;
1290 int num_objects = array->length();
1293 int break_points_hit_count = 0;
1294 *has_break_points =
false;
1295 for (
int i = 0;
i < num_objects; ++
i) {
1296 const auto break_point =
1300 break_points_hit->set(break_points_hit_count++, *break_point);
1303 if (break_points_hit_count == 0)
return {};
1304 break_points_hit->RightTrim(
isolate_, break_points_hit_count);
1305 return break_points_hit;
1366 while (!it.done()) {
1369 std::vector<Tagged<SharedFunctionInfo>> infos;
1371 current_frame_count -= infos.size();
1376 if (it.done())
return;
1378 bool found_handler =
false;
1381 for (; !it.done(); it.Advance()) {
1386 LazyDeoptimizeReason::kDebugger);
1389 for (
size_t i = summaries.
size();
i != 0;
i--, current_frame_count--) {
1391 if (!found_handler) {
1395 if (summaries.
size() > 1) {
1397 summary.AsJavaScript().abstract_code();
1401 found_handler = table.LookupHandlerIndexForRange(code_offset) !=
1404 found_handler =
true;
1408 if (found_handler) {
1416 summary.AsJavaScript().function()->shared(),
isolate_);
1489#if V8_ENABLE_WEBASSEMBLY
1490 }
else if (frame->is_wasm() && step_action !=
StepOut) {
1491#if V8_ENABLE_DRUMBRAKE
1494 if (frame->is_wasm_interpreter_entry())
return;
1497 WasmFrame* wasm_frame = WasmFrame::cast(frame);
1498 auto* debug_info = wasm_frame->native_module()->GetDebugInfo();
1499 if (debug_info->PrepareStep(wasm_frame)) {
1511 switch (step_action) {
1519 if (!shared.is_null()) {
1538 if (IsWeakFixedArray(*awaited_by_holder,
isolate_)) {
1540 if (weak_fixed_array->length() == 1 &&
1541 weak_fixed_array->get(0).IsWeak()) {
1543 weak_fixed_array->get(0).GetHeapObjectAssumeWeak(
isolate_),
1545 if (IsJSGeneratorObject(*awaited_by)) {
1557 bool in_current_frame =
true;
1559#if V8_ENABLE_WEBASSEMBLY
1560#if V8_ENABLE_DRUMBRAKE
1563 if (frame->is_wasm_interpreter_entry())
continue;
1565 if (frames_it.
frame()->is_wasm()) {
1566 if (in_current_frame) {
1567 in_current_frame =
false;
1571 WasmFrame* wasm_frame = WasmFrame::cast(frames_it.
frame());
1572 auto* debug_info = wasm_frame->native_module()->GetDebugInfo();
1573 if (debug_info->IsFrameBlackboxed(wasm_frame))
continue;
1574 debug_info->PrepareStepOutTo(wasm_frame);
1582 LazyDeoptimizeReason::kDebugger);
1585 std::vector<Handle<SharedFunctionInfo>> infos;
1587 for (; !infos.empty(); current_frame_count--) {
1590 if (in_current_frame) {
1592 in_current_frame =
false;
1616 RCS_SCOPE(isolate, RuntimeCallCounterId::kDebugger);
1617 if (!shared->HasBreakInfo(isolate)) {
1618 return isolate->factory()->undefined_value();
1622 isolate->debug()->TryGetDebugInfo(*shared).value(), isolate);
1623 if (debug_info->GetBreakPointCount(isolate) == 0) {
1624 return isolate->factory()->undefined_value();
1627 debug_info->GetBreakPointCount(isolate));
1629 for (
int i = 0;
i < debug_info->break_points()->
length(); ++
i) {
1630 if (!IsUndefined(debug_info->break_points()->get(
i), isolate)) {
1633 int break_points = break_point_info->GetBreakPointCount(isolate);
1634 if (break_points == 0)
continue;
1635 for (
int j = 0; j < break_points; ++j) {
1636 locations->set(
count++,
1673 for (; it.HasNext(); it.Advance()) {
1696 DiscardBaselineCodeVisitor() :
shared_(SharedFunctionInfo()) {}
1698 void VisitThread(Isolate* isolate, ThreadLocalTop* top)
override {
1700 bool deopt_all =
shared_ == SharedFunctionInfo();
1701 for (JavaScriptStackFrameIterator it(isolate, top); !it.done();
1703 if (!deopt_all && it.frame()->function()->shared() != shared_)
continue;
1704 if (it.frame()->type() != StackFrame::BASELINE &&
1705 it.frame()->type() != StackFrame::INTERPRETED) {
1713 if (code->kind() == CodeKind::BASELINE) {
1715 int bytecode_offset = code->GetBytecodeOffsetForBaselinePC(
1716 frame->pc(), frame->GetBytecodeArray());
1717 Address* pc_addr = frame->pc_address();
1720 advance =
BUILTIN_CODE(isolate, BaselineOutOfLinePrologueDeopt)
1721 ->instruction_start();
1723 advance =
BUILTIN_CODE(isolate, InterpreterEnterAtNextBytecode)
1724 ->instruction_start();
1728 frame->LookupCode()->SetMarkedForDeoptimization(
1729 isolate, LazyDeoptimizeReason::kDebugger);
1747 DCHECK(shared->HasBaselineCode());
1748 DiscardBaselineCodeVisitor visitor(shared);
1754 shared->FlushBaselineCode();
1756 obj = iterator.
Next()) {
1757 if (IsJSFunction(obj)) {
1759 if (fun->shared() == shared && fun->ActiveTierIsBaseline(
isolate_)) {
1760 fun->UpdateCode(*trampoline);
1768 DiscardBaselineCodeVisitor visitor;
1774 obj = iterator.
Next()) {
1775 if (IsJSFunction(obj)) {
1777 if (fun->ActiveTierIsBaseline(
isolate_)) {
1778 fun->UpdateCode(*trampoline);
1780 }
else if (IsSharedFunctionInfo(obj)) {
1782 if (shared->HasBaselineCode()) {
1783 shared->FlushBaselineCode();
1792 if (shared->HasBaselineCode()) {
1804 DCHECK(shared->is_compiled());
1807 if (debug_info->flags(
kRelaxedLoad) & DebugInfo::kPreparedForDebugExecution) {
1813 if (debug_info->CanBreakAtEntry()) {
1821 if (shared->HasBytecodeArray()) {
1822 DCHECK(!shared->HasBaselineCode());
1826 if (debug_info->CanBreakAtEntry()) {
1836 debug_info->set_flags(
1837 debug_info->flags(
kRelaxedLoad) | DebugInfo::kPreparedForDebugExecution,
1843bool IsJSFunctionAndNeedsTrampoline(
Isolate* isolate,
1845 if (!IsJSFunction(maybe_function))
return false;
1846 std::optional<Tagged<DebugInfo>> debug_info =
1847 isolate->debug()->TryGetDebugInfo(
1849 return debug_info.has_value() && debug_info.value()->CanBreakAtEntry();
1860 bool needs_to_use_trampoline =
false;
1862 bool needs_to_clear_ic =
false;
1865 for (; it.HasNext(); it.Advance()) {
1867 if (debug_info->CanBreakAtEntry()) {
1868 needs_to_use_trampoline =
true;
1869 if (debug_info->shared()->IsApiFunction()) {
1870 needs_to_clear_ic =
true;
1876 if (!needs_to_use_trampoline)
return;
1880 std::vector<Handle<JSFunction>> needs_compile;
1881 using AccessorPairWithContext =
1883 std::vector<AccessorPairWithContext> needs_instantiate;
1886 std::set<Tagged<AccessorPair>> recorded;
1890 obj = iterator.
Next()) {
1891 if (needs_to_clear_ic && IsFeedbackVector(obj)) {
1894 }
else if (IsJSFunctionAndNeedsTrampoline(
isolate_, obj)) {
1899 fun->UpdateCode(*trampoline);
1901 }
else if (IsJSObject(obj)) {
1909 if (!IsAccessorPair(value))
continue;
1912 if (!IsFunctionTemplateInfo(accessor_pair->getter()) &&
1913 !IsFunctionTemplateInfo(accessor_pair->setter())) {
1916 if (recorded.find(accessor_pair) != recorded.end())
continue;
1918 needs_instantiate.emplace_back(
1921 recorded.insert(accessor_pair);
1930 for (AccessorPairWithContext tuple : needs_instantiate) {
1951 &is_compiled_scope);
1953 fun->UpdateCode(*trampoline);
1960 std::vector<BreakLocation>* locations) {
1961 DCHECK(debug_info->HasInstrumentedBytecodeArray());
1963 while (!it.Done()) {
1965 it.position() >= start_position && it.position() < end_position) {
1966 locations->push_back(it.GetBreakLocation());
1973 MaybeHandle<SharedFunctionInfo>*
result =
nullptr) {
1975 script->is_wrapped()) {
1978 UnoptimizedCompileState compile_state;
1979 ReusableUnoptimizedCompileState reusable_state(isolate);
1980 UnoptimizedCompileFlags flags =
1982 flags.set_is_reparse(
true);
1983 ParseInfo parse_info(isolate, flags, &compile_state, &reusable_state);
1984 IsCompiledScope is_compiled_scope;
1985 const MaybeHandle<SharedFunctionInfo> maybe_result =
1987 &is_compiled_scope);
1988 if (maybe_result.is_null()) {
1989 if (isolate->has_exception()) {
1990 isolate->clear_exception();
2000 int end_position,
bool restrict_to_function,
2001 std::vector<BreakLocation>* locations) {
2003 if (restrict_to_function) {
2014 FindBreakablePositions(debug_info, start_position, end_position, locations);
2019 std::vector<Handle<SharedFunctionInfo>>
candidates;
2027 FindBreakablePositions(debug_info, start_position, end_position, locations);
2040 if (!shared->IsSubjectToDebugging())
return;
2041 int start_position = shared->function_token_position();
2043 start_position = shared->StartPosition();
2096 info = iterator.
Next()) {
2109 CHECK(outer_debug_info->HasBreakInfo());
2112 if (closest_position ==
position)
return outer_shared;
2114 const int start_position = outer_shared->StartPosition();
2115 const int end_position = outer_shared->EndPosition();
2116 if (start_position == end_position)
return outer_shared;
2118 if (closest_position == 0) closest_position = end_position;
2119 std::vector<Handle<SharedFunctionInfo>>
candidates;
2124 return outer_shared;
2129 CHECK(debug_info->HasBreakInfo());
2131 if (candidate_position >=
position &&
2132 candidate_position < closest_position) {
2133 closest_position = candidate_position;
2134 closest_candidate = candidate;
2136 if (closest_position ==
position)
break;
2138 return closest_candidate;
2144 bool candidateSubsumesRange =
false;
2145 bool triedTopLevelCompile =
false;
2148 std::vector<Handle<SharedFunctionInfo>>
candidates;
2149 std::vector<IsCompiledScope> compiled_scopes;
2154 info = iterator.
Next()) {
2155 if (info->EndPosition() < start_position ||
2156 info->StartPosition() >= end_position) {
2159 candidateSubsumesRange |= info->StartPosition() <= start_position &&
2160 info->EndPosition() >= end_position;
2161 if (!info->IsSubjectToDebugging())
continue;
2162 if (!info->is_compiled() && !info->allows_lazy_compilation())
continue;
2167 if (!triedTopLevelCompile && !candidateSubsumesRange &&
2168 script->infos()->length() > 0) {
2171 if (shared.is_null())
return false;
2172 if (triedTopLevelCompile)
continue;
2175 bool was_compiled =
false;
2181 DCHECK(candidate->allows_lazy_compilation());
2183 &is_compiled_scope)) {
2186 was_compiled =
true;
2190 compiled_scopes.push_back(is_compiled_scope);
2194 if (was_compiled)
continue;
2195 *intersecting_shared = std::move(
candidates);
2207 const bool topLevelInfoExists =
2208 maybeToplevel.
GetHeapObject(&heap_object) && !IsUndefined(heap_object);
2209 if (topLevelInfoExists) {
2210 if (did_compile) *did_compile =
false;
2215 CompileTopLevel(
isolate_, script, &shared);
2216 if (did_compile) *did_compile =
true;
2229 for (
int iteration = 0;; iteration++) {
2239 if (shared.is_null()) {
2240 if (iteration > 0)
break;
2244 const bool success = CompileTopLevel(
isolate_, script);
2245 if (!success)
break;
2249 is_compiled_scope = shared->is_compiled_scope(
isolate_);
2256 if (iteration > 1) {
2259 return shared_handle;
2266 DCHECK(shared->allows_lazy_compilation());
2279 if (shared->HasBreakInfo(
isolate_)) {
2280 DCHECK(shared->is_compiled());
2303 DCHECK(!debug_info->HasBreakInfo());
2310 flags |= DebugInfo::kHasBreakInfo;
2313 debug_info->set_break_points(*break_points);
2338 DCHECK(!debug_info->HasCoverageInfo());
2340 debug_info->set_flags(
2341 debug_info->flags(
kRelaxedLoad) | DebugInfo::kHasCoverageInfo,
2343 debug_info->set_coverage_info(*coverage_info);
2362 for (; it.HasNext(); it.Advance()) {
2364 clear_function(debug_info);
2365 if (debug_info->IsEmpty()) it.DeleteNext();
2371 debug_info->ClearBreakInfo(
isolate_);
2372 if (debug_info->IsEmpty()) {
2388 !debug_info->HasBreakInfo()) {
2402 if (!IsWeakArrayList(*factory->script_list())) {
2403 return factory->empty_fixed_array();
2411 script = iterator.
Next()) {
2412 if (script->HasValidSource()) results->set(length++, script);
2429 return debug_info.value()->HasCoverageInfo();
2436 return debug_info.value()->HasBreakInfo();
2443 return debug_info.value()->BreakAtEntry();
2455 std::optional<Isolate::ExceptionScope> exception_scope;
2480 if (IsJSPromise(*promise)) {
2482 if (js_promise->is_silent()) {
2485 maybe_promise = js_promise;
2493 std::vector<Handle<SharedFunctionInfo>> infos;
2495 for (
const auto& info : infos) {
2518 bool all_frames_ignored =
true;
2519 bool is_debuggable =
false;
2521 promise, [
this, &all_frames_ignored,
2523 if (!handler.async) {
2524 is_debuggable =
true;
2525 }
else if (!is_debuggable) {
2530 all_frames_ignored =
2531 all_frames_ignored &&
2535 if (all_frames_ignored || !is_debuggable) {
2551 for (; !it.done(); it.Advance()) {
2552 if (it.frame()->is_javascript()) {
2556 summary.AsJavaScript().function()->shared(),
isolate_};
2557 if (shared->IsSubjectToDebugging()) {
2559 std::vector<BreakLocation> break_locations;
2561 debug_info->HasBreakInfo()) {
2573#if V8_ENABLE_WEBASSEMBLY
2574 else if (it.frame()->is_wasm()) {
2575 const WasmFrame* frame = WasmFrame::cast(it.frame());
2576 if (IsMutedAtWasmLocation(frame->script(), frame->position())) {
2585 if (it.done())
return;
2593 if (!promise.
ToHandle(&promise_object)) {
2599 v8::Utils::ToLocal(exception), v8::Utils::ToLocal(promise_object),
2600 uncaught, exception_type);
2630 std::vector<int> inspector_break_points_hit;
2632 for (
int i = 0;
i < break_points_hit->length(); ++
i) {
2634 inspector_break_points_hit.push_back(break_point->id());
2642 inspector_break_points_hit, break_reasons);
2648 int source_position) {
2657 return debug::Location(std::max(info.line, 0), std::max(info.column, 0));
2673 if (!debug_info->computed_debug_is_blackboxed()) {
2674 bool is_blackboxed =
2675 !shared->IsSubjectToDebugging() || !IsScript(shared->script());
2676 if (!is_blackboxed) {
2681 DCHECK(IsScript(shared->script()));
2683 DCHECK(script->IsUserJavaScript());
2687 script, shared->StartPosition(), shared->EndPosition());
2690 debug_info->set_debug_is_blackboxed(is_blackboxed);
2691 debug_info->set_computed_debug_is_blackboxed(
true);
2693 return debug_info->debug_is_blackboxed();
2705 if (!IsScript(*script_obj))
return false;
2715 info.line, info.column);
2724 !it.
done(); it.Advance()) {
2737 if (shared->native() || shared->IsApiFunction()) {
2739 DCHECK(!shared->IsSubjectToDebugging());
2746 bool preview,
bool allow_top_frame_live_editing,
2752 allow_top_frame_live_editing,
result);
2777 if (!script->IsSubjectToDebugging())
return;
2783 AllowJavascriptExecution allow_script(
isolate_);
2796 while (!it.done() && it.frame()->id() !=
break_frame_id()) it.Advance();
2799 for (; !it.done(); it.Advance()) {
2800 counter += it.FrameFunctionCount();
2847 if (check.HasOverflowed())
return;
2857 if (frame && IsJSFunction(frame->
function())) {
2877 if (ignore_break)
return;
2880 debug_info->HasBreakInfo()) {
2884 std::vector<BreakLocation> break_locations;
2907 lastStepAction, break_reasons);
2912 if (!
v8_flags.print_break_location)
return;
2916 if (iterator.done())
return;
2919 int inlined_frame_index =
static_cast<int>(summaries.
size() - 1);
2921 int source_position = inspector.GetSourcePosition();
2923 PrintF(
"[debug] break in function '");
2924 inspector.GetFunctionName()->PrintOn(stdout);
2926 if (IsScript(*script_obj)) {
2933 int line = info.line;
2934 int column = info.column;
2937 int line_start = line == 0 ? 0 :
Smi::ToInt(line_ends->get(line - 1)) + 1;
2938 int line_end =
Smi::ToInt(line_ends->get(line));
2942 PrintF(
"[debug] %.*s\n", line_end - line_start,
2945 for (
int i = 0;
i < column;
i++)
PrintF(
" ");
2948 PrintF(
"[debug] at line %d column %d\n", line, column);
2957 base::Relaxed_Load(&debug->thread_local_.current_debug_scope_))),
2969 bool has_frames = !it.done();
3019 for (; it.HasNext(); it.Advance()) {
3021 if (debug_info->HasInstrumentedBytecodeArray() &&
3022 debug_info->DebugExecutionMode() != current_debug_execution_mode) {
3023 DCHECK(debug_info->shared()->HasBytecodeArray());
3056 int register_count = current_match_info->number_of_capture_registers();
3062 current_match_info->number_of_capture_registers());
3066 *current_match_info, 0, register_count,
3083 MessageTemplate::kNoSideEffectDebugEvaluate));
3101 DCHECK(debug_info->HasInstrumentedBytecodeArray());
3110 DCHECK(debug_info->HasInstrumentedBytecodeArray());
3119 debug_bytecode->set(it.current_offset(),
3120 original->get(it.current_offset()));
3128 DisallowJavascriptExecution no_js(
isolate_);
3130 function->shared()->is_compiled_scope(
isolate_));
3131 if (!function->is_compiled(
isolate_) &&
3133 &is_compiled_scope)) {
3140 debug_info->GetSideEffectState(
isolate_);
3141 if (shared->HasBuiltinId()) {
3144 switch (side_effect_state) {
3146 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3147 PrintF(
"[debug-evaluate] Function %s failed side effect check.\n",
3148 function->shared()->DebugNameCStr().get());
3155 if (!shared->HasBytecodeArray()) {
3160 DCHECK(shared->is_compiled());
3179 case Builtin::kStringPrototypeMatch:
3180 case Builtin::kStringPrototypeSearch:
3181 case Builtin::kStringPrototypeSplit:
3182 case Builtin::kStringPrototypeMatchAll:
3183 case Builtin::kStringPrototypeReplace:
3184 case Builtin::kStringPrototypeReplaceAll:
3185 if (Protectors::IsRegExpSpeciesLookupChainIntact(
isolate_)) {
3189 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3190 PrintF(
"[debug-evaluate] invalidating protector cell for RegExps\n");
3192 Protectors::InvalidateRegExpSpeciesLookupChain(
isolate_);
3209 ? accessor_info->setter_side_effect_type()
3210 : accessor_info->getter_side_effect_type();
3212 switch (side_effect_type) {
3228 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3229 PrintF(
"[debug-evaluate] API Callback '");
3231 PrintF(
"' may cause side effect.\n");
3242 DCHECK(function->has_side_effects());
3256 if (!function.is_null() && !function->has_side_effects()) {
3268 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3269 PrintF(
"[debug-evaluate] FunctionTemplateInfo may cause side effect.\n");
3284 if (!interceptor_info.
is_null()) {
3285 if (interceptor_info->has_no_side_effect())
return true;
3287 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3288 PrintF(
"[debug-evaluate] API Interceptor may cause side effect.\n");
3310 auto id = (bytecode == Bytecode::kInvokeIntrinsic)
3323 case Bytecode::kStaCurrentContextSlot:
3340 if (
IsNumber(*
object))
return true;
3341 if (IsName(*
object))
return true;
3347 if (
v8_flags.trace_side_effect_free_debug_evaluate) {
3348 PrintF(
"[debug-evaluate] failed runtime side effect check.\n");
3370 int inlined_frame_index) {
3373 LazyDeoptimizeReason::kDebugger);
#define DISALLOW_GARBAGE_COLLECTION(name)
#define BUILTIN_CODE(isolate, name)
TimeDelta Elapsed() const
constexpr void Add(E element)
constexpr bool contains(E element) const
constexpr T * begin() const
virtual ActionAfterInstrumentation BreakOnInstrumentation(v8::Local< v8::Context > paused_context, const debug::BreakpointId instrumentationId)
virtual void ScriptCompiled(v8::Local< Script > script, bool is_live_edited, bool has_compile_error)
virtual void BreakProgramRequested(v8::Local< v8::Context > paused_context, const std::vector< debug::BreakpointId > &inspector_break_points_hit, base::EnumSet< BreakReason > break_reasons={})
virtual bool ShouldBeSkipped(v8::Local< v8::debug::Script > script, int line, int column)
virtual void ExceptionThrown(v8::Local< v8::Context > paused_context, v8::Local< v8::Value > exception, v8::Local< v8::Value > promise, bool is_uncaught, ExceptionType exception_type)
ActionAfterInstrumentation
virtual void BreakpointConditionEvaluated(v8::Local< v8::Context > context, debug::BreakpointId breakpoint_id, bool exception_thrown, v8::Local< v8::Value > exception)
virtual bool IsFunctionBlackboxed(v8::Local< debug::Script > script, const debug::Location &start, const debug::Location &end)
static Handle< JSAny > GetComponent(Isolate *isolate, DirectHandle< NativeContext > native_context, DirectHandle< AccessorPair > accessor_pair, AccessorComponent component)
BreakLocation GetBreakLocation()
BreakIterator(Handle< DebugInfo > debug_info)
SourcePositionTableIterator source_position_iterator_
DebugBreakType GetDebugBreakType()
Handle< DebugInfo > debug_info_
void SkipToPosition(int position)
int BreakIndexFromPosition(int position)
Handle< AbstractCode > abstract_code_
static void AllAtCurrentStatement(Handle< DebugInfo > debug_info, JavaScriptFrame *frame, std::vector< BreakLocation > *result_out)
int generator_suspend_id()
BreakLocation(Handle< AbstractCode > abstract_code, DebugBreakType type, int code_offset, int position, int generator_obj_reg_index, int generator_suspend_id)
static bool IsPausedInJsFunctionEntry(JavaScriptFrame *frame)
int generator_obj_reg_index_
Tagged< JSGeneratorObject > GetGeneratorObjectForSuspendedFrame(JavaScriptFrame *frame) const
static BreakLocation Invalid()
bool IsDebugBreakAtEntry() const
static int BreakIndexFromCodeOffset(Handle< DebugInfo > debug_info, DirectHandle< AbstractCode > abstract_code, int offset)
static BreakLocation FromFrame(Handle< DebugInfo > debug_info, JavaScriptFrame *frame)
bool IsReturnOrSuspend() const
bool HasBreakPoint(Isolate *isolate, Handle< DebugInfo > debug_info) const
debug::BreakLocationType type() const
FrameSummaries Summarize() const override
virtual int LookupExceptionHandlerInTable(int *data, HandlerTable::CatchPrediction *prediction)
virtual FrameSummaries Summarize() const
void DisableScriptAndEval()
void EnableScriptAndEval()
static bool Compile(Isolate *isolate, Handle< SharedFunctionInfo > shared, ClearExceptionFlag flag, IsCompiledScope *is_compiled_scope, CreateSourcePositions create_source_positions_flag=CreateSourcePositions::kNo)
static MaybeHandle< SharedFunctionInfo > CompileToplevel(ParseInfo *parse_info, Handle< Script > script, Isolate *isolate, IsCompiledScope *is_compiled_scope)
static void ApplySideEffectChecks(Handle< BytecodeArray > bytecode_array)
static MaybeDirectHandle< Object > WithTopmostArguments(Isolate *isolate, DirectHandle< String > source)
static bool IsSideEffectFreeIntrinsic(Runtime::FunctionId id)
static V8_EXPORT_PRIVATE MaybeDirectHandle< Object > Local(Isolate *isolate, StackFrameId frame_id, int inlined_jsframe_index, DirectHandle< String > source, bool throw_on_side_effect)
void DeleteIndex(size_t index)
void Insert(Tagged< SharedFunctionInfo > sfi, Tagged< DebugInfo > debug_info)
std::unordered_map< SFIUniqueId, HandleLocation > map_
V8_EXPORT_PRIVATE Tagged< DebugInfo > EntryAsDebugInfo(size_t index) const
bool Contains(Tagged< SharedFunctionInfo > sfi) const
std::optional< Tagged< DebugInfo > > Find(Tagged< SharedFunctionInfo > sfi) const
std::vector< HandleLocation > list_
void DeleteSlow(Tagged< SharedFunctionInfo > sfi)
static const int kEstimatedNofBreakPointsInFunction
static bool ClearBreakPoint(Isolate *isolate, DirectHandle< DebugInfo > debug_info, DirectHandle< BreakPoint > break_point)
static DirectHandle< Object > FindBreakPointInfo(Isolate *isolate, DirectHandle< DebugInfo > debug_info, DirectHandle< BreakPoint > break_point)
static const int kNoDebuggingId
static void SetBreakPoint(Isolate *isolate, DirectHandle< DebugInfo > debug_info, int source_position, DirectHandle< BreakPoint > break_point)
void set_terminate_on_resume()
base::TimeDelta ElapsedTimeSinceCreation()
StackFrameId break_frame_id_
base::ElapsedTimer timer_
bool terminate_on_resume_
TemporaryObjectsTracker & operator=(const TemporaryObjectsTracker &)=delete
bool RemoveFromRegions(Address start, Address end)
std::map< Address, Address >::iterator FindOverlappingRegion(Address start, Address end, bool include_adjacent)
bool HasRegionContainingObject(Address start, Address end)
TemporaryObjectsTracker()=default
std::map< Address, Address > regions_
TemporaryObjectsTracker(const TemporaryObjectsTracker &)=delete
void AllocationEvent(Address addr, int size) override
bool HasObject(DirectHandle< HeapObject > obj)
~TemporaryObjectsTracker() override=default
void MoveEvent(Address from, Address to, int size) override
void AddRegion(Address start, Address end)
StepAction last_step_action_
int restart_inline_frame_index_
Tagged< Object > ignore_step_into_function_
Tagged< Object > muted_function_
base::AtomicWord current_debug_scope_
bool scheduled_break_on_next_function_call_
bool fast_forward_to_return_
int last_bytecode_offset_
int last_statement_position_
StackFrameId break_frame_id_
Tagged< Object > return_value_
Tagged< Object > suspended_generator_
bool break_on_next_function_call_
StackFrameId restart_frame_id_
Debug(const Debug &)=delete
bool HasCoverageInfo(Tagged< SharedFunctionInfo > sfi)
std::optional< Tagged< Object > > OnThrow(DirectHandle< Object > exception) V8_WARN_UNUSED_RESULT
void OnException(DirectHandle< Object > exception, MaybeDirectHandle< JSPromise > promise, v8::debug::ExceptionType exception_type)
Handle< Object > FindInnermostContainingFunctionInfo(Handle< Script > script, int position)
void Break(JavaScriptFrame *frame, DirectHandle< JSFunction > break_target)
Handle< Object > return_value_handle()
void ClearAllDebuggerHints()
DebugInfoCollection debug_infos_
void SetDebugDelegate(debug::DebugDelegate *delegate)
std::optional< Tagged< DebugInfo > > TryGetDebugInfo(Tagged< SharedFunctionInfo > sfi)
void OnCompileError(DirectHandle< Script > script)
void DeoptimizeFunction(DirectHandle< SharedFunctionInfo > shared)
void clear_restart_frame()
bool SetBreakpointForFunction(Handle< SharedFunctionInfo > shared, DirectHandle< String > condition, int *id, BreakPointKind kind=kRegular)
bool ignore_events() const
int FindBreakablePosition(Handle< DebugInfo > debug_info, int source_position)
void PrepareStep(StepAction step_action)
MaybeHandle< FixedArray > GetHitBreakPoints(DirectHandle< DebugInfo > debug_info, int position, bool *has_break_points)
void NotifyDebuggerPausedEventSent()
void SetTemporaryObjectTrackingDisabled(bool disabled)
void AssertDebugContext()
bool break_disabled() const
void FloodWithOneShot(Handle< SharedFunctionInfo > function, bool returns_only=false)
debug::DebugDelegate::ActionAfterInstrumentation OnInstrumentationBreak()
void PrepareBuiltinForSideEffectCheck(Isolate *isolate, Builtin id)
void ClearBreakPoint(DirectHandle< BreakPoint > break_point)
void ClearAllBreakPoints()
Handle< SharedFunctionInfo > FindClosestSharedFunctionInfoFromPosition(int position, Handle< Script > script, Handle< SharedFunctionInfo > outer_shared)
void PrepareStepIn(DirectHandle< JSFunction > function)
void PrepareStepInSuspendedGenerator()
void StopSideEffectCheckMode()
void ApplyBreakPoints(Handle< DebugInfo > debug_info)
MaybeHandle< FixedArray > CheckBreakPoints(Handle< DebugInfo > debug_info, BreakLocation *location, bool *has_break_points)
void RemoveAllCoverageInfos()
void ClearAllDebugInfos(const DebugInfoClearFunction &clear_function)
std::atomic< bool > is_active_
bool SetBreakpoint(Handle< SharedFunctionInfo > shared, DirectHandle< BreakPoint > break_point, int *source_position)
void clear_suspended_generator()
ThreadLocal thread_local_
void StartSideEffectCheckMode()
void HandleDebugBreak(IgnoreBreakMode ignore_break_mode, debug::BreakReasons break_reasons)
bool break_on_next_function_call() const
bool break_points_active_
bool IsFunctionBlackboxed(DirectHandle< Script > script, const int start, const int end)
bool HasBreakInfo(Tagged< SharedFunctionInfo > sfi)
void OnPromiseReject(DirectHandle< Object > promise, DirectHandle< Object > value)
void ClearBreakPoints(Handle< DebugInfo > debug_info)
int GetFunctionDebuggingId(DirectHandle< JSFunction > function)
bool PerformSideEffectCheckForInterceptor(DirectHandle< InterceptorInfo > interceptor_info)
void RemoveBreakpoint(int id)
bool side_effect_check_failed_
bool HasDebugInfo(Tagged< SharedFunctionInfo > sfi)
static const int kBreakAtEntryPosition
std::unique_ptr< TemporaryObjectsTracker > temporary_objects_
char * ArchiveDebug(char *to)
void InstallCoverageInfo(DirectHandle< SharedFunctionInfo > shared, DirectHandle< CoverageInfo > coverage_info)
bool GetPossibleBreakpoints(Handle< Script > script, int start_position, int end_position, bool restrict_to_function, std::vector< BreakLocation > *locations)
void SetTerminateOnResume()
bool break_on_caught_exception_
void OnDebugBreak(DirectHandle< FixedArray > break_points_hit, StepAction stepAction, debug::BreakReasons break_reasons={})
void ChangeBreakOnException(ExceptionBreakType type, bool enable)
StackFrameId break_frame_id()
void ProcessCompileEvent(bool has_compile_error, DirectHandle< Script > script)
void UpdateHookOnFunctionCall()
bool PerformSideEffectCheckForCallback(Handle< FunctionTemplateInfo > function)
DirectHandle< FixedArray > GetLoadedScripts()
StepAction last_step_action()
bool break_on_uncaught_exception_
static DirectHandle< Object > GetSourceBreakLocations(Isolate *isolate, DirectHandle< SharedFunctionInfo > shared)
void SetMutedLocation(DirectHandle< SharedFunctionInfo > function, const BreakLocation &location)
bool GetTemporaryObjectTrackingDisabled() const
void SetBreakOnNextFunctionCall()
bool scheduled_break_on_function_call() const
bool PerformSideEffectCheckForObject(DirectHandle< Object > object)
bool PerformSideEffectCheckAtBytecode(InterpretedFrame *frame)
bool AllFramesOnStackAreBlackboxed()
IndirectHandle< FunctionTemplateInfo > ignore_side_effects_for_function_template_info_
Tagged< Object > return_value()
bool has_suspended_generator() const
void Iterate(RootVisitor *v)
debug::DebugDelegate * debug_delegate_
bool SetBreakPointForScript(Handle< Script > script, DirectHandle< String > condition, int *source_position, int *id)
bool FindSharedFunctionInfosIntersectingRange(Handle< Script > script, int start_position, int end_position, std::vector< Handle< SharedFunctionInfo > > *candidates)
bool EnsureBreakInfo(Handle< SharedFunctionInfo > shared)
void UpdateDebugInfosForExecutionMode()
void OnAfterCompile(DirectHandle< Script > script)
void PrepareFunctionForDebugExecution(DirectHandle< SharedFunctionInfo > shared)
bool in_debug_scope() const
bool CanBreakAtEntry(DirectHandle< SharedFunctionInfo > shared)
bool hook_on_function_call_
void DiscardBaselineCode(Tagged< SharedFunctionInfo > shared)
MaybeDirectHandle< FixedArray > CheckBreakPointsForLocations(Handle< DebugInfo > debug_info, std::vector< BreakLocation > &break_locations, bool *has_break_points)
void IgnoreSideEffectsOnNextCallTo(Handle< FunctionTemplateInfo > function)
void PrepareStepOnThrow()
std::function< void(Handle< DebugInfo >)> DebugInfoClearFunction
void InstallDebugBreakTrampoline()
bool SetScriptSource(Handle< Script > script, Handle< String > source, bool preview, bool allow_top_frame_live_editing, debug::LiveEditResult *result)
void RemoveBreakInfoAndMaybeFree(DirectHandle< DebugInfo > debug_info)
void ClearMutedLocation()
void CreateBreakInfo(DirectHandle< SharedFunctionInfo > shared)
static int ArchiveSpacePerThread()
char * RestoreDebug(char *from)
void ClearBreakOnNextFunctionCall()
bool IsBlackboxed(DirectHandle< SharedFunctionInfo > shared)
void PrintBreakLocation()
void ApplySideEffectChecks(DirectHandle< DebugInfo > debug_info)
bool IsFrameBlackboxed(JavaScriptFrame *frame)
static const int kInstrumentationId
bool BreakAtEntry(Tagged< SharedFunctionInfo > sfi)
void DiscardAllBaselineCode()
void PrepareRestartFrame(JavaScriptFrame *frame, int inlined_frame_index)
bool IsBreakOnException(ExceptionBreakType type)
MaybeDirectHandle< SharedFunctionInfo > GetTopLevelWithRecompile(Handle< Script > script, bool *did_compile=nullptr)
bool PerformSideEffectCheck(DirectHandle< JSFunction > function, DirectHandle< Object > receiver)
bool CheckBreakPoint(DirectHandle< BreakPoint > break_point, bool is_break_at_entry)
Handle< DebugInfo > GetOrCreateDebugInfo(DirectHandle< SharedFunctionInfo > shared)
void set_return_value(Tagged< Object > value)
bool IsMutedAtAnyBreakLocation(DirectHandle< SharedFunctionInfo > function, const std::vector< BreakLocation > &locations)
void ClearSideEffectChecks(DirectHandle< DebugInfo > debug_info)
bool IsBreakAtReturn(JavaScriptFrame *frame)
IndirectHandle< RegExpMatchInfo > regexp_match_info_
bool IsBreakOnDebuggerStatement(DirectHandle< SharedFunctionInfo > function, const BreakLocation &location)
bool IsBreakOnInstrumentation(Handle< DebugInfo > debug_info, const BreakLocation &location)
bool PerformSideEffectCheckForAccessor(DirectHandle< AccessorInfo > accessor_info, DirectHandle< Object > receiver, AccessorComponent component)
int FrameFunctionCount() const
CommonFrame * frame() const
FrameSummary GetTopValidFrame() const
static void PatchToJump(Address pc, Address new_pc)
static void DeoptimizeAllOptimizedCodeWithFunction(Isolate *isolate, DirectHandle< SharedFunctionInfo > function)
static void DeoptimizeFunction(Tagged< JSFunction > function, LazyDeoptimizeReason reason, Tagged< Code > code={})
static V8_EXPORT_PRIVATE void DeoptimizeAll(Isolate *isolate)
V8_INLINE bool is_null() const
V8_INLINE Address address() const
Handle< FixedArray > NewFixedArray(int length, AllocationType allocation=AllocationType::kYoung)
DirectHandle< WeakArrayList > NewWeakArrayList(int capacity, AllocationType allocation=AllocationType::kYoung)
Handle< BreakPoint > NewBreakPoint(int id, DirectHandle< String > condition)
Handle< DebugInfo > NewDebugInfo(DirectHandle< SharedFunctionInfo > shared)
static HandleType< FixedArray > RightTrimOrEmpty(Isolate *isolate, HandleType< FixedArray > array, int new_length)
static FrameSummary GetTop(const CommonFrame *frame)
int SourceStatementPosition() const
Handle< Object > script() const
void EnsureSourcePositionsAvailable()
int SourcePosition() const
static void Destroy(Address *location)
IndirectHandle< Object > Create(Tagged< Object > value)
static const int kNoHandlerFound
Tagged< HeapObject > Next()
V8_EXPORT_PRIVATE void RemoveHeapObjectAllocationTracker(HeapObjectAllocationTracker *tracker)
V8_EXPORT_PRIVATE void CollectAllGarbage(GCFlags gc_flags, GarbageCollectionReason gc_reason, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
V8_EXPORT_PRIVATE void AddHeapObjectAllocationTracker(HeapObjectAllocationTracker *tracker)
static InterpretedFrame * cast(StackFrame *frame)
void PatchBytecodeOffset(int new_offset)
int GetBytecodeOffset() const override
GlobalHandles * global_handles() const
DebugInfo::ExecutionMode debug_execution_mode() const
void set_debug_execution_mode(DebugInfo::ExecutionMode debug_execution_mode)
void CollectSourcePositionsForAllBytecodeArrays()
CompilationCache * compilation_cache()
Bootstrapper * bootstrapper()
Tagged< Object > Throw(Tagged< Object > exception, MessageLocation *location=nullptr)
void CancelTerminateExecution()
bool is_execution_terminating()
Tagged< Object > exception()
bool WalkCallStackAndPromiseTree(MaybeDirectHandle< JSPromise > rejected_promise, const std::function< void(PromiseHandler)> &callback)
ThreadManager * thread_manager() const
Handle< NativeContext > native_context()
StackGuard * stack_guard()
Tagged< Object > TerminateExecution()
v8::internal::Factory * factory()
void PromiseHookStateUpdated()
base::Mutex * shared_function_info_access()
CatchType PredictExceptionCatcher()
ThreadLocalTop * thread_local_top()
static Handle< Object > GetDataProperty(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Name > name)
static constexpr int CaptureCountForRegisters(int register_count)
Tagged< JSFunction > function() const override
virtual void GetFunctions(std::vector< Tagged< SharedFunctionInfo > > *functions) const
bool is_optimized() const
static JavaScriptFrame * cast(StackFrame *frame)
static void PatchScript(Isolate *isolate, Handle< Script > script, Handle< String > source, bool preview, bool allow_top_frame_live_editing, debug::LiveEditResult *result)
V8_INLINE DirectHandle< T > ToHandleChecked() const
V8_WARN_UNUSED_RESULT V8_INLINE bool ToHandle(DirectHandle< S > *out) const
V8_INLINE bool is_null() const
V8_INLINE Handle< T > ToHandleChecked() const
static V8_EXPORT_PRIVATE bool BooleanValue(Tagged< Object > obj, IsolateT *isolate)
static V8_INLINE void ReplacePC(Address *pc_address, Address new_pc, int offset_from_sp)
void VisitThread(Isolate *isolate, ThreadLocalTop *top) override
static V8_EXPORT_PRIVATE DirectHandle< RegExpMatchInfo > New(Isolate *isolate, int capture_count, AllocationType allocation=AllocationType::kYoung)
ReturnValueScope(Debug *debug)
Handle< Object > return_value_
virtual void VisitRootPointer(Root root, const char *description, FullObjectSlot p)
static void InitLineEnds(Isolate *isolate, DirectHandle< Script > script)
static constexpr int kTemporaryScriptId
static bool GetPositionInfo(DirectHandle< Script > script, int position, PositionInfo *info, OffsetFlag offset_flag=OffsetFlag::kWithOffset)
Tagged< SharedFunctionInfo > Result()
Tagged< JSFunction > current_candidate_closure_
SharedFunctionInfoFinder(int target_position)
int current_start_position_
Tagged< JSFunction > ResultClosure()
Tagged< SharedFunctionInfo > current_candidate_
void NewCandidate(Tagged< SharedFunctionInfo > shared, Tagged< JSFunction > closure=JSFunction())
V8_EXPORT_PRIVATE Tagged< SharedFunctionInfo > Next()
static void InstallDebugBytecode(DirectHandle< SharedFunctionInfo > shared, Isolate *isolate)
static void EnsureSourcePositionsAvailable(Isolate *isolate, DirectHandle< SharedFunctionInfo > shared_info)
static constexpr int ToInt(const Tagged< Object > object)
static constexpr Tagged< Smi > FromInt(int value)
static constexpr Tagged< Smi > zero()
bool is_statement() const
SourcePosition source_position() const
bool is_javascript() const
bool JsHasOverflowed(uintptr_t gap=0) const
base::Vector< const uint8_t > ToOneByteVector() const
static void CopyElements(Isolate *isolate, Tagged< RegExpMatchInfo > dst, int dst_index, Tagged< RegExpMatchInfo > src, int src_index, int len, WriteBarrierMode mode=kDefaultMode)
bool GetHeapObject(Tagged< HeapObject > *result) const
V8_INLINE constexpr bool is_null() const
void IterateArchivedThreads(ThreadVisitor *v)
static UnoptimizedCompileFlags ForScriptCompile(Isolate *isolate, Tagged< Script > script)
static UnoptimizedJSFrame * cast(StackFrame *frame)
Tagged< Object > ReadInterpreterRegister(int register_index) const
static V8_EXPORT_PRIVATE bool SetBreakPointOnFirstBreakableForFunction(DirectHandle< Script >, int function_index, DirectHandle< BreakPoint > break_point)
static V8_EXPORT_PRIVATE void SetInstrumentationBreakpoint(DirectHandle< Script >, DirectHandle< BreakPoint > break_point)
static void ClearAllBreakpoints(Tagged< Script >)
static V8_EXPORT_PRIVATE bool ClearBreakPointById(DirectHandle< Script >, int breakpoint_id)
static V8_EXPORT_PRIVATE bool SetBreakPoint(DirectHandle< Script >, int *position, DirectHandle< BreakPoint > break_point)
static V8_WARN_UNUSED_RESULT DirectHandle< WeakArrayList > Append(Isolate *isolate, DirectHandle< WeakArrayList > array, MaybeObjectDirectHandle value, AllocationType allocation=AllocationType::kYoung)
Bytecode current_bytecode() const
Register GetRegisterOperand(int operand_index) const
uint32_t GetUnsignedImmediateOperand(int operand_index) const
Runtime::FunctionId GetIntrinsicIdOperand(int operand_index) const
Runtime::FunctionId GetRuntimeIdOperand(int operand_index) const
static Bytecode FromByte(uint8_t value)
static constexpr bool IsCallRuntime(Bytecode bytecode)
static constexpr bool IsCallOrConstruct(Bytecode bytecode)
static constexpr bool IsPrefixScalingBytecode(Bytecode bytecode)
constexpr int index() const
static constexpr Register current_context()
Handle< SharedFunctionInfo > info
Tagged< SharedFunctionInfo > shared_
ZoneVector< OpIndex > candidates
DisallowGarbageCollection no_gc_
SharedFunctionInfoRef shared
ZoneVector< RpoNumber > & result
InstructionOperand source
void Relaxed_Store(volatile Atomic8 *ptr, Atomic8 value)
Atomic8 Relaxed_Load(volatile const Atomic8 *ptr)
Atomic8 Acquire_Load(volatile const Atomic8 *ptr)
@ kDebuggerStatementBreakLocation
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
constexpr int kFunctionEntryBytecodeOffset
@ kIgnoreIfTopFrameBlackboxed
PerThreadAssertScopeDebugOnly< false, SAFEPOINTS_ASSERT, HEAP_ALLOCATION_ASSERT > DisallowGarbageCollection
constexpr int kNoSourcePosition
bool IsNumber(Tagged< Object > obj)
void PrintF(const char *format,...)
Tagged(T object) -> Tagged< T >
bool IsGeneratorFunction(FunctionKind kind)
V8_INLINE constexpr bool IsSmi(TaggedImpl< kRefType, StorageType > obj)
V8_INLINE IndirectHandle< T > indirect_handle(DirectHandle< T > handle)
kInterpreterTrampolineOffset Tagged< HeapObject >
bool IsAsyncFunction(FunctionKind kind)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
constexpr int kSystemPointerSize
V8_INLINE PtrComprCageBase GetPtrComprCageBase()
void ShortPrint(Tagged< Object > obj, FILE *out)
constexpr int kFunctionLiteralIdTopLevel
V8_EXPORT_PRIVATE FlagValues v8_flags
@ DEBUG_BREAK_SLOT_AT_CALL
@ DEBUG_BREAK_SLOT_AT_SUSPEND
@ DEBUG_BREAK_SLOT_AT_RETURN
void MemCopy(void *dest, const void *src, size_t size)
kInterpreterTrampolineOffset script
!IsContextMap !IsContextMap native_context
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
@ kHasSideEffectToReceiver
static constexpr RelaxedLoadTag kRelaxedLoad
static constexpr RelaxedStoreTag kRelaxedStore
v8::Local< T > ToApiHandle(v8::internal::DirectHandle< v8::internal::Object > obj)
#define DCHECK_LE(v1, v2)
#define DCHECK_NOT_NULL(val)
#define CHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define CHECK_EQ(lhs, rhs)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
std::vector< FrameSummary > frames