| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Classes that describe assembly patterns as used by inline caches. | 4 // Classes that describe assembly patterns as used by inline caches. |
| 5 | 5 |
| 6 #ifndef VM_INSTRUCTIONS_X64_H_ | 6 #ifndef VM_INSTRUCTIONS_X64_H_ |
| 7 #define VM_INSTRUCTIONS_X64_H_ | 7 #define VM_INSTRUCTIONS_X64_H_ |
| 8 | 8 |
| 9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
| 10 #error Do not include instructions_ia32.h directly; use instructions.h instead. | 10 #error Do not include instructions_ia32.h directly; use instructions.h instead. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const uword start_; | 53 const uword start_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(InstructionPattern); | 55 DISALLOW_COPY_AND_ASSIGN(InstructionPattern); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 | 58 |
| 59 class JumpPattern : public InstructionPattern { | 59 class JumpPattern : public InstructionPattern { |
| 60 public: | 60 public: |
| 61 JumpPattern(uword pc, const Code& code) | 61 JumpPattern(uword pc, const Code& code) |
| 62 : InstructionPattern(pc), | 62 : InstructionPattern(pc), |
| 63 object_pool_(Array::Handle(code.ObjectPool())) {} | 63 object_pool_(ObjectPool::Handle(code.GetObjectPool())) {} |
| 64 static int InstructionLength() { | 64 static int InstructionLength() { |
| 65 return kLengthInBytes; | 65 return kLengthInBytes; |
| 66 } | 66 } |
| 67 uword TargetAddress() const; | 67 uword TargetAddress() const; |
| 68 void SetTargetAddress(uword new_target) const; | 68 void SetTargetAddress(uword new_target) const; |
| 69 virtual int pattern_length_in_bytes() const { | 69 virtual int pattern_length_in_bytes() const { |
| 70 return kLengthInBytes; | 70 return kLengthInBytes; |
| 71 } | 71 } |
| 72 | 72 |
| 73 static const int kLengthInBytes = 7; | 73 static const int kLengthInBytes = 7; |
| 74 private: | 74 private: |
| 75 virtual const int* pattern() const; | 75 virtual const int* pattern() const; |
| 76 const Array& object_pool_; | 76 const ObjectPool& object_pool_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(JumpPattern); | 78 DISALLOW_COPY_AND_ASSIGN(JumpPattern); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 | 81 |
| 82 // 5 byte call instruction. | 82 // 5 byte call instruction. |
| 83 class ShortCallPattern : public InstructionPattern { | 83 class ShortCallPattern : public InstructionPattern { |
| 84 public: | 84 public: |
| 85 explicit ShortCallPattern(uword pc) : InstructionPattern(pc) {} | 85 explicit ShortCallPattern(uword pc) : InstructionPattern(pc) {} |
| 86 static int InstructionLength() { | 86 static int InstructionLength() { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 virtual const int* pattern() const; | 135 virtual const int* pattern() const; |
| 136 virtual int pattern_length_in_bytes() const { return kLengthInBytes; } | 136 virtual int pattern_length_in_bytes() const { return kLengthInBytes; } |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 static const int kLengthInBytes = 3; | 139 static const int kLengthInBytes = 3; |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace dart | 142 } // namespace dart |
| 143 | 143 |
| 144 #endif // VM_INSTRUCTIONS_X64_H_ | 144 #endif // VM_INSTRUCTIONS_X64_H_ |
| OLD | NEW |