Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: src/arm/assembler-arm.h

Issue 609843002: Refactor FrameAndConstantPoolScope and ConstantPoolUnavailableScope to be architecture independent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Eliminate unreachable paths. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/assembler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 1481
1482 // Check if is time to emit a constant pool. 1482 // Check if is time to emit a constant pool.
1483 void CheckConstPool(bool force_emit, bool require_jump); 1483 void CheckConstPool(bool force_emit, bool require_jump);
1484 1484
1485 // Allocate a constant pool of the correct size for the generated code. 1485 // Allocate a constant pool of the correct size for the generated code.
1486 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate); 1486 Handle<ConstantPoolArray> NewConstantPool(Isolate* isolate);
1487 1487
1488 // Generate the constant pool for the generated code. 1488 // Generate the constant pool for the generated code.
1489 void PopulateConstantPool(ConstantPoolArray* constant_pool); 1489 void PopulateConstantPool(ConstantPoolArray* constant_pool);
1490 1490
1491 bool is_constant_pool_available() const { return constant_pool_available_; }
1492
1493 bool use_extended_constant_pool() const { 1491 bool use_extended_constant_pool() const {
1494 return constant_pool_builder_.current_section() == 1492 return constant_pool_builder_.current_section() ==
1495 ConstantPoolArray::EXTENDED_SECTION; 1493 ConstantPoolArray::EXTENDED_SECTION;
1496 } 1494 }
1497 1495
1498 1496
1499 protected: 1497 protected:
1500 // Relocation for a type-recording IC has the AST id added to it. This 1498 // Relocation for a type-recording IC has the AST id added to it. This
1501 // member variable is a way to pass the information from the call site to 1499 // member variable is a way to pass the information from the call site to
1502 // the relocation info. 1500 // the relocation info.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 // trigger a check. 1540 // trigger a check.
1543 next_buffer_check_ = no_const_pool_before_; 1541 next_buffer_check_ = no_const_pool_before_;
1544 } 1542 }
1545 } 1543 }
1546 1544
1547 bool is_const_pool_blocked() const { 1545 bool is_const_pool_blocked() const {
1548 return (const_pool_blocked_nesting_ > 0) || 1546 return (const_pool_blocked_nesting_ > 0) ||
1549 (pc_offset() < no_const_pool_before_); 1547 (pc_offset() < no_const_pool_before_);
1550 } 1548 }
1551 1549
1552 void set_constant_pool_available(bool available) {
1553 constant_pool_available_ = available;
1554 }
1555
1556 private: 1550 private:
1557 int next_buffer_check_; // pc offset of next buffer check 1551 int next_buffer_check_; // pc offset of next buffer check
1558 1552
1559 // Code generation 1553 // Code generation
1560 // The relocation writer's position is at least kGap bytes below the end of 1554 // The relocation writer's position is at least kGap bytes below the end of
1561 // the generated instructions. This is so that multi-instruction sequences do 1555 // the generated instructions. This is so that multi-instruction sequences do
1562 // not have to check for overflow. The same is true for writes of large 1556 // not have to check for overflow. The same is true for writes of large
1563 // relocation info entries. 1557 // relocation info entries.
1564 static const int kGap = 32; 1558 static const int kGap = 32;
1565 1559
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 // Number of pending reloc info entries in the 32 bits buffer. 1602 // Number of pending reloc info entries in the 32 bits buffer.
1609 int num_pending_32_bit_reloc_info_; 1603 int num_pending_32_bit_reloc_info_;
1610 // Number of pending reloc info entries in the 64 bits buffer. 1604 // Number of pending reloc info entries in the 64 bits buffer.
1611 int num_pending_64_bit_reloc_info_; 1605 int num_pending_64_bit_reloc_info_;
1612 1606
1613 ConstantPoolBuilder constant_pool_builder_; 1607 ConstantPoolBuilder constant_pool_builder_;
1614 1608
1615 // The bound position, before this we cannot do instruction elimination. 1609 // The bound position, before this we cannot do instruction elimination.
1616 int last_bound_pos_; 1610 int last_bound_pos_;
1617 1611
1618 // Indicates whether the constant pool can be accessed, which is only possible
1619 // if the pp register points to the current code object's constant pool.
1620 bool constant_pool_available_;
1621
1622 // Code emission 1612 // Code emission
1623 inline void CheckBuffer(); 1613 inline void CheckBuffer();
1624 void GrowBuffer(); 1614 void GrowBuffer();
1625 inline void emit(Instr x); 1615 inline void emit(Instr x);
1626 1616
1627 // 32-bit immediate values 1617 // 32-bit immediate values
1628 void move_32_bit_immediate(Register rd, 1618 void move_32_bit_immediate(Register rd,
1629 const Operand& x, 1619 const Operand& x,
1630 Condition cond = al); 1620 Condition cond = al);
1631 1621
(...skipping 15 matching lines...) Expand all
1647 }; 1637 };
1648 1638
1649 // Record reloc info for current pc_ 1639 // Record reloc info for current pc_
1650 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); 1640 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
1651 void RecordRelocInfo(const RelocInfo& rinfo); 1641 void RecordRelocInfo(const RelocInfo& rinfo);
1652 ConstantPoolArray::LayoutSection ConstantPoolAddEntry(const RelocInfo& rinfo); 1642 ConstantPoolArray::LayoutSection ConstantPoolAddEntry(const RelocInfo& rinfo);
1653 1643
1654 friend class RelocInfo; 1644 friend class RelocInfo;
1655 friend class CodePatcher; 1645 friend class CodePatcher;
1656 friend class BlockConstPoolScope; 1646 friend class BlockConstPoolScope;
1657 friend class FrameAndConstantPoolScope;
1658 friend class ConstantPoolUnavailableScope;
1659
1660 PositionsRecorder positions_recorder_; 1647 PositionsRecorder positions_recorder_;
1661 friend class PositionsRecorder; 1648 friend class PositionsRecorder;
1662 friend class EnsureSpace; 1649 friend class EnsureSpace;
1663 }; 1650 };
1664 1651
1665 1652
1666 class EnsureSpace BASE_EMBEDDED { 1653 class EnsureSpace BASE_EMBEDDED {
1667 public: 1654 public:
1668 explicit EnsureSpace(Assembler* assembler) { 1655 explicit EnsureSpace(Assembler* assembler) {
1669 assembler->CheckBuffer(); 1656 assembler->CheckBuffer();
1670 } 1657 }
1671 }; 1658 };
1672 1659
1673 1660
1674 } } // namespace v8::internal 1661 } } // namespace v8::internal
1675 1662
1676 #endif // V8_ARM_ASSEMBLER_ARM_H_ 1663 #endif // V8_ARM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698