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

Unified Diff: src/runtime.cc

Issue 207153004: Fix DebugEvaluate for generators. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | test/mjsunit/regress-3225.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 b4c34ef76922cf8b997b6ecd72f34c88d85e3587..95e3c08ddc47118dcdaf02f57d84a83f843c66e6 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11417,24 +11417,29 @@ static Handle<JSObject> MaterializeStackLocalsWithFrameInspector(
Handle<SharedFunctionInfo> shared(function->shared());
Handle<ScopeInfo> scope_info(shared->scope_info());
- // First fill all parameters.
- for (int i = 0; i < scope_info->ParameterCount(); ++i) {
- Handle<String> name(scope_info->ParameterName(i));
- VariableMode mode;
- InitializationFlag init_flag;
- // Do not materialize the parameter if it is shadowed by a context local.
- if (scope_info->ContextSlotIndex(*name, &mode, &init_flag) != -1) continue;
-
- Handle<Object> value(i < frame_inspector->GetParametersCount()
- ? frame_inspector->GetParameter(i)
- : isolate->heap()->undefined_value(),
- isolate);
- ASSERT(!value->IsTheHole());
+ // First fill all parameters. Parameters in generators are context-allocated.
+ if (!shared->is_generator()) {
+ for (int i = 0; i < scope_info->ParameterCount(); ++i) {
+ Handle<String> name(scope_info->ParameterName(i));
+ VariableMode mode;
+ InitializationFlag init_flag;
+ // Do not materialize the parameter if it is shadowed by a context local.
+ if (scope_info->ContextSlotIndex(*name, &mode, &init_flag) != -1) {
Michael Starzinger 2014/03/24 10:24:28 I am little bit confused here. For generators we s
+ continue;
+ }
- RETURN_IF_EMPTY_HANDLE_VALUE(
- isolate,
- Runtime::SetObjectProperty(isolate, target, name, value, NONE, SLOPPY),
- Handle<JSObject>());
+ Handle<Object> value(i < frame_inspector->GetParametersCount()
+ ? frame_inspector->GetParameter(i)
+ : isolate->heap()->undefined_value(),
+ isolate);
+ ASSERT(!value->IsTheHole());
+
+ RETURN_IF_EMPTY_HANDLE_VALUE(
+ isolate,
+ Runtime::SetObjectProperty(
+ isolate, target, name, value, NONE, SLOPPY),
+ Handle<JSObject>());
+ }
}
// Second fill all stack locals.
@@ -11468,13 +11473,15 @@ static void UpdateStackLocalsFromMaterializedObject(Isolate* isolate,
Handle<SharedFunctionInfo> shared(function->shared());
Handle<ScopeInfo> scope_info(shared->scope_info());
- // Parameters.
- for (int i = 0; i < scope_info->ParameterCount(); ++i) {
- ASSERT(!frame->GetParameter(i)->IsTheHole());
- HandleScope scope(isolate);
- Handle<Object> value = GetProperty(
- isolate, target, Handle<String>(scope_info->ParameterName(i)));
- frame->SetParameterValue(i, *value);
+ // Parameters. Parameters in generators are context-allocated.
+ if (!shared->is_generator()) {
+ for (int i = 0; i < scope_info->ParameterCount(); ++i) {
+ ASSERT(!frame->GetParameter(i)->IsTheHole());
Michael Starzinger 2014/03/24 10:24:28 Likewise, instead of baking in arbitrary special h
+ HandleScope scope(isolate);
+ Handle<Object> value = GetProperty(
+ isolate, target, Handle<String>(scope_info->ParameterName(i)));
+ frame->SetParameterValue(i, *value);
+ }
}
// Stack locals.
« no previous file with comments | « no previous file | test/mjsunit/regress-3225.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698