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_ARM_H_ | 6 #ifndef VM_INSTRUCTIONS_ARM_H_ |
7 #define VM_INSTRUCTIONS_ARM_H_ | 7 #define VM_INSTRUCTIONS_ARM_H_ |
8 | 8 |
9 #ifndef VM_INSTRUCTIONS_H_ | 9 #ifndef VM_INSTRUCTIONS_H_ |
10 #error Do not include instructions_arm.h directly; use instructions.h instead. | 10 #error Do not include instructions_arm.h directly; use instructions.h instead. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 CallPattern(uword pc, const Code& code); | 52 CallPattern(uword pc, const Code& code); |
53 | 53 |
54 RawICData* IcData(); | 54 RawICData* IcData(); |
55 RawArray* ClosureArgumentsDescriptor(); | 55 RawArray* ClosureArgumentsDescriptor(); |
56 | 56 |
57 uword TargetAddress() const; | 57 uword TargetAddress() const; |
58 void SetTargetAddress(uword target_address) const; | 58 void SetTargetAddress(uword target_address) const; |
59 | 59 |
60 // This constant length is only valid for inserted call patterns used for | 60 // This constant length is only valid for inserted call patterns used for |
61 // lazy deoptimization. Regular call pattern may vary in length. | 61 // lazy deoptimization. Regular call pattern may vary in length. |
62 static const int kFixedLengthInBytes = 3 * Instr::kInstrSize; | 62 static int LengthInBytes(); |
63 | 63 |
64 static void InsertAt(uword pc, uword target_address); | 64 static void InsertAt(uword pc, uword target_address); |
65 | 65 |
66 private: | 66 private: |
67 const Array& object_pool_; | 67 const Array& object_pool_; |
68 | 68 |
69 uword end_; | 69 uword end_; |
70 uword args_desc_load_end_; | 70 uword args_desc_load_end_; |
71 uword ic_data_load_end_; | 71 uword ic_data_load_end_; |
72 | 72 |
73 intptr_t target_address_pool_index_; | 73 intptr_t target_address_pool_index_; |
74 Array& args_desc_; | 74 Array& args_desc_; |
75 ICData& ic_data_; | 75 ICData& ic_data_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(CallPattern); | 77 DISALLOW_COPY_AND_ASSIGN(CallPattern); |
78 }; | 78 }; |
79 | 79 |
80 | 80 |
81 class JumpPattern : public ValueObject { | 81 class JumpPattern : public ValueObject { |
82 public: | 82 public: |
83 JumpPattern(uword pc, const Code& code); | 83 JumpPattern(uword pc, const Code& code); |
84 | 84 |
85 static const int kLengthInBytes = 3 * Instr::kInstrSize; | 85 static const int kLengthInBytes = 3 * Instr::kInstrSize; |
86 | 86 |
87 int pattern_length_in_bytes() const { | 87 static int pattern_length_in_bytes(); |
88 return kLengthInBytes; | |
89 } | |
90 | 88 |
91 bool IsValid() const; | 89 bool IsValid() const; |
92 uword TargetAddress() const; | 90 uword TargetAddress() const; |
93 void SetTargetAddress(uword target_address) const; | 91 void SetTargetAddress(uword target_address) const; |
94 | 92 |
95 private: | 93 private: |
96 const uword pc_; | 94 const uword pc_; |
97 | 95 |
98 DISALLOW_COPY_AND_ASSIGN(JumpPattern); | 96 DISALLOW_COPY_AND_ASSIGN(JumpPattern); |
99 }; | 97 }; |
100 | 98 |
101 } // namespace dart | 99 } // namespace dart |
102 | 100 |
103 #endif // VM_INSTRUCTIONS_ARM_H_ | 101 #endif // VM_INSTRUCTIONS_ARM_H_ |
OLD | NEW |