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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 11411142: Support loads from Uint8Array and ExternalUint8Array in the optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: added Uint8Array Created 8 years, 1 month 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: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 15254)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -1142,12 +1142,14 @@
RawAbstractType* LoadIndexedInstr::CompileType() const {
switch (class_id_) {
case kArrayCid:
- case kGrowableObjectArrayCid:
case kImmutableArrayCid:
return Type::DynamicType();
case kFloat32ArrayCid :
case kFloat64ArrayCid :
return Type::Double();
+ case kUint8ArrayCid:
+ case kExternalUint8ArrayCid:
+ return Type::IntType();
srdjan 2012/11/22 18:18:19 Could we also add range for the result?
Florian Schneider 2012/11/23 14:49:39 Done. Added LoadIndexedInstr::InferRange.
default:
UNIMPLEMENTED();
return Type::IntType();
@@ -1158,12 +1160,14 @@
intptr_t LoadIndexedInstr::ResultCid() const {
switch (class_id_) {
case kArrayCid:
- case kGrowableObjectArrayCid:
case kImmutableArrayCid:
return kDynamicCid;
case kFloat32ArrayCid :
case kFloat64ArrayCid :
return kDoubleCid;
+ case kUint8ArrayCid:
+ case kExternalUint8ArrayCid:
+ return kSmiCid;
default:
UNIMPLEMENTED();
return kSmiCid;
@@ -1174,8 +1178,9 @@
Representation LoadIndexedInstr::representation() const {
switch (class_id_) {
case kArrayCid:
- case kGrowableObjectArrayCid:
case kImmutableArrayCid:
+ case kUint8ArrayCid:
+ case kExternalUint8ArrayCid:
return kTagged;
case kFloat32ArrayCid :
case kFloat64ArrayCid :
@@ -2662,6 +2667,10 @@
case kArrayCid:
case kImmutableArrayCid:
return Array::length_offset();
+ case kUint8ArrayCid:
+ return Uint8Array::length_offset();
+ case kExternalUint8ArrayCid:
+ return ByteArray::length_offset();
default:
UNREACHABLE();
return -1;

Powered by Google App Engine
This is Rietveld 408576698