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

Unified Diff: runtime/vm/flow_graph_compiler.cc

Issue 11967012: Optimized loads/stores for scalar list: Uint8Clamped, Int8, Int16, Uint16. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 7 years, 11 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 | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler.cc
===================================================================
--- runtime/vm/flow_graph_compiler.cc (revision 17135)
+++ runtime/vm/flow_graph_compiler.cc (working copy)
@@ -1041,14 +1041,22 @@
return Float32Array::kBytesPerElement;
case kFloat64ArrayCid:
return Float64Array::kBytesPerElement;
+ case kInt8ArrayCid:
+ return Int8Array::kBytesPerElement;
case kUint8ArrayCid:
return Uint8Array::kBytesPerElement;
case kUint8ClampedArrayCid:
return Uint8ClampedArray::kBytesPerElement;
+ case kInt16ArrayCid:
+ return Int16Array::kBytesPerElement;
+ case kUint16ArrayCid:
+ return Uint16Array::kBytesPerElement;
case kOneByteStringCid:
return OneByteString::kBytesPerElement;
case kTwoByteStringCid:
return TwoByteString::kBytesPerElement;
+ case kExternalUint8ArrayCid:
+ return ExternalUint8Array::kBytesPerElement;
default:
UNIMPLEMENTED();
return 0;
@@ -1065,10 +1073,16 @@
return Float32Array::data_offset();
case kFloat64ArrayCid:
return Float64Array::data_offset();
+ case kInt8ArrayCid:
+ return Int8Array::data_offset();
case kUint8ArrayCid:
return Uint8Array::data_offset();
case kUint8ClampedArrayCid:
return Uint8ClampedArray::data_offset();
+ case kInt16ArrayCid:
+ return Int16Array::data_offset();
+ case kUint16ArrayCid:
+ return Uint16Array::data_offset();
case kOneByteStringCid:
return OneByteString::data_offset();
case kTwoByteStringCid:
@@ -1106,11 +1120,17 @@
return FieldAddress(array, index, TIMES_2, Float32Array::data_offset());
case kFloat64ArrayCid:
return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
+ case kInt8ArrayCid:
+ return FieldAddress(array, index, TIMES_1, Int8Array::data_offset());
case kUint8ArrayCid:
return FieldAddress(array, index, TIMES_1, Uint8Array::data_offset());
case kUint8ClampedArrayCid:
return
FieldAddress(array, index, TIMES_1, Uint8ClampedArray::data_offset());
+ case kInt16ArrayCid:
+ return FieldAddress(array, index, TIMES_1, Int16Array::data_offset());
+ case kUint16ArrayCid:
+ return FieldAddress(array, index, TIMES_1, Uint16Array::data_offset());
case kOneByteStringCid:
return FieldAddress(array, index, TIMES_1, OneByteString::data_offset());
case kTwoByteStringCid:
@@ -1122,6 +1142,26 @@
}
+Address FlowGraphCompiler::ExternalElementAddressForIntIndex(intptr_t cid,
+ Register array,
+ intptr_t index) {
+ return Address(array, index * ElementSizeFor(cid));
+}
+
+
+Address FlowGraphCompiler::ExternalElementAddressForRegIndex(intptr_t cid,
+ Register array,
+ Register index) {
+ switch (cid) {
+ case kExternalUint8ArrayCid:
+ return Address(array, index, TIMES_1, 0);
+ default:
+ UNIMPLEMENTED();
+ return Address(SPREG, 0);
+ }
+}
+
+
// Returns true if checking against this type is a direct class id comparison.
bool FlowGraphCompiler::TypeCheckAsClassEquality(const AbstractType& type) {
ASSERT(type.IsFinalized() && !type.IsMalformed());
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph_compiler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698