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

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 11783006: Intrinsify Uint8ClampedArray's store and load indexed, inline load indexed. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 1085
1086 RawAbstractType* LoadIndexedInstr::CompileType() const { 1086 RawAbstractType* LoadIndexedInstr::CompileType() const {
1087 switch (class_id_) { 1087 switch (class_id_) {
1088 case kArrayCid: 1088 case kArrayCid:
1089 case kImmutableArrayCid: 1089 case kImmutableArrayCid:
1090 return Type::DynamicType(); 1090 return Type::DynamicType();
1091 case kFloat32ArrayCid : 1091 case kFloat32ArrayCid :
1092 case kFloat64ArrayCid : 1092 case kFloat64ArrayCid :
1093 return Type::Double(); 1093 return Type::Double();
1094 case kUint8ArrayCid: 1094 case kUint8ArrayCid:
1095 case kUint8ClampedArrayCid:
1095 case kExternalUint8ArrayCid: 1096 case kExternalUint8ArrayCid:
1096 return Type::IntType(); 1097 return Type::IntType();
1097 default: 1098 default:
1098 UNIMPLEMENTED(); 1099 UNIMPLEMENTED();
1099 return Type::IntType(); 1100 return Type::IntType();
1100 } 1101 }
1101 } 1102 }
1102 1103
1103 1104
1104 intptr_t LoadIndexedInstr::ResultCid() const { 1105 intptr_t LoadIndexedInstr::ResultCid() const {
1105 switch (class_id_) { 1106 switch (class_id_) {
1106 case kArrayCid: 1107 case kArrayCid:
1107 case kImmutableArrayCid: 1108 case kImmutableArrayCid:
1108 return kDynamicCid; 1109 return kDynamicCid;
1109 case kFloat32ArrayCid : 1110 case kFloat32ArrayCid :
1110 case kFloat64ArrayCid : 1111 case kFloat64ArrayCid :
1111 return kDoubleCid; 1112 return kDoubleCid;
1112 case kUint8ArrayCid: 1113 case kUint8ArrayCid:
1114 case kUint8ClampedArrayCid:
1113 case kExternalUint8ArrayCid: 1115 case kExternalUint8ArrayCid:
1114 return kSmiCid; 1116 return kSmiCid;
1115 default: 1117 default:
1116 UNIMPLEMENTED(); 1118 UNIMPLEMENTED();
1117 return kSmiCid; 1119 return kSmiCid;
1118 } 1120 }
1119 } 1121 }
1120 1122
1121 1123
1122 Representation LoadIndexedInstr::representation() const { 1124 Representation LoadIndexedInstr::representation() const {
1123 switch (class_id_) { 1125 switch (class_id_) {
1124 case kArrayCid: 1126 case kArrayCid:
1125 case kImmutableArrayCid: 1127 case kImmutableArrayCid:
1126 case kUint8ArrayCid: 1128 case kUint8ArrayCid:
1129 case kUint8ClampedArrayCid:
1127 case kExternalUint8ArrayCid: 1130 case kExternalUint8ArrayCid:
1128 return kTagged; 1131 return kTagged;
1129 case kFloat32ArrayCid : 1132 case kFloat32ArrayCid :
1130 case kFloat64ArrayCid : 1133 case kFloat64ArrayCid :
1131 return kUnboxedDouble; 1134 return kUnboxedDouble;
1132 default: 1135 default:
1133 UNIMPLEMENTED(); 1136 UNIMPLEMENTED();
1134 return kTagged; 1137 return kTagged;
1135 } 1138 }
1136 } 1139 }
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 RangeBoundary::FromConstant(0xFFFF)); 2456 RangeBoundary::FromConstant(0xFFFF));
2454 break; 2457 break;
2455 default: 2458 default:
2456 UNIMPLEMENTED(); 2459 UNIMPLEMENTED();
2457 } 2460 }
2458 } 2461 }
2459 2462
2460 2463
2461 void LoadIndexedInstr::InferRange() { 2464 void LoadIndexedInstr::InferRange() {
2462 switch (class_id()) { 2465 switch (class_id()) {
2466 case kUint8ArrayCid:
2467 case kUint8ClampedArrayCid:
2463 case kExternalUint8ArrayCid: 2468 case kExternalUint8ArrayCid:
2464 case kUint8ArrayCid:
2465 range_ = new Range(RangeBoundary::FromConstant(0), 2469 range_ = new Range(RangeBoundary::FromConstant(0),
2466 RangeBoundary::FromConstant(255)); 2470 RangeBoundary::FromConstant(255));
2467 break; 2471 break;
2468 default: 2472 default:
2469 Definition::InferRange(); 2473 Definition::InferRange();
2470 break; 2474 break;
2471 } 2475 }
2472 } 2476 }
2473 2477
2474 2478
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 case kFloat32ArrayCid: 2696 case kFloat32ArrayCid:
2693 return Float32Array::length_offset(); 2697 return Float32Array::length_offset();
2694 case kOneByteStringCid: 2698 case kOneByteStringCid:
2695 case kTwoByteStringCid: 2699 case kTwoByteStringCid:
2696 return String::length_offset(); 2700 return String::length_offset();
2697 case kArrayCid: 2701 case kArrayCid:
2698 case kImmutableArrayCid: 2702 case kImmutableArrayCid:
2699 return Array::length_offset(); 2703 return Array::length_offset();
2700 case kUint8ArrayCid: 2704 case kUint8ArrayCid:
2701 return Uint8Array::length_offset(); 2705 return Uint8Array::length_offset();
2706 case kUint8ClampedArrayCid:
2707 return Uint8ClampedArray::length_offset();
2702 case kExternalUint8ArrayCid: 2708 case kExternalUint8ArrayCid:
2703 return ByteArray::length_offset(); 2709 return ByteArray::length_offset();
2704 default: 2710 default:
2705 UNREACHABLE(); 2711 UNREACHABLE();
2706 return -1; 2712 return -1;
2707 } 2713 }
2708 } 2714 }
2709 2715
2710 2716
2711 #undef __ 2717 #undef __
2712 2718
2713 } // namespace dart 2719 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698