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

Unified Diff: runtime/vm/locations.h

Issue 12871010: Replace scalarlist optimizations and split external array loads into two IL instructions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/locations.h
===================================================================
--- runtime/vm/locations.h (revision 20148)
+++ runtime/vm/locations.h (working copy)
@@ -14,6 +14,17 @@
class BufferFormatter;
class Value;
+
+enum Representation {
+ kNoRepresentation,
+ kTagged,
+ kUntagged,
+ kUnboxedDouble,
+ kUnboxedMint,
+ kNumRepresentations
+};
+
+
// Location objects are used to connect register allocator and code generator.
// Instruction templates used by code generator have a corresponding
// LocationSummary object which specifies expected location for every input
@@ -160,10 +171,10 @@
}
// Register locations.
- static Location RegisterLocation(Register reg) {
+ static Location RegisterLocation(Register reg, Representation rep = kTagged) {
uword payload =
RegisterField::encode(reg) |
- RepresentationField::encode(kDouble); // Unused for Register.
+ RepresentationField::encode(rep);
return Location(kRegister, payload);
}
@@ -176,15 +187,7 @@
return RegisterField::decode(payload());
}
- // FPU registers and double spill slots can contain either doubles
- // or 64-bit integers.
- enum Representation {
- kDouble,
- kMint
- };
-
Representation representation() const {
- ASSERT(IsFpuRegister() || IsDoubleStackSlot());
return RepresentationField::decode(payload());
}
@@ -230,7 +233,7 @@
// Spill slots.
static Location StackSlot(intptr_t stack_index,
- Representation rep = kDouble) {
+ Representation rep = kTagged) {
ASSERT((-kStackIndexBias <= stack_index) &&
(stack_index < kStackIndexBias));
uword payload =
@@ -310,9 +313,10 @@
// Layout for kUnallocated locations payload.
typedef BitField<Policy, 0, 3> PolicyField;
- // Layout for register locations payload. The representation bit is only used
- // for FpuRegister and unused for Register.
- static const intptr_t kBitsForRepresentation = 1;
+ // Layout for register locations payload.
+ static const intptr_t kBitsForRepresentation = 3;
+ COMPILE_ASSERT(kNumRepresentations <= (1 << kBitsForRepresentation),
+ invalid_enum);
static const intptr_t kBitsForRegister =
kBitsForPayload - kBitsForRepresentation;
typedef BitField<Representation,
@@ -325,8 +329,7 @@
kBitsForRepresentation,
kBitsForRegister> FpuRegisterField;
- // Layout for stack slots. The representation bit is only used for
- // DoubleStackSlot and unused for StackSlot.
+ // Layout for stack slots.
static const intptr_t kBitsForIndex =
kBitsForPayload - kBitsForRepresentation;
typedef BitField<uword,
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698