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

Unified Diff: src/hydrogen.cc

Issue 7285001: Add support for dictionary elements to polymorphic crankshaft code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: small fixes Created 9 years, 6 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 | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index d700fd2e34c65ee621f470242e64b00b789aa9b3..602344ec4d8cb59b2fcf232cab9ce70160ebb7a0 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3917,8 +3917,6 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
todo_external_array = true;
}
}
- // We can't treat dictionary elements here (need to deopt instead).
- type_todo[JSObject::DICTIONARY_ELEMENTS] = false;
// Support for FAST_DOUBLE_ELEMENTS isn't implemented yet, so we deopt.
type_todo[JSObject::FAST_DOUBLE_ELEMENTS] = false;
@@ -3936,9 +3934,12 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
for (JSObject::ElementsKind elements_kind = JSObject::FAST_ELEMENTS;
elements_kind <= JSObject::LAST_ELEMENTS_KIND;
elements_kind = JSObject::ElementsKind(elements_kind + 1)) {
- // After having handled FAST_ELEMENTS in the first run of the loop, we
- // need to add some code that's executed for all other cases.
- if (elements_kind == 1 && todo_external_array) {
+ // After having handled FAST_ELEMENTS and DICTIONARY_ELEMENTS, we
+ // need to add some code that's executed for all external array cases.
+ STATIC_ASSERT(JSObject::LAST_EXTERNAL_ARRAY_ELEMENTS_KIND ==
+ JSObject::LAST_ELEMENTS_KIND);
+ if (elements_kind == JSObject::FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND
+ && todo_external_array) {
elements = AddInstruction(new(zone()) HLoadElements(object));
// We need to forcibly prevent some ElementsKind-dependent instructions
// from being hoisted out of any loops they might occur in, because
@@ -4007,6 +4008,12 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
access = AddInstruction(
new(zone()) HLoadKeyedFastElement(elements, checked_key));
}
+ } else if (elements_kind == JSObject::DICTIONARY_ELEMENTS) {
+ if (is_store) {
+ access = AddInstruction(BuildStoreKeyedGeneric(object, key, val));
+ } else {
+ access = AddInstruction(BuildLoadKeyedGeneric(object, key));
+ }
} else { // External array elements.
access = AddInstruction(BuildExternalArrayElementAccess(
external_elements, checked_key, val, elements_kind, is_store));
« no previous file with comments | « no previous file | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698