1. 13 Jul, 2012 1 commit
    • fpizlo@apple.com's avatar
      DFG property access stubs should use structure transition watchpoints · cf716121
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=91135
      
      Reviewed by Geoffrey Garen.
      
      Source/JavaScriptCore: 
      
      This adds a Watchpoint subclass that will clear a structure stub (i.e.
      a property access stub) when fired. The DFG stub generation code now
      uses this optimization.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CodeBlock.cpp:
      (JSC):
      (JSC::CodeBlock::finalizeUnconditionally):
      (JSC::CodeBlock::resetStub):
      (JSC::CodeBlock::resetStubInternal):
      * bytecode/CodeBlock.h:
      (JSC):
      (CodeBlock):
      * bytecode/StructureStubClearingWatchpoint.cpp: Added.
      (JSC):
      (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
      (JSC::StructureStubClearingWatchpoint::push):
      (JSC::StructureStubClearingWatchpoint::fireInternal):
      (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo):
      (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
      (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
      * bytecode/StructureStubClearingWatchpoint.h: Added.
      (JSC):
      (StructureStubClearingWatchpoint):
      (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
      (WatchpointsOnStructureStubInfo):
      (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
      (JSC::WatchpointsOnStructureStubInfo::codeBlock):
      (JSC::WatchpointsOnStructureStubInfo::stubInfo):
      * bytecode/StructureStubInfo.h:
      (JSC::StructureStubInfo::reset):
      (JSC::StructureStubInfo::addWatchpoint):
      (StructureStubInfo):
      * dfg/DFGRepatch.cpp:
      (JSC::DFG::addStructureTransitionCheck):
      (DFG):
      (JSC::DFG::generateProtoChainAccessStub):
      (JSC::DFG::emitPutTransitionStub):
      * jit/JumpReplacementWatchpoint.h:
      
      LayoutTests: 
      
      * fast/js/dfg-proto-stub-watchpoint-fire-expected.txt: Added.
      * fast/js/dfg-proto-stub-watchpoint-fire.html: Added.
      * fast/js/script-tests/dfg-proto-stub-watchpoint-fire.js: Added.
      (A):
      (B):
      (foo):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122544 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cf716121