Ignore:
Timestamp:
Jun 15, 2012, 3:14:53 PM (13 years ago)
Author:
[email protected]
Message:

DFG should be able to set watchpoints on structure transitions in the
method check prototype chain
https://bugs.webkit.org/show_bug.cgi?id=89058

Source/JavaScriptCore:

Reviewed by Gavin Barraclough.

This adds the ability to set watchpoints on Structures, and then does
the most modest thing we can do with this ability: the DFG now sets
watchpoints on structure transitions in the prototype chain of method
checks.

This appears to be a >1% speed-up on V8.

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeFromLLInt):
(JSC::PutByIdStatus::computeFor):

  • bytecode/StructureSet.h:

(JSC::StructureSet::containsOnly):
(StructureSet):

  • bytecode/Watchpoint.cpp:

(JSC::WatchpointSet::WatchpointSet):
(JSC::InlineWatchpointSet::add):
(JSC):
(JSC::InlineWatchpointSet::inflateSlow):
(JSC::InlineWatchpointSet::freeFat):

  • bytecode/Watchpoint.h:

(WatchpointSet):
(JSC):
(InlineWatchpointSet):
(JSC::InlineWatchpointSet::InlineWatchpointSet):
(JSC::InlineWatchpointSet::~InlineWatchpointSet):
(JSC::InlineWatchpointSet::hasBeenInvalidated):
(JSC::InlineWatchpointSet::isStillValid):
(JSC::InlineWatchpointSet::startWatching):
(JSC::InlineWatchpointSet::notifyWrite):
(JSC::InlineWatchpointSet::isFat):
(JSC::InlineWatchpointSet::fat):
(JSC::InlineWatchpointSet::inflate):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
(ByteCodeParser):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
(CSEPhase):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGCommon.h:
  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::isCellConstant):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::addWeakReferences):
(JITCompiler):

  • dfg/DFGNode.h:

(JSC::DFG::Node::hasStructure):
(Node):
(JSC::DFG::Node::structure):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGRepatch.cpp:

(JSC::DFG::emitPutTransitionStub):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JITStubs.cpp:

(JSC::JITThunks::tryCachePutByID):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/Structure.cpp:

(JSC::Structure::Structure):

  • runtime/Structure.h:

(JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
(Structure):
(JSC::Structure::transitionWatchpointSetIsStillValid):
(JSC::Structure::addTransitionWatchpoint):
(JSC::Structure::notifyTransitionFromThisStructure):
(JSC::JSCell::setStructure):

  • runtime/SymbolTable.cpp:

(JSC::SymbolTableEntry::attemptToWatch):

LayoutTests:

Rubber stamped by Gavin Barraclough.

  • fast/js/dfg-call-method-hit-watchpoint-expected.txt: Added.
  • fast/js/dfg-call-method-hit-watchpoint.html: Added.
  • fast/js/script-tests/dfg-call-method-hit-watchpoint.js: Added.

(Thingy):
(Thingy.prototype.foo):
(callFoo):
(.Thingy.prototype.foo):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r120244 r120499  
     12012-06-13  Filip Pizlo  <[email protected]>
     2
     3        DFG should be able to set watchpoints on structure transitions in the
     4        method check prototype chain
     5        https://bugs.webkit.org/show_bug.cgi?id=89058
     6
     7        Reviewed by Gavin Barraclough.
     8       
     9        This adds the ability to set watchpoints on Structures, and then does
     10        the most modest thing we can do with this ability: the DFG now sets
     11        watchpoints on structure transitions in the prototype chain of method
     12        checks.
     13       
     14        This appears to be a >1% speed-up on V8.
     15
     16        * bytecode/PutByIdStatus.cpp:
     17        (JSC::PutByIdStatus::computeFromLLInt):
     18        (JSC::PutByIdStatus::computeFor):
     19        * bytecode/StructureSet.h:
     20        (JSC::StructureSet::containsOnly):
     21        (StructureSet):
     22        * bytecode/Watchpoint.cpp:
     23        (JSC::WatchpointSet::WatchpointSet):
     24        (JSC::InlineWatchpointSet::add):
     25        (JSC):
     26        (JSC::InlineWatchpointSet::inflateSlow):
     27        (JSC::InlineWatchpointSet::freeFat):
     28        * bytecode/Watchpoint.h:
     29        (WatchpointSet):
     30        (JSC):
     31        (InlineWatchpointSet):
     32        (JSC::InlineWatchpointSet::InlineWatchpointSet):
     33        (JSC::InlineWatchpointSet::~InlineWatchpointSet):
     34        (JSC::InlineWatchpointSet::hasBeenInvalidated):
     35        (JSC::InlineWatchpointSet::isStillValid):
     36        (JSC::InlineWatchpointSet::startWatching):
     37        (JSC::InlineWatchpointSet::notifyWrite):
     38        (JSC::InlineWatchpointSet::isFat):
     39        (JSC::InlineWatchpointSet::fat):
     40        (JSC::InlineWatchpointSet::inflate):
     41        * dfg/DFGAbstractState.cpp:
     42        (JSC::DFG::AbstractState::execute):
     43        * dfg/DFGByteCodeParser.cpp:
     44        (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
     45        (ByteCodeParser):
     46        (JSC::DFG::ByteCodeParser::parseBlock):
     47        * dfg/DFGCSEPhase.cpp:
     48        (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
     49        (CSEPhase):
     50        (JSC::DFG::CSEPhase::performNodeCSE):
     51        * dfg/DFGCommon.h:
     52        * dfg/DFGGraph.cpp:
     53        (JSC::DFG::Graph::dump):
     54        * dfg/DFGGraph.h:
     55        (JSC::DFG::Graph::isCellConstant):
     56        * dfg/DFGJITCompiler.h:
     57        (JSC::DFG::JITCompiler::addWeakReferences):
     58        (JITCompiler):
     59        * dfg/DFGNode.h:
     60        (JSC::DFG::Node::hasStructure):
     61        (Node):
     62        (JSC::DFG::Node::structure):
     63        * dfg/DFGNodeType.h:
     64        (DFG):
     65        * dfg/DFGPredictionPropagationPhase.cpp:
     66        (JSC::DFG::PredictionPropagationPhase::propagate):
     67        * dfg/DFGRepatch.cpp:
     68        (JSC::DFG::emitPutTransitionStub):
     69        * dfg/DFGSpeculativeJIT64.cpp:
     70        (JSC::DFG::SpeculativeJIT::compile):
     71        * jit/JITStubs.cpp:
     72        (JSC::JITThunks::tryCachePutByID):
     73        * llint/LLIntSlowPaths.cpp:
     74        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     75        * runtime/Structure.cpp:
     76        (JSC::Structure::Structure):
     77        * runtime/Structure.h:
     78        (JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
     79        (Structure):
     80        (JSC::Structure::transitionWatchpointSetIsStillValid):
     81        (JSC::Structure::addTransitionWatchpoint):
     82        (JSC::Structure::notifyTransitionFromThisStructure):
     83        (JSC::JSCell::setStructure):
     84        * runtime/SymbolTable.cpp:
     85        (JSC::SymbolTableEntry::attemptToWatch):
     86
    1872012-06-13  Filip Pizlo  <[email protected]>
    288
Note: See TracChangeset for help on using the changeset viewer.