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 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 } | 1563 } |
1564 | 1564 |
1565 // Resume constant pool emission. Need to be called as many time as | 1565 // Resume constant pool emission. Need to be called as many time as |
1566 // StartBlockConstPool to have an effect. | 1566 // StartBlockConstPool to have an effect. |
1567 void EndBlockConstPool() { | 1567 void EndBlockConstPool() { |
1568 if (--const_pool_blocked_nesting_ == 0) { | 1568 if (--const_pool_blocked_nesting_ == 0) { |
1569 #ifdef DEBUG | 1569 #ifdef DEBUG |
1570 // Max pool start (if we need a jump and an alignment). | 1570 // Max pool start (if we need a jump and an alignment). |
1571 int start = pc_offset() + kInstrSize + 2 * kPointerSize; | 1571 int start = pc_offset() + kInstrSize + 2 * kPointerSize; |
1572 // Check the constant pool hasn't been blocked for too long. | 1572 // Check the constant pool hasn't been blocked for too long. |
1573 DCHECK((num_pending_32_bit_constants_ == 0) || | 1573 DCHECK(pending_32_bit_constants_.empty() || |
1574 (start + num_pending_64_bit_constants_ * kDoubleSize < | 1574 (start + pending_64_bit_constants_.size() * kDoubleSize < |
1575 (first_const_pool_32_use_ + kMaxDistToIntPool))); | 1575 (first_const_pool_32_use_ + kMaxDistToIntPool))); |
1576 DCHECK((num_pending_64_bit_constants_ == 0) || | 1576 DCHECK(pending_64_bit_constants_.empty() || |
1577 (start < (first_const_pool_64_use_ + kMaxDistToFPPool))); | 1577 (start < (first_const_pool_64_use_ + kMaxDistToFPPool))); |
1578 #endif | 1578 #endif |
1579 // Two cases: | 1579 // Two cases: |
1580 // * no_const_pool_before_ >= next_buffer_check_ and the emission is | 1580 // * no_const_pool_before_ >= next_buffer_check_ and the emission is |
1581 // still blocked | 1581 // still blocked |
1582 // * no_const_pool_before_ < next_buffer_check_ and the next emit will | 1582 // * no_const_pool_before_ < next_buffer_check_ and the next emit will |
1583 // trigger a check. | 1583 // trigger a check. |
1584 next_buffer_check_ = no_const_pool_before_; | 1584 next_buffer_check_ = no_const_pool_before_; |
1585 } | 1585 } |
1586 } | 1586 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 RelocInfoWriter reloc_info_writer; | 1633 RelocInfoWriter reloc_info_writer; |
1634 | 1634 |
1635 // ConstantPoolEntry records are used during code generation as temporary | 1635 // ConstantPoolEntry records are used during code generation as temporary |
1636 // containers for constants and code target addresses until they are emitted | 1636 // containers for constants and code target addresses until they are emitted |
1637 // to the constant pool. These records are temporarily stored in a separate | 1637 // to the constant pool. These records are temporarily stored in a separate |
1638 // buffer until a constant pool is emitted. | 1638 // buffer until a constant pool is emitted. |
1639 // If every instruction in a long sequence is accessing the pool, we need one | 1639 // If every instruction in a long sequence is accessing the pool, we need one |
1640 // pending relocation entry per instruction. | 1640 // pending relocation entry per instruction. |
1641 | 1641 |
1642 // The buffers of pending constant pool entries. | 1642 // The buffers of pending constant pool entries. |
1643 ConstantPoolEntry pending_32_bit_constants_buffer_[kMinNumPendingConstants]; | 1643 std::vector<ConstantPoolEntry> pending_32_bit_constants_; |
1644 ConstantPoolEntry pending_64_bit_constants_buffer_[kMinNumPendingConstants]; | 1644 std::vector<ConstantPoolEntry> pending_64_bit_constants_; |
1645 ConstantPoolEntry* pending_32_bit_constants_; | |
1646 ConstantPoolEntry* pending_64_bit_constants_; | |
1647 // Number of pending constant pool entries in the 32 bits buffer. | |
1648 int num_pending_32_bit_constants_; | |
1649 // Number of pending constant pool entries in the 64 bits buffer. | |
1650 int num_pending_64_bit_constants_; | |
1651 | 1645 |
1652 ConstantPoolBuilder constant_pool_builder_; | 1646 ConstantPoolBuilder constant_pool_builder_; |
1653 | 1647 |
1654 // The bound position, before this we cannot do instruction elimination. | 1648 // The bound position, before this we cannot do instruction elimination. |
1655 int last_bound_pos_; | 1649 int last_bound_pos_; |
1656 | 1650 |
1657 // Code emission | 1651 // Code emission |
1658 inline void CheckBuffer(); | 1652 inline void CheckBuffer(); |
1659 void GrowBuffer(); | 1653 void GrowBuffer(); |
1660 inline void emit(Instr x); | 1654 inline void emit(Instr x); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 explicit EnsureSpace(Assembler* assembler) { | 1691 explicit EnsureSpace(Assembler* assembler) { |
1698 assembler->CheckBuffer(); | 1692 assembler->CheckBuffer(); |
1699 } | 1693 } |
1700 }; | 1694 }; |
1701 | 1695 |
1702 | 1696 |
1703 } // namespace internal | 1697 } // namespace internal |
1704 } // namespace v8 | 1698 } // namespace v8 |
1705 | 1699 |
1706 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1700 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |