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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2452453002: Support unaligned integer loads on ARM and MIPS. (Closed)
Patch Set: . Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index c3359f1f23fe46637922f5369b64a07f62f3c7f3..1b5771729ef5793424d4759acd9b598fd262995a 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3659,6 +3659,89 @@ Definition* StringInterpolateInstr::Canonicalize(FlowGraph* flow_graph) {
}
+LoadIndexedInstr::LoadIndexedInstr(Value* array,
+ Value* index,
+ intptr_t index_scale,
+ intptr_t class_id,
+ bool aligned,
+ intptr_t deopt_id,
+ TokenPosition token_pos)
+ : TemplateDefinition(deopt_id),
+ index_scale_(index_scale),
+ class_id_(class_id),
+ aligned_(aligned),
+ token_pos_(token_pos) {
+ SetInputAt(0, array);
+ SetInputAt(1, index);
+
+ switch (class_id) {
+ case kTypedDataInt8ArrayCid:
+ case kTypedDataUint8ArrayCid:
+ case kTypedDataUint8ClampedArrayCid:
+ case kExternalTypedDataUint8ArrayCid:
+ case kExternalTypedDataUint8ClampedArrayCid:
+ case kOneByteStringCid:
+ case kExternalOneByteStringCid:
+ // Don't need to worry about alignment for accessing bytes.
+ aligned_ = true;
+ break;
+ case kTypedDataFloat32ArrayCid:
+ case kTypedDataFloat64ArrayCid:
+ case kTypedDataFloat64x2ArrayCid:
+ case kTypedDataInt32x4ArrayCid:
+ case kTypedDataFloat32x4ArrayCid:
+ // TODO(rmacnak): Investigate alignment requirements of floating point
+ // loads.
+ aligned_ = true;
+ break;
zra 2016/10/26 06:59:41 I'd sort of prefer leaving aligned_ out of the ini
Cutch 2016/10/26 09:00:29 I'd like to see the switch statement factored into
rmacnak 2016/10/31 22:57:26 Switched to enum and separate narrowing function.
+ }
+}
+
+
+
+StoreIndexedInstr::StoreIndexedInstr(Value* array,
+ Value* index,
+ Value* value,
+ StoreBarrierType emit_store_barrier,
+ intptr_t index_scale,
+ intptr_t class_id,
+ bool aligned,
+ intptr_t deopt_id,
+ TokenPosition token_pos)
+ : TemplateDefinition(deopt_id),
+ emit_store_barrier_(emit_store_barrier),
+ index_scale_(index_scale),
+ class_id_(class_id),
+ aligned_(aligned),
+ token_pos_(token_pos) {
+ SetInputAt(kArrayPos, array);
+ SetInputAt(kIndexPos, index);
+ SetInputAt(kValuePos, value);
+
+ switch (class_id) {
+ case kTypedDataInt8ArrayCid:
+ case kTypedDataUint8ArrayCid:
+ case kTypedDataUint8ClampedArrayCid:
+ case kExternalTypedDataUint8ArrayCid:
+ case kExternalTypedDataUint8ClampedArrayCid:
+ case kOneByteStringCid:
+ case kExternalOneByteStringCid:
+ // Don't need to worry about alignment for accessing bytes.
+ aligned_ = true;
+ break;
+ case kTypedDataFloat32ArrayCid:
+ case kTypedDataFloat64ArrayCid:
+ case kTypedDataFloat64x2ArrayCid:
+ case kTypedDataInt32x4ArrayCid:
+ case kTypedDataFloat32x4ArrayCid:
+ // TODO(rmacnak): Investigate alignment requirements of floating point
+ // loads.
+ aligned_ = true;
+ break;
zra 2016/10/26 06:59:41 ditto
+ }
+}
+
+
InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
ZoneGrowableArray<Value*>* inputs,
intptr_t deopt_id,

Powered by Google App Engine
This is Rietveld 408576698