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

Unified Diff: src/x64/lithium-x64.cc

Issue 6656001: Support external arrays in Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: stub out arm Created 9 years, 9 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
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index 09b7b6342838c14d2e0bbd98218b0004a0415c5d..a2d3258722b55e991ef4d8f87c30be8638d99aaa 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -1801,16 +1801,27 @@ LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
}
-LInstruction* LChunkBuilder::DoLoadPixelArrayElement(
- HLoadPixelArrayElement* instr) {
- ASSERT(instr->representation().IsInteger32());
+LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement(
+ HLoadKeyedSpecializedArrayElement* instr) {
+ ExternalArrayType array_type = instr->array_type();
+ Representation representation(instr->representation());
+ ASSERT((representation.IsInteger32() && array_type != kExternalFloatArray) ||
+ (representation.IsDouble() && array_type == kExternalFloatArray));
ASSERT(instr->key()->representation().IsInteger32());
LOperand* external_pointer =
UseRegisterAtStart(instr->external_pointer());
LOperand* key = UseRegisterAtStart(instr->key());
- LLoadPixelArrayElement* result =
- new LLoadPixelArrayElement(external_pointer, key);
- return DefineSameAsFirst(result);
+ LLoadKeyedSpecializedArrayElement* result =
+ new LLoadKeyedSpecializedArrayElement(external_pointer,
+ key,
+ array_type);
+ LInstruction* load_instr = array_type != kExternalFloatArray ?
+ DefineSameAsFirst(result) :
+ DefineAsRegister(result);
+ // An unsigned int array load might overflow and cause a deopt, make sure it
+ // has an environment.
+ return (array_type == kExternalUnsignedIntArray) ?
+ AssignEnvironment(load_instr) : load_instr;
}
@@ -1842,9 +1853,13 @@ LInstruction* LChunkBuilder::DoStoreKeyedFastElement(
}
-LInstruction* LChunkBuilder::DoStorePixelArrayElement(
- HStorePixelArrayElement* instr) {
- ASSERT(instr->value()->representation().IsInteger32());
+LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement(
+ HStoreKeyedSpecializedArrayElement* instr) {
+ Representation representation(instr->value()->representation());
+ ASSERT((representation.IsInteger32() &&
+ (instr->array_type() != kExternalFloatArray)) ||
+ (representation.IsDouble() &&
+ (instr->array_type() == kExternalFloatArray)));
ASSERT(instr->external_pointer()->representation().IsExternal());
ASSERT(instr->key()->representation().IsInteger32());
@@ -1852,7 +1867,10 @@ LInstruction* LChunkBuilder::DoStorePixelArrayElement(
LOperand* val = UseTempRegister(instr->value());
LOperand* key = UseRegister(instr->key());
- return new LStorePixelArrayElement(external_pointer, key, val);
+ return new LStoreKeyedSpecializedArrayElement(external_pointer,
+ key,
+ val,
+ instr->array_type());
}
« src/ia32/lithium-ia32.cc ('K') | « src/x64/lithium-x64.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698