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

Unified Diff: src/debug/debug.cc

Issue 2619353006: Refactor FrameSummary for JS and Wasm frames (Closed)
Patch Set: Address comment Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug/debug-frames.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug.cc
diff --git a/src/debug/debug.cc b/src/debug/debug.cc
index 50c3ec8cef212933d49001f693b45cac81d739f3..08da3d8b26f0b52e9bb8b946389a1436e41af93a 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -62,7 +62,7 @@ BreakLocation BreakLocation::FromFrame(Handle<DebugInfo> debug_info,
JavaScriptFrame* frame) {
FrameSummary summary = FrameSummary::GetFirst(frame);
int offset = summary.code_offset();
- Handle<AbstractCode> abstract_code = summary.abstract_code();
+ Handle<AbstractCode> abstract_code = summary.AsJavaScript().abstract_code();
if (abstract_code->IsCode()) offset = offset - 1;
auto it = BreakIterator::GetIterator(debug_info, abstract_code);
it->SkipTo(BreakIndexFromCodeOffset(debug_info, abstract_code, offset));
@@ -72,7 +72,7 @@ BreakLocation BreakLocation::FromFrame(Handle<DebugInfo> debug_info,
void BreakLocation::AllAtCurrentStatement(Handle<DebugInfo> debug_info,
JavaScriptFrame* frame,
List<BreakLocation>* result_out) {
- FrameSummary summary = FrameSummary::GetFirst(frame);
+ auto summary = FrameSummary::GetFirst(frame).AsJavaScript();
int offset = summary.code_offset();
Handle<AbstractCode> abstract_code = summary.abstract_code();
if (abstract_code->IsCode()) offset = offset - 1;
@@ -558,11 +558,9 @@ void Debug::Break(JavaScriptFrame* frame) {
// Fall through.
case StepIn: {
FrameSummary summary = FrameSummary::GetFirst(frame);
- int offset = summary.code_offset();
- step_break = step_break || location.IsReturn() ||
- (current_fp != last_fp) ||
- (thread_local_.last_statement_position_ !=
- summary.abstract_code()->SourceStatementPosition(offset));
+ step_break = step_break || location.IsReturn() || current_fp != last_fp ||
+ thread_local_.last_statement_position_ !=
+ summary.SourceStatementPosition();
break;
}
case StepFrame:
@@ -1000,7 +998,7 @@ void Debug::PrepareStep(StepAction step_action) {
}
// Get the debug info (create it if it does not exist).
- FrameSummary summary = FrameSummary::GetFirst(frame);
+ auto summary = FrameSummary::GetFirst(frame).AsJavaScript();
Handle<JSFunction> function(summary.function());
Handle<SharedFunctionInfo> shared(function->shared());
if (!EnsureDebugInfo(shared, function)) {
@@ -2259,11 +2257,10 @@ void Debug::PrintBreakLocation() {
if (iterator.done()) return;
JavaScriptFrame* frame = iterator.frame();
FrameSummary summary = FrameSummary::GetFirst(frame);
- int source_position =
- summary.abstract_code()->SourcePosition(summary.code_offset());
- Handle<Object> script_obj(summary.function()->shared()->script(), isolate_);
+ int source_position = summary.SourcePosition();
+ Handle<Object> script_obj = summary.script();
PrintF("[debug] break in function '");
- summary.function()->PrintName();
+ summary.FunctionName()->PrintOn(stdout);
PrintF("'.\n");
if (script_obj->IsScript()) {
Handle<Script> script = Handle<Script>::cast(script_obj);
« no previous file with comments | « no previous file | src/debug/debug-frames.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698