Ignore:
Timestamp:
Sep 12, 2014, 10:21:44 PM (11 years ago)
Author:
[email protected]
Message:

Add JSCallee to program and eval CallFrames
https://bugs.webkit.org/show_bug.cgi?id=136785

Reviewed by Mark Lam.

Populated Callee slot for program and call eval CallFrames with a JSCallee objects.
Made supporting changes including adding a JSCallee structure to global object and adding
JSCallee::create() method. Added code so that the newly added callee object won't be
returned by Function.caller. Changed null pointer checks of callee to check the if
the type is JSFunction* or JSCallee*.

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::functionName):
(JSC::DebuggerCallFrame::type):

  • profiler/LegacyProfiler.cpp:

(JSC::LegacyProfiler::createCallIdentifier):

  • interpreter/Interpreter.cpp:

(JSC::unwindCallFrame):
Changed checks of callee is a JSFunction* or JSCallee* instead of just checking
if it is null or not.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::execute): Create and use JSCallee objects for execute(EvalExecutable, ...)
and execute(ProgramExecutable, ...)

  • jit/JITCode.cpp:

(JSC::JITCode::execute): Use jsDynamicCast to cast only JSFunctions.

  • runtime/JSCallee.cpp:

(JSC::JSCallee::create): Not used, therefore deleted.

  • runtime/JSCallee.h:

(JSC::JSCallee::create): Added.

  • runtime/JSFunction.cpp:

(JSC::JSFunction::callerGetter): Added test to return null for JSCallee's that aren't
JSFunction's. This can only be the case when the JSCallee comes from a program or
call eval CallFrame.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::reset):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::calleeStructure):
Added new JSCallee structure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r173517 r173600  
    444444    if (Debugger* debugger = callFrame->vmEntryGlobalObject()->debugger()) {
    445445        ClearExceptionScope scope(&callFrame->vm());
    446         if (callFrame->callee())
     446        if (jsDynamicCast<JSFunction*>(callFrame->callee()))
    447447            debugger->returnEvent(callFrame);
    448448        else
     
    915915
    916916    ProtoCallFrame protoCallFrame;
    917     protoCallFrame.init(codeBlock, scope, 0, thisObj, 1);
     917    protoCallFrame.init(codeBlock, scope, JSCallee::create(vm, scope->globalObject(), scope), thisObj, 1);
    918918
    919919    if (LegacyProfiler* profiler = vm.enabledProfiler())
     
    11961196
    11971197    ProtoCallFrame protoCallFrame;
    1198     protoCallFrame.init(codeBlock, scope, 0, thisValue, 1);
     1198    protoCallFrame.init(codeBlock, scope, JSCallee::create(vm, scope->globalObject(), scope), thisValue, 1);
    11991199
    12001200    if (LegacyProfiler* profiler = vm.enabledProfiler())
Note: See TracChangeset for help on using the changeset viewer.