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/assembler_x64.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
Index: runtime/vm/assembler_x64.h
===================================================================
--- runtime/vm/assembler_x64.h (revision 17160)
+++ runtime/vm/assembler_x64.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.
@@ -31,13 +31,11 @@
private:
const int64_t value_;
-
- // TODO(5411081): Add DISALLOW_COPY_AND_ASSIGN(Immediate) once the mac
- // build issue is resolved.
+ DISALLOW_COPY_AND_ASSIGN(Immediate);
};
-class Operand : public ValueObject {
+class Operand {
public:
uint8_t rex() const {
return rex_;
@@ -76,8 +74,19 @@
return bit_copy<int32_t>(encoding_[length_ - 4]);
}
+ Operand(const Operand& other) : length_(other.length_), rex_(other.rex_) {
+ memmove(&encoding_[0], &other.encoding_[0], other.length_);
+ }
+
+ Operand& operator=(const Operand& other) {
+ length_ = other.length_;
+ rex_ = other.rex_;
+ memmove(&encoding_[0], &other.encoding_[0], other.length_);
+ return *this;
+ }
+
protected:
- Operand() : length_(0), rex_(REX_NONE) { }
+ Operand() : length_(0), rex_(REX_NONE) { } // Needed by subclass Address.
void SetModRM(int mod, Register rm) {
ASSERT((mod & ~3) == 0);
@@ -132,11 +141,7 @@
&& ((encoding_at(0) & 0x07) == reg); // Register codes match.
}
-
friend class Assembler;
-
- // TODO(5411081): Add DISALLOW_COPY_AND_ASSIGN(Operand) once the mac
- // build issue is resolved.
};
@@ -186,20 +191,29 @@
}
}
- private:
- Address() {}
+ Address(const Address& other) : Operand(other) { }
- // TODO(5411081): Add DISALLOW_COPY_AND_ASSIGN(Address) once the mac
- // build issue is resolved.
+ Address& operator=(const Address& other) {
+ Operand::operator=(other);
+ return *this;
+ }
};
class FieldAddress : public Address {
public:
FieldAddress(Register base, int32_t disp)
- : Address(base, disp - kHeapObjectTag) {}
+ : Address(base, disp - kHeapObjectTag) { }
+
FieldAddress(Register base, Register index, ScaleFactor scale, int32_t disp)
- : Address(base, index, scale, disp - kHeapObjectTag) {}
+ : Address(base, index, scale, disp - kHeapObjectTag) { }
+
+ FieldAddress(const FieldAddress& other) : Address(other) { }
+
+ FieldAddress& operator=(const FieldAddress& other) {
+ Address::operator=(other);
+ return *this;
+ }
};
@@ -656,7 +670,7 @@
static const char* RegisterName(Register reg);
- static const char* XmmRegisterName(XmmRegister reg);
+ static const char* FpuRegisterName(FpuRegister reg);
private:
AssemblerBuffer buffer_;

Powered by Google App Engine
This is Rietveld 408576698