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

Unified Diff: src/runtime.cc

Issue 253263003: ScopeInfo::ContextSlotIndex() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/objects.h ('k') | src/scopeinfo.cc » ('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 61d363ac20f7cd78aa62db070e372a64be10d2f6..7cacc9bbf3336cbad63c0a0c3d30e2a577314044 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -11251,7 +11251,7 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
InitializationFlag init_flag;
locals->set(local * 2, *name);
int context_slot_index =
- scope_info->ContextSlotIndex(*name, &mode, &init_flag);
+ ScopeInfo::ContextSlotIndex(scope_info, name, &mode, &init_flag);
Object* value = context->get(context_slot_index);
locals->set(local * 2 + 1, value);
local++;
@@ -11423,10 +11423,10 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
static bool ParameterIsShadowedByContextLocal(Handle<ScopeInfo> info,
- int index) {
+ Handle<String> parameter_name) {
VariableMode mode;
InitializationFlag flag;
- return info->ContextSlotIndex(info->ParameterName(index), &mode, &flag) != -1;
+ return ScopeInfo::ContextSlotIndex(info, parameter_name, &mode, &flag) != -1;
}
@@ -11444,7 +11444,8 @@ static MaybeHandle<JSObject> MaterializeStackLocalsWithFrameInspector(
// First fill all parameters.
for (int i = 0; i < scope_info->ParameterCount(); ++i) {
// Do not materialize the parameter if it is shadowed by a context local.
- if (ParameterIsShadowedByContextLocal(scope_info, i)) continue;
+ Handle<String> name(scope_info->ParameterName(i));
+ if (ParameterIsShadowedByContextLocal(scope_info, name)) continue;
HandleScope scope(isolate);
Handle<Object> value(i < frame_inspector->GetParametersCount()
@@ -11452,7 +11453,6 @@ static MaybeHandle<JSObject> MaterializeStackLocalsWithFrameInspector(
: isolate->heap()->undefined_value(),
isolate);
ASSERT(!value->IsTheHole());
- Handle<String> name(scope_info->ParameterName(i));
RETURN_ON_EXCEPTION(
isolate,
@@ -11495,11 +11495,11 @@ static void UpdateStackLocalsFromMaterializedObject(Isolate* isolate,
// Parameters.
for (int i = 0; i < scope_info->ParameterCount(); ++i) {
// Shadowed parameters were not materialized.
- if (ParameterIsShadowedByContextLocal(scope_info, i)) continue;
+ Handle<String> name(scope_info->ParameterName(i));
+ if (ParameterIsShadowedByContextLocal(scope_info, name)) continue;
ASSERT(!frame->GetParameter(i)->IsTheHole());
HandleScope scope(isolate);
- Handle<String> name(scope_info->ParameterName(i));
Handle<Object> value =
Object::GetPropertyOrElement(target, name).ToHandleChecked();
frame->SetParameterValue(i, *value);
@@ -11600,7 +11600,7 @@ static bool SetContextLocalValue(Isolate* isolate,
VariableMode mode;
InitializationFlag init_flag;
int context_index =
- scope_info->ContextSlotIndex(*next_name, &mode, &init_flag);
+ ScopeInfo::ContextSlotIndex(scope_info, next_name, &mode, &init_flag);
context->set(context_index, *new_value);
return true;
}
« no previous file with comments | « src/objects.h ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698