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

Unified Diff: src/debug/debug.cc

Issue 2519853002: [debugger] step-next across yield should not leave the generator. (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/debug/debug.h ('k') | src/interpreter/interpreter.cc » ('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 5d76b1c2c0ebc4b82ff39279b764924205f443f3..019f3732ce5f1b9e40c16ec36e90490dce447f84 100644
--- a/src/debug/debug.cc
+++ b/src/debug/debug.cc
@@ -1430,9 +1430,16 @@ bool Debug::GetPossibleBreakpoints(Handle<Script> script, int start_position,
return false;
}
-void Debug::RecordAsyncFunction(Handle<JSGeneratorObject> generator_object) {
+void Debug::RecordGenerator(Handle<JSGeneratorObject> generator_object) {
if (last_step_action() <= StepOut) return;
- if (!IsAsyncFunction(generator_object->function()->shared()->kind())) return;
+
+ if (last_step_action() == StepNext) {
+ // Only consider this generator a step-next target if not stepping in.
+ JavaScriptFrameIterator stack_iterator(isolate_);
+ JavaScriptFrame* frame = stack_iterator.frame();
+ if (frame->UnpaddedFP() < thread_local_.target_fp_) return;
+ }
+
DCHECK(!has_suspended_generator());
thread_local_.suspended_generator_ = *generator_object;
ClearStepping();
« no previous file with comments | « src/debug/debug.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698