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

Side by Side Diff: runtime/vm/flow_graph_compiler.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 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 return false; 947 return false;
948 } 948 }
949 } 949 }
950 950
951 951
952 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid, 952 FieldAddress FlowGraphCompiler::ElementAddressForIntIndex(intptr_t cid,
953 Register array, 953 Register array,
954 intptr_t offset) { 954 intptr_t offset) {
955 switch (cid) { 955 switch (cid) {
956 case kArrayCid: 956 case kArrayCid:
957 case kGrowableObjectArrayCid: 957 case kGrowableObjectArrayCid:
srdjan 2012/11/22 18:18:19 Can we remove kGrowableObjectArrayCid here as well
Florian Schneider 2012/11/23 14:49:39 Yes, good point.
958 case kImmutableArrayCid: { 958 case kImmutableArrayCid: {
959 const intptr_t disp = offset * kWordSize + sizeof(RawArray); 959 const intptr_t disp = offset * kWordSize + sizeof(RawArray);
960 ASSERT(Utils::IsInt(31, disp)); 960 ASSERT(Utils::IsInt(31, disp));
961 return FieldAddress(array, disp); 961 return FieldAddress(array, disp);
962 } 962 }
963 case kFloat32ArrayCid: { 963 case kFloat32ArrayCid: {
964 const intptr_t disp = 964 const intptr_t disp =
965 offset * kFloatSize + Float32Array::data_offset(); 965 offset * kFloatSize + Float32Array::data_offset();
966 ASSERT(Utils::IsInt(31, disp)); 966 ASSERT(Utils::IsInt(31, disp));
967 return FieldAddress(array, disp); 967 return FieldAddress(array, disp);
968 } 968 }
969 case kFloat64ArrayCid: { 969 case kFloat64ArrayCid: {
970 const intptr_t disp = 970 const intptr_t disp =
971 offset * kDoubleSize + Float64Array::data_offset(); 971 offset * kDoubleSize + Float64Array::data_offset();
972 ASSERT(Utils::IsInt(31, disp)); 972 ASSERT(Utils::IsInt(31, disp));
973 return FieldAddress(array, disp); 973 return FieldAddress(array, disp);
974 } 974 }
975 case kUint8ArrayCid: {
976 const intptr_t disp = offset + Uint8Array::data_offset();
977 ASSERT(Utils::IsInt(31, disp));
978 return FieldAddress(array, disp);
979 }
975 default: 980 default:
976 UNIMPLEMENTED(); 981 UNIMPLEMENTED();
977 return FieldAddress(SPREG, 0); 982 return FieldAddress(SPREG, 0);
978 } 983 }
979 } 984 }
980 985
986
987 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid,
988 Register array,
989 Register index) {
990 // Note that index is Smi, i.e, times 2.
991 ASSERT(kSmiTagShift == 1);
992 switch (cid) {
993 case kArrayCid:
994 case kImmutableArrayCid:
995 return FieldAddress(array, index, TIMES_HALF_WORD_SIZE, sizeof(RawArray));
996 case kFloat32ArrayCid:
997 return FieldAddress(array, index, TIMES_2, Float32Array::data_offset());
998 case kFloat64ArrayCid:
999 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
1000 case kUint8ArrayCid:
1001 return FieldAddress(array, index, TIMES_1, Uint8Array::data_offset());
1002 default:
1003 UNIMPLEMENTED();
1004 return FieldAddress(SPREG, 0);
1005 }
1006 }
1007
981 } // namespace dart 1008 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | runtime/vm/flow_graph_optimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698