| 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 Register rs() const { return rs_; } | 601 Register rs() const { return rs_; } |
| 602 ShiftOp shift_op() const { return shift_op_; } | 602 ShiftOp shift_op() const { return shift_op_; } |
| 603 | 603 |
| 604 private: | 604 private: |
| 605 Register rm_; | 605 Register rm_; |
| 606 Register rs_; | 606 Register rs_; |
| 607 ShiftOp shift_op_; | 607 ShiftOp shift_op_; |
| 608 int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg | 608 int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg |
| 609 int32_t imm32_; // valid if rm_ == no_reg | 609 int32_t imm32_; // valid if rm_ == no_reg |
| 610 RelocInfo::Mode rmode_; | 610 RelocInfo::Mode rmode_; |
| 611 bool weak_in_optimized_code_; |
| 611 | 612 |
| 612 friend class Assembler; | 613 friend class Assembler; |
| 613 }; | 614 }; |
| 614 | 615 |
| 615 | 616 |
| 616 // Class MemOperand represents a memory operand in load and store instructions | 617 // Class MemOperand represents a memory operand in load and store instructions |
| 617 class MemOperand BASE_EMBEDDED { | 618 class MemOperand BASE_EMBEDDED { |
| 618 public: | 619 public: |
| 619 // [rn +/- offset] Offset/NegOffset | 620 // [rn +/- offset] Offset/NegOffset |
| 620 // [rn +/- offset]! PreIndex/NegPreIndex | 621 // [rn +/- offset]! PreIndex/NegPreIndex |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 }; | 707 }; |
| 707 | 708 |
| 708 | 709 |
| 709 // Class used to build a constant pool. | 710 // Class used to build a constant pool. |
| 710 class ConstantPoolBuilder BASE_EMBEDDED { | 711 class ConstantPoolBuilder BASE_EMBEDDED { |
| 711 public: | 712 public: |
| 712 explicit ConstantPoolBuilder(); | 713 explicit ConstantPoolBuilder(); |
| 713 void AddEntry(Assembler* assm, const RelocInfo& rinfo); | 714 void AddEntry(Assembler* assm, const RelocInfo& rinfo); |
| 714 void Relocate(int pc_delta); | 715 void Relocate(int pc_delta); |
| 715 bool IsEmpty(); | 716 bool IsEmpty(); |
| 716 MaybeObject* Allocate(Heap* heap); | 717 MaybeObject* Allocate(Heap* heap, bool has_weak_pointers); |
| 717 void Populate(Assembler* assm, ConstantPoolArray* constant_pool); | 718 void Populate(Assembler* assm, ConstantPoolArray* constant_pool); |
| 718 | 719 |
| 719 inline int count_of_64bit() const { return count_of_64bit_; } | 720 inline int count_of_64bit() const { return count_of_64bit_; } |
| 720 inline int count_of_code_ptr() const { return count_of_code_ptr_; } | 721 inline int count_of_code_ptr() const { return count_of_code_ptr_; } |
| 721 inline int count_of_heap_ptr() const { return count_of_heap_ptr_; } | 722 inline int count_of_heap_ptr() const { return count_of_heap_ptr_; } |
| 723 inline int count_of_weak_ptr() const { return count_of_weak_ptr_; } |
| 722 inline int count_of_32bit() const { return count_of_32bit_; } | 724 inline int count_of_32bit() const { return count_of_32bit_; } |
| 723 | 725 |
| 724 private: | 726 private: |
| 725 bool Is64BitEntry(RelocInfo::Mode rmode); | 727 bool Is64BitEntry(RelocInfo::Mode rmode); |
| 726 bool Is32BitEntry(RelocInfo::Mode rmode); | 728 bool Is32BitEntry(RelocInfo::Mode rmode); |
| 727 bool IsCodePtrEntry(RelocInfo::Mode rmode); | 729 bool IsCodePtrEntry(RelocInfo::Mode rmode); |
| 728 bool IsHeapPtrEntry(RelocInfo::Mode rmode); | 730 bool IsHeapPtrEntry(RelocInfo::Mode rmode); |
| 729 | 731 |
| 730 std::vector<RelocInfo> entries_; | 732 std::vector<RelocInfo> entries_; |
| 731 std::vector<int> merged_indexes_; | 733 std::vector<int> merged_indexes_; |
| 732 int count_of_64bit_; | 734 int count_of_64bit_; |
| 733 int count_of_code_ptr_; | 735 int count_of_code_ptr_; |
| 734 int count_of_heap_ptr_; | 736 int count_of_heap_ptr_; |
| 737 int count_of_weak_ptr_; |
| 735 int count_of_32bit_; | 738 int count_of_32bit_; |
| 736 }; | 739 }; |
| 737 | 740 |
| 738 | 741 |
| 739 extern const Instr kMovLrPc; | 742 extern const Instr kMovLrPc; |
| 740 extern const Instr kLdrPCMask; | 743 extern const Instr kLdrPCMask; |
| 741 extern const Instr kLdrPCPattern; | 744 extern const Instr kLdrPCPattern; |
| 742 extern const Instr kLdrPpMask; | 745 extern const Instr kLdrPpMask; |
| 743 extern const Instr kLdrPpPattern; | 746 extern const Instr kLdrPpPattern; |
| 744 extern const Instr kBlxRegMask; | 747 extern const Instr kBlxRegMask; |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 static const int kMaxNumPending64RelocInfo = kMaxDistToFPPool/kInstrSize; | 1493 static const int kMaxNumPending64RelocInfo = kMaxDistToFPPool/kInstrSize; |
| 1491 | 1494 |
| 1492 // Postpone the generation of the constant pool for the specified number of | 1495 // Postpone the generation of the constant pool for the specified number of |
| 1493 // instructions. | 1496 // instructions. |
| 1494 void BlockConstPoolFor(int instructions); | 1497 void BlockConstPoolFor(int instructions); |
| 1495 | 1498 |
| 1496 // Check if is time to emit a constant pool. | 1499 // Check if is time to emit a constant pool. |
| 1497 void CheckConstPool(bool force_emit, bool require_jump); | 1500 void CheckConstPool(bool force_emit, bool require_jump); |
| 1498 | 1501 |
| 1499 // Allocate a constant pool of the correct size for the generated code. | 1502 // Allocate a constant pool of the correct size for the generated code. |
| 1500 MaybeObject* AllocateConstantPool(Heap* heap); | 1503 MaybeObject* AllocateConstantPool(Heap* heap, bool has_weak_pointers); |
| 1501 | 1504 |
| 1502 // Generate the constant pool for the generated code. | 1505 // Generate the constant pool for the generated code. |
| 1503 void PopulateConstantPool(ConstantPoolArray* constant_pool); | 1506 void PopulateConstantPool(ConstantPoolArray* constant_pool); |
| 1504 | 1507 |
| 1505 bool can_use_constant_pool() const { | 1508 bool can_use_constant_pool() const { |
| 1506 return is_constant_pool_available() && !constant_pool_full_; | 1509 return is_constant_pool_available() && !constant_pool_full_; |
| 1507 } | 1510 } |
| 1508 | 1511 |
| 1509 void set_constant_pool_full() { | 1512 void set_constant_pool_full() { |
| 1510 constant_pool_full_ = true; | 1513 constant_pool_full_ = true; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 public: | 1691 public: |
| 1689 explicit EnsureSpace(Assembler* assembler) { | 1692 explicit EnsureSpace(Assembler* assembler) { |
| 1690 assembler->CheckBuffer(); | 1693 assembler->CheckBuffer(); |
| 1691 } | 1694 } |
| 1692 }; | 1695 }; |
| 1693 | 1696 |
| 1694 | 1697 |
| 1695 } } // namespace v8::internal | 1698 } } // namespace v8::internal |
| 1696 | 1699 |
| 1697 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1700 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |