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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 136753012: Refactor unboxed fields in preparation of reusable SIMD boxes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 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 ff334db5e8bf4e4d749d593f57f8ab6b978258e0..a4bd4f9f27c82cfbff20d6109b1c7dcafcddf19b 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -151,6 +151,21 @@ bool LoadFieldInstr::IsPotentialUnboxedLoad() const {
}
+Representation LoadFieldInstr::representation() const {
+ if (IsUnboxedLoad()) {
+ const intptr_t cid = field()->UnboxedFieldCid();
+ switch (cid) {
+ case kDoubleCid:
+ return kUnboxedDouble;
+ // TODO(johnmccutchan): Add kFloat32x4Cid here.
+ default:
+ UNREACHABLE();
+ }
+ }
+ return kTagged;
+}
+
+
bool StoreInstanceFieldInstr::IsUnboxedStore() const {
return FLAG_unbox_double_fields && field().IsUnboxedField();
}
@@ -161,6 +176,22 @@ bool StoreInstanceFieldInstr::IsPotentialUnboxedStore() const {
}
+Representation StoreInstanceFieldInstr::RequiredInputRepresentation(
+ intptr_t index) const {
+ ASSERT((index == 0) || (index == 1));
+ if ((index == 1) && IsUnboxedStore()) {
+ const intptr_t cid = field().UnboxedFieldCid();
+ switch (cid) {
+ case kDoubleCid:
+ return kUnboxedDouble;
+ default:
+ UNREACHABLE();
+ }
+ }
+ return kTagged;
+}
+
+
bool GuardFieldInstr::AttributesEqual(Instruction* other) const {
return field().raw() == other->AsGuardField()->field().raw();
}
« 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