| 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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 void SmiTag(Register reg) { | 782 void SmiTag(Register reg) { |
| 783 sll(reg, reg, kSmiTagSize); | 783 sll(reg, reg, kSmiTagSize); |
| 784 } | 784 } |
| 785 | 785 |
| 786 void SmiUntag(Register reg) { | 786 void SmiUntag(Register reg) { |
| 787 sra(reg, reg, kSmiTagSize); | 787 sra(reg, reg, kSmiTagSize); |
| 788 } | 788 } |
| 789 | 789 |
| 790 void ReserveAlignedFrameSpace(intptr_t frame_space); | 790 void ReserveAlignedFrameSpace(intptr_t frame_space); |
| 791 | 791 |
| 792 // Create a frame for calling into runtime that preserves all volatile |
| 793 // registers. Frame's SP is guaranteed to be correctly aligned and |
| 794 // frame_space bytes are reserved under it. |
| 795 void EnterCallRuntimeFrame(intptr_t frame_space); |
| 796 void LeaveCallRuntimeFrame(); |
| 797 |
| 792 void LoadWordFromPoolOffset(Register rd, int32_t offset); | 798 void LoadWordFromPoolOffset(Register rd, int32_t offset); |
| 793 void LoadObject(Register rd, const Object& object); | 799 void LoadObject(Register rd, const Object& object); |
| 794 void PushObject(const Object& object); | 800 void PushObject(const Object& object); |
| 795 | 801 |
| 796 // Sets register rd to zero if the object is equal to register rn, | 802 // Sets register rd to zero if the object is equal to register rn, |
| 797 // sets it to non-zero otherwise. | 803 // sets it to non-zero otherwise. |
| 798 void CompareObject(Register rd, Register rn, const Object& object); | 804 void CompareObject(Register rd, Register rn, const Object& object); |
| 799 | 805 |
| 800 void LoadClassId(Register result, Register object); | 806 void LoadClassId(Register result, Register object); |
| 801 void LoadClassById(Register result, Register class_id); | 807 void LoadClassById(Register result, Register class_id); |
| 802 void LoadClass(Register result, Register object); | 808 void LoadClass(Register result, Register object); |
| 803 | 809 |
| 810 void StoreIntoObject(Register object, // Object we are storing into. |
| 811 const Address& dest, // Where we are storing into. |
| 812 Register value, // Value we are storing. |
| 813 bool can_value_be_smi = true); |
| 814 |
| 815 void StoreIntoObjectNoBarrier(Register object, |
| 816 const Address& dest, |
| 817 Register value); |
| 818 void StoreIntoObjectNoBarrier(Register object, |
| 819 const Address& dest, |
| 820 const Object& value); |
| 821 |
| 804 void CallRuntime(const RuntimeEntry& entry); | 822 void CallRuntime(const RuntimeEntry& entry); |
| 805 | 823 |
| 806 // Set up a Dart frame on entry with a frame pointer and PC information to | 824 // Set up a Dart frame on entry with a frame pointer and PC information to |
| 807 // enable easy access to the RawInstruction object of code corresponding | 825 // enable easy access to the RawInstruction object of code corresponding |
| 808 // to this frame. | 826 // to this frame. |
| 809 void EnterDartFrame(intptr_t frame_size); | 827 void EnterDartFrame(intptr_t frame_size); |
| 810 void LeaveDartFrame(); | 828 void LeaveDartFrame(); |
| 811 | 829 |
| 812 private: | 830 private: |
| 813 AssemblerBuffer buffer_; | 831 AssemblerBuffer buffer_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 } | 967 } |
| 950 | 968 |
| 951 static int32_t EncodeBranchOffset(int32_t offset, int32_t instr); | 969 static int32_t EncodeBranchOffset(int32_t offset, int32_t instr); |
| 952 static int DecodeBranchOffset(int32_t instr); | 970 static int DecodeBranchOffset(int32_t instr); |
| 953 | 971 |
| 954 void EmitBranchDelayNop() { | 972 void EmitBranchDelayNop() { |
| 955 Emit(Instr::kNopInstruction); // Branch delay NOP. | 973 Emit(Instr::kNopInstruction); // Branch delay NOP. |
| 956 delay_slot_available_ = true; | 974 delay_slot_available_ = true; |
| 957 } | 975 } |
| 958 | 976 |
| 977 void StoreIntoObjectFilter(Register object, Register value, Label* no_update); |
| 978 |
| 979 // Shorter filtering sequence that assumes that value is not a smi. |
| 980 void StoreIntoObjectFilterNoSmi(Register object, |
| 981 Register value, |
| 982 Label* no_update); |
| 983 |
| 959 DISALLOW_ALLOCATION(); | 984 DISALLOW_ALLOCATION(); |
| 960 DISALLOW_COPY_AND_ASSIGN(Assembler); | 985 DISALLOW_COPY_AND_ASSIGN(Assembler); |
| 961 }; | 986 }; |
| 962 | 987 |
| 963 } // namespace dart | 988 } // namespace dart |
| 964 | 989 |
| 965 #endif // VM_ASSEMBLER_MIPS_H_ | 990 #endif // VM_ASSEMBLER_MIPS_H_ |
| OLD | NEW |