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

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: 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
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
958 case kImmutableArrayCid: { 957 case kImmutableArrayCid: {
959 const intptr_t disp = offset * kWordSize + sizeof(RawArray); 958 const intptr_t disp = offset * kWordSize + sizeof(RawArray);
960 ASSERT(Utils::IsInt(31, disp)); 959 ASSERT(Utils::IsInt(31, disp));
961 return FieldAddress(array, disp); 960 return FieldAddress(array, disp);
962 } 961 }
963 case kFloat32ArrayCid: { 962 case kFloat32ArrayCid: {
964 const intptr_t disp = 963 const intptr_t disp =
965 offset * kFloatSize + Float32Array::data_offset(); 964 offset * kFloatSize + Float32Array::data_offset();
966 ASSERT(Utils::IsInt(31, disp)); 965 ASSERT(Utils::IsInt(31, disp));
967 return FieldAddress(array, disp); 966 return FieldAddress(array, disp);
968 } 967 }
969 case kFloat64ArrayCid: { 968 case kFloat64ArrayCid: {
970 const intptr_t disp = 969 const intptr_t disp =
971 offset * kDoubleSize + Float64Array::data_offset(); 970 offset * kDoubleSize + Float64Array::data_offset();
972 ASSERT(Utils::IsInt(31, disp)); 971 ASSERT(Utils::IsInt(31, disp));
973 return FieldAddress(array, disp); 972 return FieldAddress(array, disp);
974 } 973 }
974 case kUint8ArrayCid: {
975 const intptr_t disp = offset + Uint8Array::data_offset();
976 ASSERT(Utils::IsInt(31, disp));
977 return FieldAddress(array, disp);
978 }
975 default: 979 default:
976 UNIMPLEMENTED(); 980 UNIMPLEMENTED();
977 return FieldAddress(SPREG, 0); 981 return FieldAddress(SPREG, 0);
978 } 982 }
979 } 983 }
980 984
985
986 FieldAddress FlowGraphCompiler::ElementAddressForRegIndex(intptr_t cid,
987 Register array,
988 Register index) {
989 // Note that index is Smi, i.e, times 2.
990 ASSERT(kSmiTagShift == 1);
991 switch (cid) {
992 case kArrayCid:
993 case kImmutableArrayCid:
994 return FieldAddress(array, index, TIMES_HALF_WORD_SIZE, sizeof(RawArray));
995 case kFloat32ArrayCid:
996 return FieldAddress(array, index, TIMES_2, Float32Array::data_offset());
997 case kFloat64ArrayCid:
998 return FieldAddress(array, index, TIMES_4, Float64Array::data_offset());
999 case kUint8ArrayCid:
1000 return FieldAddress(array, index, TIMES_1, Uint8Array::data_offset());
1001 default:
1002 UNIMPLEMENTED();
1003 return FieldAddress(SPREG, 0);
1004 }
1005 }
1006
981 } // namespace dart 1007 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698