OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 RUNTIME_VM_ASSEMBLER_ARM64_H_ | 5 #ifndef RUNTIME_VM_ASSEMBLER_ARM64_H_ |
6 #define RUNTIME_VM_ASSEMBLER_ARM64_H_ | 6 #define RUNTIME_VM_ASSEMBLER_ARM64_H_ |
7 | 7 |
8 #ifndef RUNTIME_VM_ASSEMBLER_H_ | 8 #ifndef RUNTIME_VM_ASSEMBLER_H_ |
9 #error Do not include assembler_arm64.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm64.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 private: | 36 private: |
37 int64_t value_; | 37 int64_t value_; |
38 | 38 |
39 int64_t value() const { return value_; } | 39 int64_t value() const { return value_; } |
40 | 40 |
41 friend class Assembler; | 41 friend class Assembler; |
42 }; | 42 }; |
43 | 43 |
44 | |
45 class Label : public ValueObject { | 44 class Label : public ValueObject { |
46 public: | 45 public: |
47 Label() : position_(0) {} | 46 Label() : position_(0) {} |
48 | 47 |
49 ~Label() { | 48 ~Label() { |
50 // Assert if label is being destroyed with unresolved branches pending. | 49 // Assert if label is being destroyed with unresolved branches pending. |
51 ASSERT(!IsLinked()); | 50 ASSERT(!IsLinked()); |
52 } | 51 } |
53 | 52 |
54 // Returns the position for bound and linked labels. Cannot be used | 53 // Returns the position for bound and linked labels. Cannot be used |
(...skipping 21 matching lines...) Expand all Loading... |
76 void LinkTo(intptr_t position) { | 75 void LinkTo(intptr_t position) { |
77 ASSERT(!IsBound()); | 76 ASSERT(!IsBound()); |
78 position_ = position + kWordSize; | 77 position_ = position + kWordSize; |
79 ASSERT(IsLinked()); | 78 ASSERT(IsLinked()); |
80 } | 79 } |
81 | 80 |
82 friend class Assembler; | 81 friend class Assembler; |
83 DISALLOW_COPY_AND_ASSIGN(Label); | 82 DISALLOW_COPY_AND_ASSIGN(Label); |
84 }; | 83 }; |
85 | 84 |
86 | |
87 class Address : public ValueObject { | 85 class Address : public ValueObject { |
88 public: | 86 public: |
89 Address(const Address& other) | 87 Address(const Address& other) |
90 : ValueObject(), | 88 : ValueObject(), |
91 encoding_(other.encoding_), | 89 encoding_(other.encoding_), |
92 type_(other.type_), | 90 type_(other.type_), |
93 base_(other.base_) {} | 91 base_(other.base_) {} |
94 | 92 |
95 Address& operator=(const Address& other) { | 93 Address& operator=(const Address& other) { |
96 encoding_ = other.encoding_; | 94 encoding_ = other.encoding_; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 290 |
293 Address() : encoding_(0), type_(Unknown), base_(kNoRegister) {} | 291 Address() : encoding_(0), type_(Unknown), base_(kNoRegister) {} |
294 | 292 |
295 uint32_t encoding_; | 293 uint32_t encoding_; |
296 AddressType type_; | 294 AddressType type_; |
297 Register base_; | 295 Register base_; |
298 | 296 |
299 friend class Assembler; | 297 friend class Assembler; |
300 }; | 298 }; |
301 | 299 |
302 | |
303 class FieldAddress : public Address { | 300 class FieldAddress : public Address { |
304 public: | 301 public: |
305 FieldAddress(Register base, int32_t disp, OperandSize sz = kDoubleWord) | 302 FieldAddress(Register base, int32_t disp, OperandSize sz = kDoubleWord) |
306 : Address(base, disp - kHeapObjectTag, Offset, sz) {} | 303 : Address(base, disp - kHeapObjectTag, Offset, sz) {} |
307 | 304 |
308 // This addressing mode does not exist. | 305 // This addressing mode does not exist. |
309 FieldAddress(Register base, Register disp, OperandSize sz = kDoubleWord); | 306 FieldAddress(Register base, Register disp, OperandSize sz = kDoubleWord); |
310 | 307 |
311 FieldAddress(const FieldAddress& other) : Address(other) {} | 308 FieldAddress(const FieldAddress& other) : Address(other) {} |
312 | 309 |
313 FieldAddress& operator=(const FieldAddress& other) { | 310 FieldAddress& operator=(const FieldAddress& other) { |
314 Address::operator=(other); | 311 Address::operator=(other); |
315 return *this; | 312 return *this; |
316 } | 313 } |
317 }; | 314 }; |
318 | 315 |
319 | |
320 class Operand : public ValueObject { | 316 class Operand : public ValueObject { |
321 public: | 317 public: |
322 enum OperandType { | 318 enum OperandType { |
323 Shifted, | 319 Shifted, |
324 Extended, | 320 Extended, |
325 Immediate, | 321 Immediate, |
326 BitfieldImm, | 322 BitfieldImm, |
327 Unknown, | 323 Unknown, |
328 }; | 324 }; |
329 | 325 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 private: | 427 private: |
432 uint32_t encoding() const { return encoding_; } | 428 uint32_t encoding() const { return encoding_; } |
433 OperandType type() const { return type_; } | 429 OperandType type() const { return type_; } |
434 | 430 |
435 uint32_t encoding_; | 431 uint32_t encoding_; |
436 OperandType type_; | 432 OperandType type_; |
437 | 433 |
438 friend class Assembler; | 434 friend class Assembler; |
439 }; | 435 }; |
440 | 436 |
441 | |
442 class Assembler : public ValueObject { | 437 class Assembler : public ValueObject { |
443 public: | 438 public: |
444 explicit Assembler(bool use_far_branches = false); | 439 explicit Assembler(bool use_far_branches = false); |
445 ~Assembler() {} | 440 ~Assembler() {} |
446 | 441 |
447 void PopRegister(Register r) { Pop(r); } | 442 void PopRegister(Register r) { Pop(r); } |
448 | 443 |
449 void Drop(intptr_t stack_elements) { | 444 void Drop(intptr_t stack_elements) { |
450 add(SP, SP, Operand(stack_elements * kWordSize)); | 445 add(SP, SP, Operand(stack_elements * kWordSize)); |
451 } | 446 } |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1937 Register value, | 1932 Register value, |
1938 Label* no_update); | 1933 Label* no_update); |
1939 | 1934 |
1940 DISALLOW_ALLOCATION(); | 1935 DISALLOW_ALLOCATION(); |
1941 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1936 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1942 }; | 1937 }; |
1943 | 1938 |
1944 } // namespace dart | 1939 } // namespace dart |
1945 | 1940 |
1946 #endif // RUNTIME_VM_ASSEMBLER_ARM64_H_ | 1941 #endif // RUNTIME_VM_ASSEMBLER_ARM64_H_ |
OLD | NEW |