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

Unified Diff: src/runtime.cc

Issue 107243006: Correctly resolve forcibly context allocated parameters in debug-evaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: reupload Created 7 years 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/regress-325676.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 e763d435cc985e80a21f0fe43b4e11439c534e6b..497e8d338381df5d139fb3a3b0f01f5bcb7e744a 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11364,6 +11364,12 @@ static Handle<JSObject> MaterializeStackLocalsWithFrameInspector(
// 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(),
@@ -11372,32 +11378,23 @@ static Handle<JSObject> MaterializeStackLocalsWithFrameInspector(
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
- Runtime::SetObjectProperty(isolate,
- target,
- Handle<String>(scope_info->ParameterName(i)),
- value,
- NONE,
- kNonStrictMode),
+ Runtime::SetObjectProperty(
+ isolate, target, name, value, NONE, kNonStrictMode),
Handle<JSObject>());
}
// Second fill all stack locals.
for (int i = 0; i < scope_info->StackLocalCount(); ++i) {
+ Handle<String> name(scope_info->StackLocalName(i));
Handle<Object> value(frame_inspector->GetExpression(i), isolate);
if (value->IsTheHole()) continue;
RETURN_IF_EMPTY_HANDLE_VALUE(
isolate,
Runtime::SetObjectProperty(
- isolate,
- target,
- Handle<String>(scope_info->StackLocalName(i)),
- value,
- NONE,
- kNonStrictMode),
+ isolate, target, name, value, NONE, kNonStrictMode),
Handle<JSObject>());
}
-
return target;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-325676.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698