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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 1257223002: Revert of Remove ExternalArray, derived types, and element kinds (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 | « src/code-stubs.cc ('k') | src/compiler/access-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index fb46633f0b3c961f20931053ea2a26d24263e885..d5addc0368d864828f6ca4c0db0390566b40e1db 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -1987,6 +1987,13 @@
HValue* bit_field2,
ElementsKind kind);
+ void BuildExternalElementLoad(HGraphBuilder::IfBuilder* if_builder,
+ HValue* receiver,
+ HValue* key,
+ HValue* instance_type,
+ HValue* bit_field2,
+ ElementsKind kind);
+
KeyedLoadGenericStub* casted_stub() {
return static_cast<KeyedLoadGenericStub*>(stub());
}
@@ -2008,6 +2015,8 @@
void CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildFastElementLoad(
HGraphBuilder::IfBuilder* if_builder, HValue* receiver, HValue* key,
HValue* instance_type, HValue* bit_field2, ElementsKind kind) {
+ DCHECK(!IsExternalArrayElementsKind(kind));
+
BuildElementsKindLimitCheck(if_builder, bit_field2, kind);
IfBuilder js_array_check(this);
@@ -2027,6 +2036,20 @@
}
+void CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildExternalElementLoad(
+ HGraphBuilder::IfBuilder* if_builder, HValue* receiver, HValue* key,
+ HValue* instance_type, HValue* bit_field2, ElementsKind kind) {
+ DCHECK(IsExternalArrayElementsKind(kind));
+
+ BuildElementsKindLimitCheck(if_builder, bit_field2, kind);
+
+ Push(BuildUncheckedMonomorphicElementAccess(receiver, key, NULL,
+ false, kind,
+ LOAD, NEVER_RETURN_HOLE,
+ STANDARD_STORE));
+}
+
+
HValue* CodeStubGraphBuilder<KeyedLoadGenericStub>::BuildCodeStub() {
HValue* receiver = GetParameter(LoadDescriptor::kReceiverIndex);
HValue* key = GetParameter(LoadDescriptor::kNameIndex);
@@ -2087,6 +2110,42 @@
Add<HDeoptimize>(Deoptimizer::kNonStrictElementsInKeyedLoadGenericStub,
Deoptimizer::EAGER);
Push(graph()->GetConstant0());
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_INT8_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_UINT8_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_INT16_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_UINT16_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_INT32_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_UINT32_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_FLOAT32_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_FLOAT64_ELEMENTS);
+
+ kind_if.Else();
+ BuildExternalElementLoad(&kind_if, receiver, key, instance_type, bit_field2,
+ EXTERNAL_UINT8_CLAMPED_ELEMENTS);
kind_if.ElseDeopt(
Deoptimizer::kElementsKindUnhandledInKeyedLoadGenericStub);
@@ -2175,7 +2234,7 @@
index->ClearFlag(HValue::kCanOverflow);
HValue* property_index =
Add<HLoadKeyed>(cache_field_offsets, index, nullptr,
- INT32_ELEMENTS, NEVER_RETURN_HOLE, 0);
+ EXTERNAL_INT32_ELEMENTS, NEVER_RETURN_HOLE, 0);
Push(property_index);
}
lookup_if->Else();
« no previous file with comments | « src/code-stubs.cc ('k') | src/compiler/access-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698