Changeset 90586 in webkit
- Timestamp:
- Jul 7, 2011 1:26:19 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r90535 r90586 1 2011-07-07 Oliver Hunt <oliver@apple.com> 2 3 Encode jump and link sizes into the appropriate enums 4 https://bugs.webkit.org/show_bug.cgi?id=64123 5 6 Reviewed by Sam Weinig. 7 8 Finally kill off the out of line jump and link size arrays, 9 so we can avoid icky loads and constant fold the linking arithmetic. 10 11 * assembler/ARMv7Assembler.cpp: 12 * assembler/ARMv7Assembler.h: 13 (JSC::ARMv7Assembler::jumpSizeDelta): 14 (JSC::ARMv7Assembler::computeJumpType): 15 1 16 2011-07-06 Juan C. Montemayor <jmont@apple.com> 2 17 -
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.cpp
r69743 r90586 32 32 namespace JSC { 33 33 34 const int ARMv7Assembler::JumpSizes[] = { 0xffffffff, sizeof(uint16_t), sizeof(uint16_t),35 2 * sizeof(uint16_t), 2 * sizeof(uint16_t), 3 * sizeof(uint16_t), 5 * sizeof(uint16_t), 6 * sizeof(uint16_t) };36 const int ARMv7Assembler::JumpPaddingSizes[] = { 0, 5 * sizeof(uint16_t), 6 * sizeof(uint16_t),37 5 * sizeof(uint16_t), 6 * sizeof(uint16_t) };38 39 34 } 40 35 -
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r90426 r90586 446 446 } Condition; 447 447 448 enum JumpType { JumpFixed, JumpNoCondition, JumpCondition, JumpNoConditionFixedSize, JumpConditionFixedSize, JumpTypeCount }; 449 enum JumpLinkType { LinkInvalid, LinkJumpT1, LinkJumpT2, LinkJumpT3, 450 LinkJumpT4, LinkConditionalJumpT4, LinkBX, LinkConditionalBX, JumpLinkTypeCount }; 451 static const int JumpSizes[JumpLinkTypeCount]; 452 static const int JumpPaddingSizes[JumpTypeCount]; 448 #define JUMP_ENUM_WITH_SIZE(index, value) (((value) << 3) | (index)) 449 #define JUMP_ENUM_SIZE(jump) ((jump) >> 3) 450 enum JumpType { JumpFixed = JUMP_ENUM_WITH_SIZE(0, 0), 451 JumpNoCondition = JUMP_ENUM_WITH_SIZE(1, 5 * sizeof(uint16_t)), 452 JumpCondition = JUMP_ENUM_WITH_SIZE(2, 6 * sizeof(uint16_t)), 453 JumpNoConditionFixedSize = JUMP_ENUM_WITH_SIZE(3, 5 * sizeof(uint16_t)), 454 JumpConditionFixedSize = JUMP_ENUM_WITH_SIZE(4, 6 * sizeof(uint16_t)) 455 }; 456 enum JumpLinkType { 457 LinkInvalid = JUMP_ENUM_WITH_SIZE(0, 0), 458 LinkJumpT1 = JUMP_ENUM_WITH_SIZE(1, sizeof(uint16_t)), 459 LinkJumpT2 = JUMP_ENUM_WITH_SIZE(2, sizeof(uint16_t)), 460 LinkJumpT3 = JUMP_ENUM_WITH_SIZE(3, 2 * sizeof(uint16_t)), 461 LinkJumpT4 = JUMP_ENUM_WITH_SIZE(4, 2 * sizeof(uint16_t)), 462 LinkConditionalJumpT4 = JUMP_ENUM_WITH_SIZE(5, 3 * sizeof(uint16_t)), 463 LinkBX = JUMP_ENUM_WITH_SIZE(6, 5 * sizeof(uint16_t)), 464 LinkConditionalBX = JUMP_ENUM_WITH_SIZE(7, 6 * sizeof(uint16_t)) 465 }; 466 453 467 class LinkRecord { 454 468 public: … … 471 485 intptr_t m_from : 31; 472 486 intptr_t m_to : 31; 473 JumpType m_type : 3;474 JumpLinkType m_linkType : 4;487 JumpType m_type : 8; 488 JumpLinkType m_linkType : 8; 475 489 Condition m_condition : 16; 476 490 }; … … 1573 1587 } 1574 1588 1575 int jumpSizeDelta(JumpType jumpType, JumpLinkType jumpLinkType) { return J umpPaddingSizes[jumpType] - JumpSizes[jumpLinkType]; }1589 int jumpSizeDelta(JumpType jumpType, JumpLinkType jumpLinkType) { return JUMP_ENUM_SIZE(jumpType) - JUMP_ENUM_SIZE(jumpLinkType); } 1576 1590 1577 1591 // Assembler admin methods: … … 1602 1616 return LinkConditionalBX; 1603 1617 1604 const int paddingSize = J umpPaddingSizes[jumpType];1618 const int paddingSize = JUMP_ENUM_SIZE(jumpType); 1605 1619 bool mayTriggerErrata = false; 1606 1620 1607 1621 if (jumpType == JumpCondition) { 1608 1622 // 2-byte conditional T1 1609 const uint16_t* jumpT1Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - J umpSizes[LinkJumpT1]));1623 const uint16_t* jumpT1Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - JUMP_ENUM_SIZE(LinkJumpT1))); 1610 1624 if (canBeJumpT1(jumpT1Location, to)) 1611 1625 return LinkJumpT1; 1612 1626 // 4-byte conditional T3 1613 const uint16_t* jumpT3Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - J umpSizes[LinkJumpT3]));1627 const uint16_t* jumpT3Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - JUMP_ENUM_SIZE(LinkJumpT3))); 1614 1628 if (canBeJumpT3(jumpT3Location, to, mayTriggerErrata)) { 1615 1629 if (!mayTriggerErrata) … … 1618 1632 // 4-byte conditional T4 with IT 1619 1633 const uint16_t* conditionalJumpT4Location = 1620 reinterpret_cast<const uint16_t*>(from - (paddingSize - J umpSizes[LinkConditionalJumpT4]));1634 reinterpret_cast<const uint16_t*>(from - (paddingSize - JUMP_ENUM_SIZE(LinkConditionalJumpT4))); 1621 1635 if (canBeJumpT4(conditionalJumpT4Location, to, mayTriggerErrata)) { 1622 1636 if (!mayTriggerErrata) … … 1625 1639 } else { 1626 1640 // 2-byte unconditional T2 1627 const uint16_t* jumpT2Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - J umpSizes[LinkJumpT2]));1641 const uint16_t* jumpT2Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - JUMP_ENUM_SIZE(LinkJumpT2))); 1628 1642 if (canBeJumpT2(jumpT2Location, to)) 1629 1643 return LinkJumpT2; 1630 1644 // 4-byte unconditional T4 1631 const uint16_t* jumpT4Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - J umpSizes[LinkJumpT4]));1645 const uint16_t* jumpT4Location = reinterpret_cast<const uint16_t*>(from - (paddingSize - JUMP_ENUM_SIZE(LinkJumpT4))); 1632 1646 if (canBeJumpT4(jumpT4Location, to, mayTriggerErrata)) { 1633 1647 if (!mayTriggerErrata)
Note: See TracChangeset
for help on using the changeset viewer.