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 RUNTIME_VM_ASSEMBLER_ARM_H_ | 5 #ifndef RUNTIME_VM_ASSEMBLER_ARM_H_ |
6 #define RUNTIME_VM_ASSEMBLER_ARM_H_ | 6 #define RUNTIME_VM_ASSEMBLER_ARM_H_ |
7 | 7 |
8 #ifndef RUNTIME_VM_ASSEMBLER_H_ | 8 #ifndef RUNTIME_VM_ASSEMBLER_H_ |
9 #error Do not include assembler_arm.h directly; use assembler.h instead. | 9 #error Do not include assembler_arm.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 return *this; | 359 return *this; |
360 } | 360 } |
361 }; | 361 }; |
362 | 362 |
363 | 363 |
364 class Assembler : public ValueObject { | 364 class Assembler : public ValueObject { |
365 public: | 365 public: |
366 explicit Assembler(bool use_far_branches = false) | 366 explicit Assembler(bool use_far_branches = false) |
367 : buffer_(), | 367 : buffer_(), |
368 prologue_offset_(-1), | 368 prologue_offset_(-1), |
| 369 has_single_entry_point_(true), |
369 use_far_branches_(use_far_branches), | 370 use_far_branches_(use_far_branches), |
370 comments_(), | 371 comments_(), |
371 constant_pool_allowed_(false) { | 372 constant_pool_allowed_(false) { |
372 MonomorphicCheckedEntry(); | |
373 } | 373 } |
374 | 374 |
375 ~Assembler() { } | 375 ~Assembler() { } |
376 | 376 |
377 void PopRegister(Register r) { Pop(r); } | 377 void PopRegister(Register r) { Pop(r); } |
378 | 378 |
379 void Bind(Label* label); | 379 void Bind(Label* label); |
380 void Jump(Label* label) { b(label); } | 380 void Jump(Label* label) { b(label); } |
381 | 381 |
382 // Misc. functionality | 382 // Misc. functionality |
383 intptr_t CodeSize() const { return buffer_.Size(); } | 383 intptr_t CodeSize() const { return buffer_.Size(); } |
384 intptr_t prologue_offset() const { return prologue_offset_; } | 384 intptr_t prologue_offset() const { return prologue_offset_; } |
| 385 bool has_single_entry_point() const { return has_single_entry_point_; } |
385 | 386 |
386 // Count the fixups that produce a pointer offset, without processing | 387 // Count the fixups that produce a pointer offset, without processing |
387 // the fixups. On ARM there are no pointers in code. | 388 // the fixups. On ARM there are no pointers in code. |
388 intptr_t CountPointerOffsets() const { return 0; } | 389 intptr_t CountPointerOffsets() const { return 0; } |
389 | 390 |
390 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { | 391 const ZoneGrowableArray<intptr_t>& GetPointerOffsets() const { |
391 ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code. | 392 ASSERT(buffer_.pointer_offsets().length() == 0); // No pointers in code. |
392 return buffer_.pointer_offsets(); | 393 return buffer_.pointer_offsets(); |
393 } | 394 } |
394 | 395 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 // Set up a Dart frame for a function compiled for on-stack replacement. | 940 // Set up a Dart frame for a function compiled for on-stack replacement. |
940 // The frame layout is a normal Dart frame, but the frame is partially set | 941 // The frame layout is a normal Dart frame, but the frame is partially set |
941 // up on entry (it is the frame of the unoptimized code). | 942 // up on entry (it is the frame of the unoptimized code). |
942 void EnterOsrFrame(intptr_t extra_size); | 943 void EnterOsrFrame(intptr_t extra_size); |
943 | 944 |
944 // Set up a stub frame so that the stack traversal code can easily identify | 945 // Set up a stub frame so that the stack traversal code can easily identify |
945 // a stub frame. | 946 // a stub frame. |
946 void EnterStubFrame(); | 947 void EnterStubFrame(); |
947 void LeaveStubFrame(); | 948 void LeaveStubFrame(); |
948 | 949 |
949 void NoMonomorphicCheckedEntry(); | |
950 void MonomorphicCheckedEntry(); | 950 void MonomorphicCheckedEntry(); |
951 | 951 |
952 // The register into which the allocation stats table is loaded with | 952 // The register into which the allocation stats table is loaded with |
953 // LoadAllocationStatsAddress should be passed to | 953 // LoadAllocationStatsAddress should be passed to |
954 // IncrementAllocationStats(WithSize) as stats_addr_reg to update the | 954 // IncrementAllocationStats(WithSize) as stats_addr_reg to update the |
955 // allocation stats. These are separate assembler macros so we can | 955 // allocation stats. These are separate assembler macros so we can |
956 // avoid a dependent load too nearby the load of the table address. | 956 // avoid a dependent load too nearby the load of the table address. |
957 void LoadAllocationStatsAddress(Register dest, | 957 void LoadAllocationStatsAddress(Register dest, |
958 intptr_t cid); | 958 intptr_t cid); |
959 void IncrementAllocationStats(Register stats_addr, | 959 void IncrementAllocationStats(Register stats_addr, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 bool constant_pool_allowed() const { | 1012 bool constant_pool_allowed() const { |
1013 return constant_pool_allowed_; | 1013 return constant_pool_allowed_; |
1014 } | 1014 } |
1015 void set_constant_pool_allowed(bool b) { | 1015 void set_constant_pool_allowed(bool b) { |
1016 constant_pool_allowed_ = b; | 1016 constant_pool_allowed_ = b; |
1017 } | 1017 } |
1018 | 1018 |
1019 private: | 1019 private: |
1020 AssemblerBuffer buffer_; // Contains position independent code. | 1020 AssemblerBuffer buffer_; // Contains position independent code. |
1021 ObjectPoolWrapper object_pool_wrapper_; | 1021 ObjectPoolWrapper object_pool_wrapper_; |
1022 | |
1023 int32_t prologue_offset_; | 1022 int32_t prologue_offset_; |
1024 | 1023 bool has_single_entry_point_; |
1025 bool use_far_branches_; | 1024 bool use_far_branches_; |
1026 | 1025 |
1027 // If you are thinking of using one or both of these instructions directly, | 1026 // If you are thinking of using one or both of these instructions directly, |
1028 // instead LoadImmediate should probably be used. | 1027 // instead LoadImmediate should probably be used. |
1029 void movw(Register rd, uint16_t imm16, Condition cond = AL); | 1028 void movw(Register rd, uint16_t imm16, Condition cond = AL); |
1030 void movt(Register rd, uint16_t imm16, Condition cond = AL); | 1029 void movt(Register rd, uint16_t imm16, Condition cond = AL); |
1031 | 1030 |
1032 void BindARMv6(Label* label); | 1031 void BindARMv6(Label* label); |
1033 void BindARMv7(Label* label); | 1032 void BindARMv7(Label* label); |
1034 | 1033 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 Register value, | 1171 Register value, |
1173 Label* no_update); | 1172 Label* no_update); |
1174 | 1173 |
1175 DISALLOW_ALLOCATION(); | 1174 DISALLOW_ALLOCATION(); |
1176 DISALLOW_COPY_AND_ASSIGN(Assembler); | 1175 DISALLOW_COPY_AND_ASSIGN(Assembler); |
1177 }; | 1176 }; |
1178 | 1177 |
1179 } // namespace dart | 1178 } // namespace dart |
1180 | 1179 |
1181 #endif // RUNTIME_VM_ASSEMBLER_ARM_H_ | 1180 #endif // RUNTIME_VM_ASSEMBLER_ARM_H_ |
OLD | NEW |