Ignore:
Timestamp:
Jun 20, 2012, 6:38:49 PM (13 years ago)
Author:
[email protected]
Message:

DFG should optimize ResolveGlobal
https://bugs.webkit.org/show_bug.cgi?id=89617

Reviewed by Oliver Hunt.

This adds inlining of ResolveGlobal accesses that are known monomorphic. It also
adds the specific function optimization to ResolveGlobal, when it is inlined. And,
it makes internal functions act like specific functions, since that will be the
most common use-case of this optimization.

This is only a slighy speed-up (sub 1%), since we don't yet do the obvious thing
with this optimization, which is to completely inline common "globally resolved"
function and constructor calls, like "new Array()".

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Target.pri:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::globalResolveInfoForBytecodeOffset):

  • bytecode/CodeBlock.h:

(CodeBlock):
(JSC::CodeBlock::numberOfGlobalResolveInfos):

  • bytecode/GlobalResolveInfo.h:

(JSC::getGlobalResolveInfoBytecodeOffset):
(JSC):

  • bytecode/ResolveGlobalStatus.cpp: Added.

(JSC):
(JSC::computeForStructure):
(JSC::computeForLLInt):
(JSC::ResolveGlobalStatus::computeFor):

  • bytecode/ResolveGlobalStatus.h: Added.

(JSC):
(ResolveGlobalStatus):
(JSC::ResolveGlobalStatus::ResolveGlobalStatus):
(JSC::ResolveGlobalStatus::state):
(JSC::ResolveGlobalStatus::isSet):
(JSC::ResolveGlobalStatus::operator!):
(JSC::ResolveGlobalStatus::isSimple):
(JSC::ResolveGlobalStatus::takesSlowPath):
(JSC::ResolveGlobalStatus::structure):
(JSC::ResolveGlobalStatus::offset):
(JSC::ResolveGlobalStatus::specificValue):

  • dfg/DFGByteCodeParser.cpp:

(ByteCodeParser):
(JSC::DFG::ByteCodeParser::handleGetByOffset):
(DFG):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::parseBlock):

  • runtime/JSObject.cpp:

(JSC::getCallableObjectSlow):
(JSC):
(JSC::JSObject::put):
(JSC::JSObject::putDirectVirtual):
(JSC::JSObject::putDirectAccessor):

  • runtime/JSObject.h:

(JSC):
(JSC::getCallableObject):
(JSC::JSObject::putOwnDataProperty):
(JSC::JSObject::putDirect):
(JSC::JSObject::putDirectWithoutTransition):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r120751 r120897  
    554554        GlobalResolveInfo& globalResolveInfo(int index) { return m_globalResolveInfos[index]; }
    555555        bool hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset);
     556        GlobalResolveInfo& globalResolveInfoForBytecodeOffset(unsigned bytecodeOffset);
     557        unsigned numberOfGlobalResolveInfos() { return m_globalResolveInfos.size(); }
    556558
    557559        void setNumberOfCallLinkInfos(size_t size) { m_callLinkInfos.grow(size); }
Note: See TracChangeset for help on using the changeset viewer.