| OLD | NEW |
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
| 6 // are met: | 6 // are met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 // bind(&L); // illegal: a label may be bound only once | 739 // bind(&L); // illegal: a label may be bound only once |
| 740 // | 740 // |
| 741 // Note: The same Label can be used for forward and backward branches | 741 // Note: The same Label can be used for forward and backward branches |
| 742 // but it may be bound only once. | 742 // but it may be bound only once. |
| 743 | 743 |
| 744 void bind(Label* L); // binds an unbound label L to the current code position | 744 void bind(Label* L); // binds an unbound label L to the current code position |
| 745 | 745 |
| 746 // Returns the branch offset to the given label from the current code position | 746 // Returns the branch offset to the given label from the current code position |
| 747 // Links the label to the current position if it is still unbound | 747 // Links the label to the current position if it is still unbound |
| 748 // Manages the jump elimination optimization if the second parameter is true. | 748 // Manages the jump elimination optimization if the second parameter is true. |
| 749 int branch_offset(Label* L, bool jump_elimination_allowed); | 749 int branch_offset(Label* L); |
| 750 | 750 |
| 751 // Returns true if the given pc address is the start of a constant pool load | 751 // Returns true if the given pc address is the start of a constant pool load |
| 752 // instruction sequence. | 752 // instruction sequence. |
| 753 INLINE(static bool is_constant_pool_load(Address pc)); | 753 INLINE(static bool is_constant_pool_load(Address pc)); |
| 754 | 754 |
| 755 // Return the address in the constant pool of the code target address used by | 755 // Return the address in the constant pool of the code target address used by |
| 756 // the branch/call instruction at pc, or the object in a mov. | 756 // the branch/call instruction at pc, or the object in a mov. |
| 757 INLINE(static Address constant_pool_entry_address( | 757 INLINE(static Address constant_pool_entry_address( |
| 758 Address pc, ConstantPoolArray* constant_pool)); | 758 Address pc, ConstantPoolArray* constant_pool)); |
| 759 | 759 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 void CodeTargetAlign(); | 845 void CodeTargetAlign(); |
| 846 | 846 |
| 847 // Branch instructions | 847 // Branch instructions |
| 848 void b(int branch_offset, Condition cond = al); | 848 void b(int branch_offset, Condition cond = al); |
| 849 void bl(int branch_offset, Condition cond = al); | 849 void bl(int branch_offset, Condition cond = al); |
| 850 void blx(int branch_offset); // v5 and above | 850 void blx(int branch_offset); // v5 and above |
| 851 void blx(Register target, Condition cond = al); // v5 and above | 851 void blx(Register target, Condition cond = al); // v5 and above |
| 852 void bx(Register target, Condition cond = al); // v5 and above, plus v4t | 852 void bx(Register target, Condition cond = al); // v5 and above, plus v4t |
| 853 | 853 |
| 854 // Convenience branch instructions using labels | 854 // Convenience branch instructions using labels |
| 855 void b(Label* L, Condition cond = al) { | 855 void b(Label* L, Condition cond = al); |
| 856 b(branch_offset(L, cond == al), cond); | 856 void b(Condition cond, Label* L) { b(L, cond); } |
| 857 } | 857 void bl(Label* L, Condition cond = al); |
| 858 void b(Condition cond, Label* L) { b(branch_offset(L, cond == al), cond); } | 858 void bl(Condition cond, Label* L) { bl(L, cond); } |
| 859 void bl(Label* L, Condition cond = al) { bl(branch_offset(L, false), cond); } | 859 void blx(Label* L); // v5 and above |
| 860 void bl(Condition cond, Label* L) { bl(branch_offset(L, false), cond); } | |
| 861 void blx(Label* L) { blx(branch_offset(L, false)); } // v5 and above | |
| 862 | 860 |
| 863 // Data-processing instructions | 861 // Data-processing instructions |
| 864 | 862 |
| 865 void and_(Register dst, Register src1, const Operand& src2, | 863 void and_(Register dst, Register src1, const Operand& src2, |
| 866 SBit s = LeaveCC, Condition cond = al); | 864 SBit s = LeaveCC, Condition cond = al); |
| 867 | 865 |
| 868 void eor(Register dst, Register src1, const Operand& src2, | 866 void eor(Register dst, Register src1, const Operand& src2, |
| 869 SBit s = LeaveCC, Condition cond = al); | 867 SBit s = LeaveCC, Condition cond = al); |
| 870 | 868 |
| 871 void sub(Register dst, Register src1, const Operand& src2, | 869 void sub(Register dst, Register src1, const Operand& src2, |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 static const int kMaxNumPending32RelocInfo = kMaxDistToIntPool/kInstrSize; | 1527 static const int kMaxNumPending32RelocInfo = kMaxDistToIntPool/kInstrSize; |
| 1530 static const int kMaxNumPending64RelocInfo = kMaxDistToFPPool/kInstrSize; | 1528 static const int kMaxNumPending64RelocInfo = kMaxDistToFPPool/kInstrSize; |
| 1531 | 1529 |
| 1532 // Postpone the generation of the constant pool for the specified number of | 1530 // Postpone the generation of the constant pool for the specified number of |
| 1533 // instructions. | 1531 // instructions. |
| 1534 void BlockConstPoolFor(int instructions); | 1532 void BlockConstPoolFor(int instructions); |
| 1535 | 1533 |
| 1536 // Check if is time to emit a constant pool. | 1534 // Check if is time to emit a constant pool. |
| 1537 void CheckConstPool(bool force_emit, bool require_jump); | 1535 void CheckConstPool(bool force_emit, bool require_jump); |
| 1538 | 1536 |
| 1537 void MaybeCheckConstPool() { |
| 1538 if (pc_offset() >= next_buffer_check_) { |
| 1539 CheckConstPool(false, true); |
| 1540 } |
| 1541 } |
| 1542 |
| 1539 // Allocate a constant pool of the correct size for the generated code. | 1543 // Allocate a constant pool of the correct size for the generated code. |
| 1540 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); | 1544 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); |
| 1541 | 1545 |
| 1542 // Generate the constant pool for the generated code. | 1546 // Generate the constant pool for the generated code. |
| 1543 void PopulateConstantPool(ConstantPoolArray* constant_pool); | 1547 void PopulateConstantPool(ConstantPoolArray* constant_pool); |
| 1544 | 1548 |
| 1549 |
| 1545 bool use_extended_constant_pool() const { | 1550 bool use_extended_constant_pool() const { |
| 1546 return constant_pool_builder_.current_section() == | 1551 return constant_pool_builder_.current_section() == |
| 1547 ConstantPoolArray::EXTENDED_SECTION; | 1552 ConstantPoolArray::EXTENDED_SECTION; |
| 1548 } | 1553 } |
| 1549 | 1554 |
| 1550 | 1555 |
| 1551 protected: | 1556 protected: |
| 1552 // Relocation for a type-recording IC has the AST id added to it. This | 1557 // Relocation for a type-recording IC has the AST id added to it. This |
| 1553 // member variable is a way to pass the information from the call site to | 1558 // member variable is a way to pass the information from the call site to |
| 1554 // the relocation info. | 1559 // the relocation info. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 public: | 1713 public: |
| 1709 explicit EnsureSpace(Assembler* assembler) { | 1714 explicit EnsureSpace(Assembler* assembler) { |
| 1710 assembler->CheckBuffer(); | 1715 assembler->CheckBuffer(); |
| 1711 } | 1716 } |
| 1712 }; | 1717 }; |
| 1713 | 1718 |
| 1714 | 1719 |
| 1715 } } // namespace v8::internal | 1720 } } // namespace v8::internal |
| 1716 | 1721 |
| 1717 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1722 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |