OLD | NEW |
1 // Copyright (c) 2013, 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 // 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_MIPS_H_ | 6 #ifndef VM_INSTRUCTIONS_MIPS_H_ |
7 #define VM_INSTRUCTIONS_MIPS_H_ | 7 #define VM_INSTRUCTIONS_MIPS_H_ |
8 | 8 |
9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
10 #error Do not include instructions_mips.h directly; use instructions.h instead. | 10 #error Do not include instructions_mips.h directly; use instructions.h instead. |
(...skipping 28 matching lines...) Expand all Loading... |
39 const Array& object_pool_; | 39 const Array& object_pool_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 41 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
42 }; | 42 }; |
43 | 43 |
44 | 44 |
45 class JumpPattern : public ValueObject { | 45 class JumpPattern : public ValueObject { |
46 public: | 46 public: |
47 explicit JumpPattern(uword pc); | 47 explicit JumpPattern(uword pc); |
48 | 48 |
49 static const int kLengthInBytes = 3*Instr::kInstrSize; | 49 // lui; ori; jr; nop (in delay slot) = 4. |
| 50 static const int kLengthInBytes = 4*Instr::kInstrSize; |
50 | 51 |
51 int pattern_length_in_bytes() const { | 52 int pattern_length_in_bytes() const { |
52 return kLengthInBytes; | 53 return kLengthInBytes; |
53 } | 54 } |
54 | 55 |
55 bool IsValid() const; | 56 bool IsValid() const; |
56 uword TargetAddress() const; | 57 uword TargetAddress() const; |
57 void SetTargetAddress(uword target_address) const; | 58 void SetTargetAddress(uword target_address) const; |
58 | 59 |
59 private: | 60 private: |
60 const uword pc_; | 61 const uword pc_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(JumpPattern); | 63 DISALLOW_COPY_AND_ASSIGN(JumpPattern); |
63 }; | 64 }; |
64 | 65 |
65 } // namespace dart | 66 } // namespace dart |
66 | 67 |
67 #endif // VM_INSTRUCTIONS_MIPS_H_ | 68 #endif // VM_INSTRUCTIONS_MIPS_H_ |
68 | 69 |
OLD | NEW |