Ignore:
Timestamp:
Aug 13, 2009, 2:51:50 PM (16 years ago)
Author:
Darin Adler
Message:

JavaScriptCore: JavaScriptCore tweaks to get ready for the parser arena
https://bugs.webkit.org/show_bug.cgi?id=28243

Patch by Darin Adler <Darin Adler> on 2009-08-13
Reviewed by David Levin.

Eliminate dependencies on Nodes.h outside JavaScriptCore,
and cut down on them inside JavaScriptCore.

Change regular expression parsing to use identifiers as
with other strings we parse.

Fix a couple things that are needed to use const Identifier
more, which will be part of the parser arena work.

CollectorHeapIterator.h to be project-internal.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitPushNewScope): Added const.

  • bytecompiler/BytecodeGenerator.h: Ditto.
  • debugger/Debugger.cpp:

(JSC::Debugger::recompileAllJSFunctions): Moved this function
here from WebCore. Here is better since it uses so many internals.
Removed unimportant optimization for the no listener case.

  • debugger/Debugger.h: Ditto. Also removed unneeded include

and tweaked formatting and comments.

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::functionName): Call asFunction instead
of doing the unchecked static_cast.
(JSC::DebuggerCallFrame::calculatedFunctionName): Ditto.

  • jit/JITStubs.cpp:

(JSC::op_call_JSFunction): Call isHostFunction on the body rather
than on the JSFunction.
(JSC::vm_lazyLinkCall): Ditto.
(JSC::op_construct_JSConstruct): Ditto.

  • parser/Grammar.y: Changed callers to use new scanRegExp with

out arguments instead of relying on state in the Lexer. And
callers that just want to skip a regular expression to use
skipRegExp.

  • parser/Lexer.cpp:

(JSC::Lexer::scanRegExp): Changed to use out arguments, and to
add a prefix argument so we can add in the "=" character as needed.
Also rewrote to streamline the logic a bit inspired by suggestions
by David Levin.
(JSC::Lexer::skipRegExp): Added. Version of the function above that
does not actually put the regular expression into a string.
(JSC::Lexer::clear): Removed code to clear m_pattern and m_flags.

  • parser/Lexer.h: Changed scanRegExp to have out arguments. Added

skipRegExp. Eliminated pattern, flags, m_pattern, and m_flags.

  • parser/NodeConstructors.h:

(JSC::RegExpNode::RegExpNode): Changed to take const Identifier&.

  • parser/Nodes.cpp:

(JSC::RegExpNode::emitBytecode): Changed since m_pattern and
m_flags are now Identifier instead of UString.
(JSC::FunctionBodyNode::make): Moved this function here instead
of putting it in the JSFunction.h header.

  • parser/Nodes.h: Changed RegExpNode to use Identifier.
  • profiler/Profiler.cpp:

(JSC::Profiler::createCallIdentifier): Changed to use isHostFunction
on the body instead of on the JSFunction object.

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString): Ditto.

  • runtime/JSFunction.cpp:

(JSC::JSFunction::isHostFunction): Moved here from header.
(JSC::JSFunction::isHostFunctionNonInline): Added.
(JSC::JSFunction::JSFunction): Removed unneeded initialization of
m_body to 0.
(JSC::JSFunction::setBody): Moved here from header.

  • runtime/JSFunction.h: Removed unneeded includes. Moved private

constructor down to the private section. Made virtual functions
private. Removed unneeded overload of setBody and moved the body
of the function into the .cpp file. Changed assertions to use
the non-inline version of isHostFunction.

  • runtime/PropertySlot.cpp:

(JSC::PropertySlot::functionGetter): Use asFunction instead
of doing the unchecked static_cast.

  • wtf/SegmentedVector.h:

(WTF::SegmentedVector::isEmpty): Added.

WebCore: JavaScriptCore tweaks to get ready for the parser arena
https://bugs.webkit.org/show_bug.cgi?id=28243

Patch by Darin Adler <Darin Adler> on 2009-08-13
Reviewed by David Levin.

  • ForwardingHeaders/runtime/CollectorHeapIterator.h: Removed.
  • WebCore.xcodeproj/project.pbxproj: Exposed a couple header

files as Private that are now needed to compile Mac WebKit.

  • bindings/js/JSAudioConstructor.cpp:
  • bindings/js/JSDOMBinding.cpp:
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowCustom.cpp:
  • bindings/js/JSHTMLInputElementCustom.cpp:
  • bindings/js/JSHistoryCustom.cpp:
  • bindings/js/JSImageConstructor.cpp:
  • bindings/js/JSLazyEventListener.cpp:
  • bindings/js/JSLocationCustom.cpp:
  • bindings/js/JSMessageChannelConstructor.cpp:
  • bindings/js/JSOptionConstructor.cpp:
  • bindings/js/JSWebSocketConstructor.cpp:
  • bindings/js/JSWebSocketCustom.cpp:
  • bindings/js/JSWorkerConstructor.cpp:
  • bindings/js/JSXMLHttpRequestConstructor.cpp:
  • bridge/jni/jni_jsobject.mm:

Updated includes.

  • inspector/JavaScriptDebugServer.cpp:

(WebCore::JavaScriptDebugServer::sourceParsed):
Change to not assert if this is called with no listeners.
I don't think this was guaranteed before, and we now use
this code path when recompiling. Slightly less efficient,
but this is a one-time cost when turning on the debugger.
(WebCore::JavaScriptDebugServer::recompileAllJSFunctions):
Change to call Debugger::recompileAllJSFunctions.

WebKit/mac: * Plugins/Hosted/NetscapePluginInstanceProxy.mm: Updated includes.

  • WebView/WebScriptDebugger.mm: Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r47089 r47236  
    9696__ZN3JSC10Identifier3addEPNS_9ExecStateEPKc
    9797__ZN3JSC10Identifier5equalEPKNS_7UString3RepEPKc
    98 __ZN3JSC10JSFunction4infoE
    9998__ZN3JSC10JSFunctionC1EPNS_9ExecStateEN3WTF10PassRefPtrINS_9StructureEEEiRKNS_10IdentifierEPFNS_7JSValueES2_PNS_8JSObjectESA_RKNS_7ArgListEE
    10099__ZN3JSC10throwErrorEPNS_9ExecStateENS_9ErrorTypeE
     
    197196__ZN3JSC6JSCell9getObjectEv
    198197__ZN3JSC6JSCellnwEmPNS_9ExecStateE
     198__ZN3JSC6JSLock12DropAllLocksC1ENS_14JSLockBehaviorE
    199199__ZN3JSC6JSLock12DropAllLocksC1EPNS_9ExecStateE
    200 __ZN3JSC6JSLock12DropAllLocksC1ENS_14JSLockBehaviorE
    201200__ZN3JSC6JSLock12DropAllLocksD1Ev
    202201__ZN3JSC6JSLock4lockENS_14JSLockBehaviorE
     
    228227__ZN3JSC7UStringC1EPKti
    229228__ZN3JSC7UStringaSEPKc
     229__ZN3JSC8Debugger23recompileAllJSFunctionsEPNS_12JSGlobalDataE
    230230__ZN3JSC8Debugger6attachEPNS_14JSGlobalObjectE
    231231__ZN3JSC8Debugger6detachEPNS_14JSGlobalObjectE
    232 __ZN3JSC8DebuggerC2Ev
    233232__ZN3JSC8DebuggerD2Ev
    234233__ZN3JSC8JSObject11hasInstanceEPNS_9ExecStateENS_7JSValueES3_
     
    325324__ZN3WTF8fastFreeEPv
    326325__ZN3WTF9ByteArray6createEm
     326__ZNK3JSC10JSFunction23isHostFunctionNonInlineEv
    327327__ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE
    328328__ZNK3JSC11Interpreter18retrieveLastCallerEPNS_9ExecStateERiRlRNS_7UStringERNS_7JSValueE 
     
    331331__ZNK3JSC12StringObject8toStringEPNS_9ExecStateE
    332332__ZNK3JSC14JSGlobalObject14isDynamicScopeEv
    333 
    334333__ZNK3JSC16FunctionBodyNode14isHostFunctionEv
    335334__ZNK3JSC16InternalFunction9classInfoEv
     
    380379__ZTVN3JSC16JSVariableObjectE
    381380__ZTVN3JSC17JSAPIValueWrapperE
     381__ZTVN3JSC8DebuggerE
    382382__ZTVN3JSC8JSObjectE
    383383__ZTVN3JSC8JSStringE
Note: See TracChangeset for help on using the changeset viewer.