| 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_ARM_H_ | 5 #ifndef VM_ASSEMBLER_ARM_H_ |
| 6 #define VM_ASSEMBLER_ARM_H_ | 6 #define VM_ASSEMBLER_ARM_H_ |
| 7 | 7 |
| 8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef 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 |
| 11 | 11 |
| 12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
| 13 #include "platform/utils.h" | 13 #include "platform/utils.h" |
| 14 #include "vm/constants_arm.h" | 14 #include "vm/constants_arm.h" |
| 15 | 15 |
| 16 namespace dart { | 16 namespace dart { |
| 17 | 17 |
| 18 // Forward declarations. |
| 19 class RuntimeEntry; |
| 20 |
| 18 class Label : public ValueObject { | 21 class Label : public ValueObject { |
| 19 public: | 22 public: |
| 20 Label() : position_(0) { } | 23 Label() : position_(0) { } |
| 21 | 24 |
| 22 ~Label() { | 25 ~Label() { |
| 23 // Assert if label is being destroyed with unresolved branches pending. | 26 // Assert if label is being destroyed with unresolved branches pending. |
| 24 ASSERT(!IsLinked()); | 27 ASSERT(!IsLinked()); |
| 25 } | 28 } |
| 26 | 29 |
| 27 // Returns the position for bound and linked labels. Cannot be used | 30 // Returns the position for bound and linked labels. Cannot be used |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 509 |
| 507 // Compare rn with signed immediate value. May clobber IP. | 510 // Compare rn with signed immediate value. May clobber IP. |
| 508 void CompareImmediate(Register rn, int32_t value, Condition cond = AL); | 511 void CompareImmediate(Register rn, int32_t value, Condition cond = AL); |
| 509 | 512 |
| 510 // Load and Store. May clobber IP. | 513 // Load and Store. May clobber IP. |
| 511 void LoadImmediate(Register rd, int32_t value, Condition cond = AL); | 514 void LoadImmediate(Register rd, int32_t value, Condition cond = AL); |
| 512 void LoadSImmediate(SRegister sd, float value, Condition cond = AL); | 515 void LoadSImmediate(SRegister sd, float value, Condition cond = AL); |
| 513 void LoadDImmediate(DRegister dd, double value, | 516 void LoadDImmediate(DRegister dd, double value, |
| 514 Register scratch, Condition cond = AL); | 517 Register scratch, Condition cond = AL); |
| 515 void MarkExceptionHandler(Label* label); | 518 void MarkExceptionHandler(Label* label); |
| 519 void Drop(intptr_t stack_elements); |
| 516 void LoadObject(Register rd, const Object& object); | 520 void LoadObject(Register rd, const Object& object); |
| 517 void LoadFromOffset(LoadOperandType type, | 521 void LoadFromOffset(LoadOperandType type, |
| 518 Register reg, | 522 Register reg, |
| 519 Register base, | 523 Register base, |
| 520 int32_t offset, | 524 int32_t offset, |
| 521 Condition cond = AL); | 525 Condition cond = AL); |
| 522 void StoreToOffset(StoreOperandType type, | 526 void StoreToOffset(StoreOperandType type, |
| 523 Register reg, | 527 Register reg, |
| 524 Register base, | 528 Register base, |
| 525 int32_t offset, | 529 int32_t offset, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 void SmiUntag(Register reg, Condition cond = AL) { | 568 void SmiUntag(Register reg, Condition cond = AL) { |
| 565 Asr(reg, reg, kSmiTagSize, cond); | 569 Asr(reg, reg, kSmiTagSize, cond); |
| 566 } | 570 } |
| 567 | 571 |
| 568 // Function frame setup and tear down. | 572 // Function frame setup and tear down. |
| 569 void EnterFrame(RegList regs, intptr_t frame_space); | 573 void EnterFrame(RegList regs, intptr_t frame_space); |
| 570 void LeaveFrame(RegList regs); | 574 void LeaveFrame(RegList regs); |
| 571 void Ret(); | 575 void Ret(); |
| 572 void ReserveAlignedFrameSpace(intptr_t frame_space); | 576 void ReserveAlignedFrameSpace(intptr_t frame_space); |
| 573 | 577 |
| 578 // Create a frame for calling into runtime that preserves all volatile |
| 579 // registers. Frame's SP is guaranteed to be correctly aligned and |
| 580 // frame_space bytes are reserved under it. |
| 581 void EnterCallRuntimeFrame(intptr_t frame_space); |
| 582 void LeaveCallRuntimeFrame(); |
| 583 |
| 584 void CallRuntime(const RuntimeEntry& entry); |
| 585 |
| 574 // Emit data (e.g encoded instruction or immediate) in instruction stream. | 586 // Emit data (e.g encoded instruction or immediate) in instruction stream. |
| 575 void Emit(int32_t value); | 587 void Emit(int32_t value); |
| 576 | 588 |
| 577 private: | 589 private: |
| 578 AssemblerBuffer buffer_; // Contains position independent code. | 590 AssemblerBuffer buffer_; // Contains position independent code. |
| 579 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. | 591 GrowableObjectArray& object_pool_; // Objects and patchable jump targets. |
| 580 int32_t prologue_offset_; | 592 int32_t prologue_offset_; |
| 581 | 593 |
| 582 int32_t AddObject(const Object& obj); | 594 int32_t AddObject(const Object& obj); |
| 583 int32_t AddExternalLabel(const ExternalLabel* label); | 595 int32_t AddExternalLabel(const ExternalLabel* label); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 return *reg1 - *reg2; | 690 return *reg1 - *reg2; |
| 679 } | 691 } |
| 680 | 692 |
| 681 DISALLOW_ALLOCATION(); | 693 DISALLOW_ALLOCATION(); |
| 682 DISALLOW_COPY_AND_ASSIGN(Assembler); | 694 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 683 }; | 695 }; |
| 684 | 696 |
| 685 } // namespace dart | 697 } // namespace dart |
| 686 | 698 |
| 687 #endif // VM_ASSEMBLER_ARM_H_ | 699 #endif // VM_ASSEMBLER_ARM_H_ |
| OLD | NEW |