Ignore:
Timestamp:
Sep 4, 2013, 3:33:57 PM (12 years ago)
Author:
[email protected]
Message:

Refining the StackIterator callback interface.
https://bugs.webkit.org/show_bug.cgi?id=120695.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Introduce CallFrame::iterate() which instantiates a StackIterator and
invoke its iterate() method with the passed in functor. The only place
where the client code gets access to the StackIterator now is as an
argument to the client's functor.

  • API/JSContextRef.cpp:

(JSContextCreateBacktrace):

  • interpreter/CallFrame.cpp:
  • interpreter/CallFrame.h:

(JSC::ExecState::iterate):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::dumpRegisters):
(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::unwind):

  • interpreter/StackIterator.cpp:

(JSC::StackIterator::StackIterator):
(DebugPrintFrameFunctor::DebugPrintFrameFunctor):
(DebugPrintFrameFunctor::operator()):
(debugPrintCallFrame):
(debugPrintStack):

  • interpreter/StackIterator.h:

(JSC::StackIterator::iterate):

  • jsc.cpp:

(functionJSCStack):

  • profiler/ProfileGenerator.cpp:

(JSC::ProfileGenerator::addParentForConsoleStart):

  • runtime/JSFunction.cpp:

(JSC::retrieveArguments):
(JSC::RetrieveCallerFunctionFunctor::operator()):
(JSC::retrieveCallerFunction):

  • runtime/JSGlobalObjectFunctions.cpp:

(JSC::globalFuncProtoGetter):
(JSC::globalFuncProtoSetter):

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorGetPrototypeOf):

Source/WebCore:

No new tests.

  • bindings/js/JSXMLHttpRequestCustom.cpp:

(WebCore::SendFunctor::SendFunctor):
(WebCore::SendFunctor::line):
(WebCore::SendFunctor::url):
(WebCore::SendFunctor::operator()):
(WebCore::JSXMLHttpRequest::send):

  • bindings/js/ScriptCallStackFactory.cpp:

(WebCore::createScriptCallStack):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp

    r155013 r155075  
    745745
    746746    GlobalFuncProtoGetterFunctor functor(thisObject);
    747     StackIterator iter = exec->begin();
    748     iter.iterate(functor);
     747    exec->iterate(functor);
    749748    return functor.result();
    750749}
     
    789788
    790789    GlobalFuncProtoSetterFunctor functor(thisObject);
    791     StackIterator iter = exec->begin();
    792     iter.iterate(functor);
     790    exec->iterate(functor);
    793791    if (!functor.allowsAccess())
    794792        return JSValue::encode(jsUndefined());
Note: See TracChangeset for help on using the changeset viewer.