Changeset 120897 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Jun 20, 2012, 6:38:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r120556 r120897 36 36 #include "MethodCallLinkStatus.h" 37 37 #include "PutByIdStatus.h" 38 #include "ResolveGlobalStatus.h" 38 39 #include <wtf/HashMap.h> 39 40 #include <wtf/MathExtras.h> … … 95 96 // Handle intrinsic functions. Return true if it succeeded, false if we need to plant a call. 96 97 bool handleIntrinsic(bool usesResult, int resultOperand, Intrinsic, int registerOffset, int argumentCountIncludingThis, SpeculatedType prediction); 98 void handleGetByOffset( 99 int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber, 100 bool useInlineStorage, size_t offset); 97 101 void handleGetById( 98 102 int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber, … … 1568 1572 } 1569 1573 1574 void ByteCodeParser::handleGetByOffset( 1575 int destinationOperand, SpeculatedType prediction, NodeIndex base, unsigned identifierNumber, 1576 bool useInlineStorage, size_t offset) 1577 { 1578 NodeIndex propertyStorage; 1579 size_t offsetOffset; 1580 if (useInlineStorage) { 1581 propertyStorage = base; 1582 ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue))); 1583 offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue); 1584 } else { 1585 propertyStorage = addToGraph(GetPropertyStorage, base); 1586 offsetOffset = 0; 1587 } 1588 set(destinationOperand, 1589 addToGraph( 1590 GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction), 1591 propertyStorage)); 1592 1593 StorageAccessData storageAccessData; 1594 storageAccessData.offset = offset + offsetOffset; 1595 storageAccessData.identifierNumber = identifierNumber; 1596 m_graph.m_storageAccessData.append(storageAccessData); 1597 } 1598 1570 1599 void ByteCodeParser::handleGetById( 1571 1600 int destinationOperand, SpeculatedType prediction, NodeIndex base, unsigned identifierNumber, … … 1621 1650 } 1622 1651 1623 NodeIndex propertyStorage; 1624 size_t offsetOffset; 1625 if (useInlineStorage) { 1626 propertyStorage = base; 1627 ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue))); 1628 offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue); 1629 } else { 1630 propertyStorage = addToGraph(GetPropertyStorage, base); 1631 offsetOffset = 0; 1632 } 1633 set(destinationOperand, 1634 addToGraph( 1635 GetByOffset, OpInfo(m_graph.m_storageAccessData.size()), OpInfo(prediction), 1636 propertyStorage)); 1637 1638 StorageAccessData storageAccessData; 1639 storageAccessData.offset = getByIdStatus.offset() + offsetOffset; 1640 storageAccessData.identifierNumber = identifierNumber; 1641 m_graph.m_storageAccessData.append(storageAccessData); 1652 handleGetByOffset( 1653 destinationOperand, prediction, base, identifierNumber, useInlineStorage, 1654 getByIdStatus.offset()); 1642 1655 } 1643 1656 … … 2649 2662 SpeculatedType prediction = getPrediction(); 2650 2663 2664 unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[ 2665 currentInstruction[2].u.operand]; 2666 2667 ResolveGlobalStatus status = ResolveGlobalStatus::computeFor( 2668 m_inlineStackTop->m_profiledBlock, m_currentIndex, 2669 m_codeBlock->identifier(identifierNumber)); 2670 if (status.isSimple()) { 2671 ASSERT(status.structure()); 2672 2673 NodeIndex globalObject = addStructureTransitionCheck( 2674 m_inlineStackTop->m_codeBlock->globalObject(), status.structure()); 2675 2676 if (status.specificValue()) { 2677 ASSERT(status.specificValue().isCell()); 2678 2679 set(currentInstruction[1].u.operand, 2680 cellConstant(status.specificValue().asCell())); 2681 } else { 2682 handleGetByOffset( 2683 currentInstruction[1].u.operand, prediction, globalObject, 2684 identifierNumber, status.structure()->isUsingInlineStorage(), 2685 status.offset()); 2686 } 2687 2688 m_globalResolveNumber++; // Skip over the unused global resolve info. 2689 2690 NEXT_OPCODE(op_resolve_global); 2691 } 2692 2651 2693 NodeIndex resolve = addToGraph(ResolveGlobal, OpInfo(m_graph.m_resolveGlobalData.size()), OpInfo(prediction)); 2652 2694 m_graph.m_resolveGlobalData.append(ResolveGlobalData()); 2653 2695 ResolveGlobalData& data = m_graph.m_resolveGlobalData.last(); 2654 data.identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[2].u.operand];2696 data.identifierNumber = identifierNumber; 2655 2697 data.resolveInfoIndex = m_globalResolveNumber++; 2656 2698 set(currentInstruction[1].u.operand, resolve);
Note:
See TracChangeset
for help on using the changeset viewer.