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

Unified Diff: src/debug/liveedit.cc

Issue 2272293004: Simply use the variable index to put them into the right ScopeInfo slot rather than sorting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: also add info in the right order, interleaved with adding names Created 4 years, 4 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/ast/variables.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/liveedit.cc
diff --git a/src/debug/liveedit.cc b/src/debug/liveedit.cc
index b51bb1a1c4c78e2c9a915fec270091ecd8d5a6a9..f5cc58348a52571334ef3c207b385b7d60a888c1 100644
--- a/src/debug/liveedit.cc
+++ b/src/debug/liveedit.cc
@@ -1906,17 +1906,15 @@ Handle<Object> LiveEditFunctionTracker::SerializeFunctionScope(Scope* scope) {
zone_);
current_scope->CollectStackAndContextLocals(&stack_list, &context_list,
&globals_list);
- context_list.Sort(&Variable::CompareIndex);
-
for (int i = 0; i < context_list.length(); i++) {
- SetElementSloppy(scope_info_list, scope_info_length,
- context_list[i]->name());
- scope_info_length++;
+ int context_index = context_list[i]->index() - Context::MIN_CONTEXT_SLOTS;
+ int location = scope_info_length + context_index * 2;
+ SetElementSloppy(scope_info_list, location, context_list[i]->name());
SetElementSloppy(
- scope_info_list, scope_info_length,
- Handle<Smi>(Smi::FromInt(context_list[i]->index()), isolate_));
- scope_info_length++;
+ scope_info_list, location + 1,
+ handle(Smi::FromInt(context_list[i]->index()), isolate_));
}
+ scope_info_length += context_list.length() * 2;
SetElementSloppy(scope_info_list, scope_info_length,
Handle<Object>(isolate_->heap()->null_value(), isolate_));
scope_info_length++;
« no previous file with comments | « src/ast/variables.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698