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

Unified Diff: src/runtime.cc

Issue 12326103: Debugger: ScopeMirror has N^2 algorithm when building closure mirrors. (take 2). (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: Created 7 years, 10 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 c379ec9101a463ac36f25a334995395dcca2e7a6..7b13f05f89d251729e5b2e8f18695cb4fc0624ff 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -10766,34 +10766,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFrameDetails) {
}
-// Copy all the context locals into an object used to materialize a scope.
-static bool CopyContextLocalsToScopeObject(
- Isolate* isolate,
- Handle<ScopeInfo> scope_info,
- Handle<Context> context,
- Handle<JSObject> scope_object) {
- // Fill all context locals to the context extension.
- for (int i = 0; i < scope_info->ContextLocalCount(); i++) {
- VariableMode mode;
- InitializationFlag init_flag;
- int context_index = scope_info->ContextSlotIndex(
- scope_info->ContextLocalName(i), &mode, &init_flag);
-
- RETURN_IF_EMPTY_HANDLE_VALUE(
- isolate,
- SetProperty(isolate,
- scope_object,
- Handle<String>(scope_info->ContextLocalName(i)),
- Handle<Object>(context->get(context_index), isolate),
- NONE,
- kNonStrictMode),
- false);
- }
-
- return true;
-}
-
-
// Create a plain JSObject which materializes the local scope for the specified
// frame.
static Handle<JSObject> MaterializeLocalScopeWithFrameInspector(
@@ -10843,8 +10815,8 @@ static Handle<JSObject> MaterializeLocalScopeWithFrameInspector(
// Third fill all context locals.
Handle<Context> frame_context(Context::cast(frame->context()));
Handle<Context> function_context(frame_context->declaration_context());
- if (!CopyContextLocalsToScopeObject(
- isolate, scope_info, function_context, local_scope)) {
+ if (!scope_info->CopyContextLocalsToScopeObject(
+ isolate, function_context, local_scope)) {
return Handle<JSObject>();
}
@@ -10996,8 +10968,8 @@ static Handle<JSObject> MaterializeClosure(Isolate* isolate,
isolate->factory()->NewJSObject(isolate->object_function());
// Fill all context locals to the context extension.
- if (!CopyContextLocalsToScopeObject(
- isolate, scope_info, context, closure_scope)) {
+ if (!scope_info->CopyContextLocalsToScopeObject(
+ isolate, context, closure_scope)) {
return Handle<JSObject>();
}
@@ -11116,8 +11088,8 @@ static Handle<JSObject> MaterializeBlockScope(
isolate->factory()->NewJSObject(isolate->object_function());
// Fill all context locals.
- if (!CopyContextLocalsToScopeObject(
- isolate, scope_info, context, block_scope)) {
+ if (!scope_info->CopyContextLocalsToScopeObject(
+ isolate, context, block_scope)) {
return Handle<JSObject>();
}
@@ -11139,8 +11111,8 @@ static Handle<JSObject> MaterializeModuleScope(
isolate->factory()->NewJSObject(isolate->object_function());
// Fill all context locals.
- if (!CopyContextLocalsToScopeObject(
- isolate, scope_info, context, module_scope)) {
+ if (!scope_info->CopyContextLocalsToScopeObject(
+ isolate, context, module_scope)) {
return Handle<JSObject>();
}
« 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