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

Unified Diff: src/runtime.cc

Issue 544953005: Support stepping into generator function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: test case Created 6 years, 3 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 | « src/generator.js ('k') | test/mjsunit/es6/debug-stepin-generators.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index dd0884b25dfe8d74c769520860d14f58622778fd..330225dfa205d26ed637918e829bdd2493fddc26 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5524,13 +5524,22 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
DCHECK(args.length() == 1);
Debug* debug = isolate->debug();
if (!debug->IsStepping()) return isolate->heap()->undefined_value();
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0);
+
HandleScope scope(isolate);
- // When leaving the callback, step out has been activated, but not performed
- // if we do not leave the builtin. To be able to step into the callback
+ CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
+ RUNTIME_ASSERT(object->IsJSFunction() || object->IsJSGeneratorObject());
+ Handle<JSFunction> fun;
+ if (object->IsJSFunction()) {
+ fun = Handle<JSFunction>::cast(object);
+ } else {
+ fun = Handle<JSFunction>(
+ Handle<JSGeneratorObject>::cast(object)->function(), isolate);
+ }
+ // When leaving the function, step out has been activated, but not performed
+ // if we do not leave the builtin. To be able to step into the function
// again, we need to clear the step out at this point.
debug->ClearStepOut();
- debug->FloodWithOneShot(callback);
+ debug->FloodWithOneShot(fun);
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/generator.js ('k') | test/mjsunit/es6/debug-stepin-generators.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698