OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ASSEMBLER_ARM_H_ | 5 #ifndef VM_ASSEMBLER_ARM_H_ |
6 #define VM_ASSEMBLER_ARM_H_ | 6 #define VM_ASSEMBLER_ARM_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_arm.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
11 | 11 |
12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
13 #include "vm/constants_arm.h" | 13 #include "vm/constants_arm.h" |
14 | 14 |
15 namespace dart { | 15 namespace dart { |
16 | 16 |
17 class Operand { | |
18 public: | |
19 Operand(const Operand& other) { | |
20 UNIMPLEMENTED(); | |
21 } | |
22 | |
23 Operand& operator=(const Operand& other) { | |
24 UNIMPLEMENTED(); | |
25 return *this; | |
26 } | |
27 | |
28 protected: | |
29 Operand() { } // Needed by subclass Address. | |
srdjan
2013/01/16 23:57:56
DISALLOW_ALLOCATION ?
regis
2013/01/17 01:02:09
Done.
| |
30 }; | |
31 | |
32 | |
33 class Address : public Operand { | |
34 public: | |
35 Address(Register base, int32_t disp) { | |
36 UNIMPLEMENTED(); | |
37 } | |
38 | |
39 Address(const Address& other) : Operand(other) { } | |
40 | |
41 Address& operator=(const Address& other) { | |
42 Operand::operator=(other); | |
43 return *this; | |
44 } | |
45 }; | |
46 | |
47 | |
48 class FieldAddress : public Address { | |
49 public: | |
50 FieldAddress(Register base, int32_t disp) | |
51 : Address(base, disp - kHeapObjectTag) { } | |
52 | |
53 FieldAddress(const FieldAddress& other) : Address(other) { } | |
54 | |
55 FieldAddress& operator=(const FieldAddress& other) { | |
56 Address::operator=(other); | |
57 return *this; | |
58 } | |
59 }; | |
60 | |
61 | |
17 class Label : public ValueObject { | 62 class Label : public ValueObject { |
18 public: | 63 public: |
19 Label() : position_(0) { } | 64 Label() : position_(0) { } |
20 | 65 |
21 ~Label() { | 66 ~Label() { |
22 // Assert if label is being destroyed with unresolved branches pending. | 67 // Assert if label is being destroyed with unresolved branches pending. |
23 ASSERT(!IsLinked()); | 68 ASSERT(!IsLinked()); |
24 } | 69 } |
25 | 70 |
26 // Returns the position for bound and linked labels. Cannot be used | 71 // Returns the position for bound and linked labels. Cannot be used |
(...skipping 24 matching lines...) Expand all Loading... | |
51 ASSERT(!IsBound()); | 96 ASSERT(!IsBound()); |
52 position_ = position + kWordSize; | 97 position_ = position + kWordSize; |
53 ASSERT(IsLinked()); | 98 ASSERT(IsLinked()); |
54 } | 99 } |
55 | 100 |
56 friend class Assembler; | 101 friend class Assembler; |
57 DISALLOW_COPY_AND_ASSIGN(Label); | 102 DISALLOW_COPY_AND_ASSIGN(Label); |
58 }; | 103 }; |
59 | 104 |
60 | 105 |
61 class Assembler { | 106 class CPUFeatures : public AllStatic { |
62 public: | 107 public: |
63 Assembler() { } | 108 static void InitOnce() { } |
109 }; | |
110 | |
111 | |
112 class Assembler : public ValueObject { | |
113 public: | |
114 Assembler() { UNIMPLEMENTED(); } | |
64 ~Assembler() { } | 115 ~Assembler() { } |
65 | 116 |
66 // Macros for High-level operations. | 117 void PopRegister(Register r) { |
67 void AddConstant(Register reg, int value, Condition cond = AL) { | 118 UNIMPLEMENTED(); |
119 } | |
120 | |
121 void Bind(Label* label) { | |
68 UNIMPLEMENTED(); | 122 UNIMPLEMENTED(); |
69 } | 123 } |
70 | 124 |
71 // Misc. functionality | 125 // Misc. functionality |
72 int CodeSize() const { | 126 int CodeSize() const { |
73 UNIMPLEMENTED(); | 127 UNIMPLEMENTED(); |
74 return 0; | 128 return 0; |
75 } | 129 } |
76 int prologue_offset() const { | 130 int prologue_offset() const { |
77 UNIMPLEMENTED(); | 131 UNIMPLEMENTED(); |
(...skipping 10 matching lines...) Expand all Loading... | |
88 // Debugging and bringup support. | 142 // Debugging and bringup support. |
89 void Stop(const char* message) { UNIMPLEMENTED(); } | 143 void Stop(const char* message) { UNIMPLEMENTED(); } |
90 void Unimplemented(const char* message); | 144 void Unimplemented(const char* message); |
91 void Untested(const char* message); | 145 void Untested(const char* message); |
92 void Unreachable(const char* message); | 146 void Unreachable(const char* message); |
93 | 147 |
94 static void InitializeMemoryWithBreakpoints(uword data, int length) { | 148 static void InitializeMemoryWithBreakpoints(uword data, int length) { |
95 UNIMPLEMENTED(); | 149 UNIMPLEMENTED(); |
96 } | 150 } |
97 | 151 |
152 void Comment(const char* format, ...) PRINTF_ATTRIBUTE(2, 3) { | |
153 UNIMPLEMENTED(); | |
154 } | |
155 | |
156 const Code::Comments& GetCodeComments() const { | |
157 UNIMPLEMENTED(); | |
158 return Code::Comments::New(0); | |
159 } | |
160 | |
161 static const char* RegisterName(Register reg) { | |
162 UNIMPLEMENTED(); | |
163 return NULL; | |
164 } | |
165 | |
166 static const char* FpuRegisterName(FpuRegister reg) { | |
167 UNIMPLEMENTED(); | |
168 return NULL; | |
169 } | |
170 | |
98 private: | 171 private: |
99 ZoneGrowableArray<int>* pointer_offsets_; | 172 ZoneGrowableArray<int>* pointer_offsets_; |
100 DISALLOW_ALLOCATION(); | 173 DISALLOW_ALLOCATION(); |
101 DISALLOW_COPY_AND_ASSIGN(Assembler); | 174 DISALLOW_COPY_AND_ASSIGN(Assembler); |
102 }; | 175 }; |
103 | 176 |
104 } // namespace dart | 177 } // namespace dart |
105 | 178 |
106 #endif // VM_ASSEMBLER_ARM_H_ | 179 #endif // VM_ASSEMBLER_ARM_H_ |
OLD | NEW |