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

Unified Diff: src/elements.cc

Issue 1224343003: Hacky fix for SlowSloppyElementsAccessor::Set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index e830d7c46500524ce32a8f0b213fc16214d5094d..8c1f300d7edeb77f2ad3aab6844abbe3042fd604 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -1488,7 +1488,22 @@ class SloppyArgumentsElementsAccessor
context->set(context_entry, value);
} else {
FixedArray* arguments = FixedArray::cast(parameter_map->get(1));
- ArgumentsAccessor::SetImpl(arguments, index, value);
+ SeededNumberDictionary* backing_store =
+ SeededNumberDictionary::cast(arguments);
+ int entry = backing_store->FindEntry(index);
+ DCHECK_NE(entry, SeededNumberDictionary::kNotFound);
+ Object* current_value = backing_store->ValueAt(entry);
+ if (current_value->IsAliasedArgumentsEntry()) {
+ DisallowHeapAllocation no_gc;
+ AliasedArgumentsEntry* alias =
+ AliasedArgumentsEntry::cast(current_value);
+ Context* context = Context::cast(parameter_map->get(0));
+ int context_entry = alias->aliased_context_slot();
+ DCHECK(!context->get(context_entry)->IsTheHole());
+ context->set(context_entry, value);
+ } else {
+ ArgumentsAccessor::SetImpl(arguments, index, value);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698