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

Unified Diff: runtime/vm/locations.h

Issue 11956004: Fix vm code base so that it can be built for --arch=simarm (no snapshot yet). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/isolate.cc ('k') | runtime/vm/locations.cc » ('j') | 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 17245)
+++ runtime/vm/locations.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -63,15 +63,22 @@
// register code.
kRegister = 6,
- // XmmRegister location represents a fixed xmm register. Payload contains
+ // FpuRegister location represents a fixed fpu register. Payload contains
// its code.
- kXmmRegister = 7,
+ kFpuRegister = 7,
};
Location() : value_(kInvalidLocation) {
ASSERT(IsInvalid());
}
+ Location(const Location& other) : ValueObject(), value_(other.value_) { }
+
+ Location& operator=(const Location& other) {
+ value_ = other.value_;
+ return *this;
+ }
+
bool IsInvalid() const {
return value_ == kInvalidLocation;
}
@@ -98,7 +105,7 @@
kAny,
kPrefersRegister,
kRequiresRegister,
- kRequiresXmmRegister,
+ kRequiresFpuRegister,
kWritableRegister,
kSameAsFirstInput,
};
@@ -128,8 +135,8 @@
return UnallocatedLocation(kRequiresRegister);
}
- static Location RequiresXmmRegister() {
- return UnallocatedLocation(kRequiresXmmRegister);
+ static Location RequiresFpuRegister() {
+ return UnallocatedLocation(kRequiresFpuRegister);
}
static Location WritableRegister() {
@@ -169,7 +176,7 @@
return RegisterField::decode(payload());
}
- // XMM registers and double spill slots can contain either doubles
+ // FPU registers and double spill slots can contain either doubles
// or 64-bit integers.
enum Representation {
kDouble,
@@ -177,24 +184,24 @@
};
Representation representation() const {
- ASSERT(IsXmmRegister() || IsDoubleStackSlot());
+ ASSERT(IsFpuRegister() || IsDoubleStackSlot());
return RepresentationField::decode(payload());
}
- // XmmRegister locations.
- static Location XmmRegisterLocation(XmmRegister reg, Representation rep) {
+ // FpuRegister locations.
+ static Location FpuRegisterLocation(FpuRegister reg, Representation rep) {
uword payload =
- XmmRegisterField::encode(reg) | RepresentationField::encode(rep);
- return Location(kXmmRegister, payload);
+ FpuRegisterField::encode(reg) | RepresentationField::encode(rep);
+ return Location(kFpuRegister, payload);
}
- bool IsXmmRegister() const {
- return kind() == kXmmRegister;
+ bool IsFpuRegister() const {
+ return kind() == kFpuRegister;
}
- XmmRegister xmm_reg() const {
- ASSERT(IsXmmRegister());
- return XmmRegisterField::decode(payload());
+ FpuRegister fpu_reg() const {
+ ASSERT(IsFpuRegister());
+ return FpuRegisterField::decode(payload());
}
static bool IsMachineRegisterKind(Kind kind) {
@@ -207,8 +214,8 @@
if (kind == kRegister) {
return RegisterLocation(static_cast<Register>(reg));
} else {
- ASSERT(kind == kXmmRegister);
- return XmmRegisterLocation(static_cast<XmmRegister>(reg), rep);
+ ASSERT(kind == kFpuRegister);
+ return FpuRegisterLocation(static_cast<FpuRegister>(reg), rep);
}
}
@@ -304,7 +311,7 @@
typedef BitField<Policy, 0, 3> PolicyField;
// Layout for register locations payload. The representation bit is only used
- // for XmmRegister and unused for Register.
+ // for FpuRegister and unused for Register.
static const intptr_t kBitsForRepresentation = 1;
static const intptr_t kBitsForRegister =
kBitsForPayload - kBitsForRepresentation;
@@ -314,9 +321,9 @@
typedef BitField<Register,
kBitsForRepresentation,
kBitsForRegister> RegisterField;
- typedef BitField<XmmRegister,
+ typedef BitField<FpuRegister,
kBitsForRepresentation,
- kBitsForRegister> XmmRegisterField;
+ kBitsForRegister> FpuRegisterField;
// Layout for stack slots. The representation bit is only used for
// DoubleStackSlot and unused for StackSlot.
@@ -337,25 +344,25 @@
class RegisterSet : public ValueObject {
public:
- RegisterSet() : cpu_registers_(0), xmm_registers_(0) {
+ RegisterSet() : cpu_registers_(0), fpu_registers_(0) {
ASSERT(kNumberOfCpuRegisters < (kWordSize * kBitsPerByte));
- ASSERT(kNumberOfXmmRegisters < (kWordSize * kBitsPerByte));
+ ASSERT(kNumberOfFpuRegisters < (kWordSize * kBitsPerByte));
}
void Add(Location loc) {
if (loc.IsRegister()) {
cpu_registers_ |= (1 << loc.reg());
- } else if (loc.IsXmmRegister()) {
- xmm_registers_ |= (1 << loc.xmm_reg());
+ } else if (loc.IsFpuRegister()) {
+ fpu_registers_ |= (1 << loc.fpu_reg());
}
}
void Remove(Location loc) {
if (loc.IsRegister()) {
cpu_registers_ &= ~(1 << loc.reg());
- } else if (loc.IsXmmRegister()) {
- xmm_registers_ &= ~(1 << loc.xmm_reg());
+ } else if (loc.IsFpuRegister()) {
+ fpu_registers_ &= ~(1 << loc.fpu_reg());
}
}
@@ -363,14 +370,14 @@
return (cpu_registers_ & (1 << reg)) != 0;
}
- bool ContainsXmmRegister(XmmRegister xmm_reg) {
- return (xmm_registers_ & (1 << xmm_reg)) != 0;
+ bool ContainsFpuRegister(FpuRegister fpu_reg) {
+ return (fpu_registers_ & (1 << fpu_reg)) != 0;
}
- intptr_t xmm_regs_count() {
+ intptr_t fpu_regs_count() {
intptr_t count = 0;
- for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; reg_idx++) {
- if (ContainsXmmRegister(static_cast<XmmRegister>(reg_idx))) {
+ for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; reg_idx++) {
+ if (ContainsFpuRegister(static_cast<FpuRegister>(reg_idx))) {
count++;
}
}
@@ -379,7 +386,7 @@
private:
intptr_t cpu_registers_;
- intptr_t xmm_registers_;
+ intptr_t fpu_registers_;
DISALLOW_COPY_AND_ASSIGN(RegisterSet);
};
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/locations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698