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 | 4 |
5 #ifndef VM_ASSEMBLER_MIPS_H_ | 5 #ifndef VM_ASSEMBLER_MIPS_H_ |
6 #define VM_ASSEMBLER_MIPS_H_ | 6 #define VM_ASSEMBLER_MIPS_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_mips.h directly; use assembler.h instead. | 9 #error Do not include assembler_mips.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 public: | 138 public: |
139 static void InitOnce() { } | 139 static void InitOnce() { } |
140 static bool double_truncate_round_supported() { | 140 static bool double_truncate_round_supported() { |
141 return false; | 141 return false; |
142 } | 142 } |
143 }; | 143 }; |
144 | 144 |
145 | 145 |
146 class Assembler : public ValueObject { | 146 class Assembler : public ValueObject { |
147 public: | 147 public: |
148 Assembler() | 148 explicit Assembler(bool use_far_branches = false) |
149 : buffer_(), | 149 : buffer_(), |
150 object_pool_(GrowableObjectArray::Handle()), | 150 object_pool_(GrowableObjectArray::Handle()), |
151 prologue_offset_(-1), | 151 prologue_offset_(-1), |
| 152 use_far_branches_(use_far_branches), |
152 delay_slot_available_(false), | 153 delay_slot_available_(false), |
153 in_delay_slot_(false), | 154 in_delay_slot_(false), |
154 comments_() { } | 155 comments_() { } |
155 ~Assembler() { } | 156 ~Assembler() { } |
156 | 157 |
157 void PopRegister(Register r) { Pop(r); } | 158 void PopRegister(Register r) { Pop(r); } |
158 | 159 |
159 void Bind(Label* label); | 160 void Bind(Label* label); |
160 | 161 |
161 // Misc. functionality | 162 // Misc. functionality |
162 int CodeSize() const { return buffer_.Size(); } | 163 int CodeSize() const { return buffer_.Size(); } |
163 int prologue_offset() const { return prologue_offset_; } | 164 int prologue_offset() const { return prologue_offset_; } |
164 const ZoneGrowableArray<int>& GetPointerOffsets() const { | 165 const ZoneGrowableArray<int>& GetPointerOffsets() const { |
165 return buffer_.pointer_offsets(); | 166 return buffer_.pointer_offsets(); |
166 } | 167 } |
167 const GrowableObjectArray& object_pool() const { return object_pool_; } | 168 const GrowableObjectArray& object_pool() const { return object_pool_; } |
168 void FinalizeInstructions(const MemoryRegion& region) { | 169 void FinalizeInstructions(const MemoryRegion& region) { |
169 buffer_.FinalizeInstructions(region); | 170 buffer_.FinalizeInstructions(region); |
170 } | 171 } |
171 | 172 |
| 173 bool use_far_branches() const { return use_far_branches_; } |
| 174 |
172 // Set up a stub frame so that the stack traversal code can easily identify | 175 // Set up a stub frame so that the stack traversal code can easily identify |
173 // a stub frame. | 176 // a stub frame. |
174 void EnterStubFrame(bool uses_pp = false); | 177 void EnterStubFrame(bool uses_pp = false); |
175 void LeaveStubFrame(bool uses_pp = false); | 178 void LeaveStubFrame(bool uses_pp = false); |
176 // A separate macro for when a Ret immediately follows, so that we can use | 179 // A separate macro for when a Ret immediately follows, so that we can use |
177 // the branch delay slot. | 180 // the branch delay slot. |
178 void LeaveStubFrameAndReturn(Register ra = RA, bool uses_pp = false); | 181 void LeaveStubFrameAndReturn(Register ra = RA, bool uses_pp = false); |
179 | 182 |
180 // Instruction pattern from entrypoint is used in dart frame prologs | 183 // Instruction pattern from entrypoint is used in dart frame prologs |
181 // to set up the frame and save a PC which can be used to figure out the | 184 // to set up the frame and save a PC which can be used to figure out the |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1087 // Set up a Dart frame for a function compiled for on-stack replacement. | 1090 // Set up a Dart frame for a function compiled for on-stack replacement. |
1088 // The frame layout is a normal Dart frame, but the frame is partially set | 1091 // The frame layout is a normal Dart frame, but the frame is partially set |
1089 // up on entry (it is the frame of the unoptimized code). | 1092 // up on entry (it is the frame of the unoptimized code). |
1090 void EnterOsrFrame(intptr_t extra_size); | 1093 void EnterOsrFrame(intptr_t extra_size); |
1091 | 1094 |
1092 private: | 1095 private: |
1093 AssemblerBuffer buffer_; | 1096 AssemblerBuffer buffer_; |
1094 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. | 1097 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. |
1095 int prologue_offset_; | 1098 int prologue_offset_; |
1096 | 1099 |
| 1100 bool use_far_branches_; |
1097 bool delay_slot_available_; | 1101 bool delay_slot_available_; |
1098 bool in_delay_slot_; | 1102 bool in_delay_slot_; |
1099 | 1103 |
1100 int32_t AddObject(const Object& obj); | 1104 int32_t AddObject(const Object& obj); |
1101 int32_t AddExternalLabel(const ExternalLabel* label); | 1105 int32_t AddExternalLabel(const ExternalLabel* label); |
1102 | 1106 |
1103 class CodeComment : public ZoneAllocated { | 1107 class CodeComment : public ZoneAllocated { |
1104 public: | 1108 public: |
1105 CodeComment(intptr_t pc_offset, const String& comment) | 1109 CodeComment(intptr_t pc_offset, const String& comment) |
1106 : pc_offset_(pc_offset), comment_(comment) { } | 1110 : pc_offset_(pc_offset), comment_(comment) { } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 Register value, | 1219 Register value, |
1216 Label* no_update); | 1220 Label* no_update); |
1217 | 1221 |
1218 DISALLOW_ALLOCATION(); | 1222 DISALLOW_ALLOCATION(); |
1219 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1223 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1220 }; | 1224 }; |
1221 | 1225 |
1222 } // namespace dart | 1226 } // namespace dart |
1223 | 1227 |
1224 #endif // VM_ASSEMBLER_MIPS_H_ | 1228 #endif // VM_ASSEMBLER_MIPS_H_ |
OLD | NEW |