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/interpreter/Interpreter.cpp

    r155013 r155075  
    340340
    341341    DumpRegisterFunctor functor(it);
    342     StackIterator iter = callFrame->begin();
    343     iter.iterate(functor);
     342    callFrame->iterate(functor);
    344343
    345344    dataLogF("[CodeBlock]                | %10p | %p \n", it, callFrame->codeBlock());
     
    553552
    554553    GetStackTraceFunctor functor(vm, results, maxStackSize);
    555     StackIterator iter = callFrame->begin();
    556     iter.iterate(functor);
     554    callFrame->iterate(functor);
    557555}
    558556
     
    641639    ASSERT(callFrame == vm.topCallFrame);
    642640    UnwindFunctor functor(callFrame, exceptionValue, isTermination, codeBlock, handler);
    643     StackIterator iter = callFrame->begin();
    644     iter.iterate(functor);
     641    callFrame->iterate(functor);
    645642    if (!handler)
    646643        return 0;
Note: See TracChangeset for help on using the changeset viewer.