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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2452453002: Support unaligned integer loads on ARM and MIPS. (Closed)
Patch Set: review Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index fec4664478a654de9461b15388aba2c33012e3b7..db190ac6b704eb8c6fcd343bc0af6e16e417591e 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3664,6 +3664,71 @@ Definition* StringInterpolateInstr::Canonicalize(FlowGraph* flow_graph) {
}
+static AlignmentType StrengthenAlignment(intptr_t cid,
+ AlignmentType alignment) {
+ switch (cid) {
+ case kTypedDataInt8ArrayCid:
+ case kTypedDataUint8ArrayCid:
+ case kTypedDataUint8ClampedArrayCid:
+ case kExternalTypedDataUint8ArrayCid:
+ case kExternalTypedDataUint8ClampedArrayCid:
+ case kOneByteStringCid:
+ case kExternalOneByteStringCid:
+ // Don't need to worry about alignment for accessing bytes.
+ return kAlignedAccess;
+ case kTypedDataFloat32ArrayCid:
+ case kTypedDataFloat64ArrayCid:
+ case kTypedDataFloat64x2ArrayCid:
+ case kTypedDataInt32x4ArrayCid:
+ case kTypedDataFloat32x4ArrayCid:
+ // TODO(rmacnak): Investigate alignment requirements of floating point
+ // loads.
+ return kAlignedAccess;
+ }
+
+ return alignment;
+}
+
+
+LoadIndexedInstr::LoadIndexedInstr(Value* array,
+ Value* index,
+ intptr_t index_scale,
+ intptr_t class_id,
+ AlignmentType alignment,
+ intptr_t deopt_id,
+ TokenPosition token_pos)
+ : TemplateDefinition(deopt_id),
+ index_scale_(index_scale),
+ class_id_(class_id),
+ alignment_(StrengthenAlignment(class_id, alignment)),
+ token_pos_(token_pos) {
+ SetInputAt(0, array);
+ SetInputAt(1, index);
+}
+
+
+
+StoreIndexedInstr::StoreIndexedInstr(Value* array,
+ Value* index,
+ Value* value,
+ StoreBarrierType emit_store_barrier,
+ intptr_t index_scale,
+ intptr_t class_id,
+ AlignmentType alignment,
+ intptr_t deopt_id,
+ TokenPosition token_pos)
+ : TemplateDefinition(deopt_id),
+ emit_store_barrier_(emit_store_barrier),
+ index_scale_(index_scale),
+ class_id_(class_id),
+ alignment_(StrengthenAlignment(class_id, alignment)),
+ token_pos_(token_pos) {
+ SetInputAt(kArrayPos, array);
+ SetInputAt(kIndexPos, index);
+ SetInputAt(kValuePos, value);
+}
+
+
InvokeMathCFunctionInstr::InvokeMathCFunctionInstr(
ZoneGrowableArray<Value*>* inputs,
intptr_t deopt_id,
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698