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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 1135
1136 1136
1137 intptr_t StringFromCharCodeInstr::ResultCid() const { 1137 intptr_t StringFromCharCodeInstr::ResultCid() const {
1138 return kDynamicCid; 1138 return kDynamicCid;
1139 } 1139 }
1140 1140
1141 1141
1142 RawAbstractType* LoadIndexedInstr::CompileType() const { 1142 RawAbstractType* LoadIndexedInstr::CompileType() const {
1143 switch (class_id_) { 1143 switch (class_id_) {
1144 case kArrayCid: 1144 case kArrayCid:
1145 case kGrowableObjectArrayCid:
1146 case kImmutableArrayCid: 1145 case kImmutableArrayCid:
1147 return Type::DynamicType(); 1146 return Type::DynamicType();
1148 case kFloat32ArrayCid : 1147 case kFloat32ArrayCid :
1149 case kFloat64ArrayCid : 1148 case kFloat64ArrayCid :
1150 return Type::Double(); 1149 return Type::Double();
1150 case kUint8ArrayCid:
1151 case kExternalUint8ArrayCid:
1152 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.
1151 default: 1153 default:
1152 UNIMPLEMENTED(); 1154 UNIMPLEMENTED();
1153 return Type::IntType(); 1155 return Type::IntType();
1154 } 1156 }
1155 } 1157 }
1156 1158
1157 1159
1158 intptr_t LoadIndexedInstr::ResultCid() const { 1160 intptr_t LoadIndexedInstr::ResultCid() const {
1159 switch (class_id_) { 1161 switch (class_id_) {
1160 case kArrayCid: 1162 case kArrayCid:
1161 case kGrowableObjectArrayCid:
1162 case kImmutableArrayCid: 1163 case kImmutableArrayCid:
1163 return kDynamicCid; 1164 return kDynamicCid;
1164 case kFloat32ArrayCid : 1165 case kFloat32ArrayCid :
1165 case kFloat64ArrayCid : 1166 case kFloat64ArrayCid :
1166 return kDoubleCid; 1167 return kDoubleCid;
1168 case kUint8ArrayCid:
1169 case kExternalUint8ArrayCid:
1170 return kSmiCid;
1167 default: 1171 default:
1168 UNIMPLEMENTED(); 1172 UNIMPLEMENTED();
1169 return kSmiCid; 1173 return kSmiCid;
1170 } 1174 }
1171 } 1175 }
1172 1176
1173 1177
1174 Representation LoadIndexedInstr::representation() const { 1178 Representation LoadIndexedInstr::representation() const {
1175 switch (class_id_) { 1179 switch (class_id_) {
1176 case kArrayCid: 1180 case kArrayCid:
1177 case kGrowableObjectArrayCid:
1178 case kImmutableArrayCid: 1181 case kImmutableArrayCid:
1182 case kUint8ArrayCid:
1183 case kExternalUint8ArrayCid:
1179 return kTagged; 1184 return kTagged;
1180 case kFloat32ArrayCid : 1185 case kFloat32ArrayCid :
1181 case kFloat64ArrayCid : 1186 case kFloat64ArrayCid :
1182 return kUnboxedDouble; 1187 return kUnboxedDouble;
1183 default: 1188 default:
1184 UNIMPLEMENTED(); 1189 UNIMPLEMENTED();
1185 return kTagged; 1190 return kTagged;
1186 } 1191 }
1187 } 1192 }
1188 1193
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 case kFloat64ArrayCid: 2660 case kFloat64ArrayCid:
2656 return Float64Array::length_offset(); 2661 return Float64Array::length_offset();
2657 case kFloat32ArrayCid: 2662 case kFloat32ArrayCid:
2658 return Float32Array::length_offset(); 2663 return Float32Array::length_offset();
2659 case kOneByteStringCid: 2664 case kOneByteStringCid:
2660 case kTwoByteStringCid: 2665 case kTwoByteStringCid:
2661 return String::length_offset(); 2666 return String::length_offset();
2662 case kArrayCid: 2667 case kArrayCid:
2663 case kImmutableArrayCid: 2668 case kImmutableArrayCid:
2664 return Array::length_offset(); 2669 return Array::length_offset();
2670 case kUint8ArrayCid:
2671 return Uint8Array::length_offset();
2672 case kExternalUint8ArrayCid:
2673 return ByteArray::length_offset();
2665 default: 2674 default:
2666 UNREACHABLE(); 2675 UNREACHABLE();
2667 return -1; 2676 return -1;
2668 } 2677 }
2669 } 2678 }
2670 2679
2671 #undef __ 2680 #undef __
2672 2681
2673 } // namespace dart 2682 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698