Ignore:
Timestamp:
Sep 21, 2011, 12:59:39 PM (14 years ago)
Author:
[email protected]
Message:

Replace jsFunctionVPtr compares with a type check on the Structure.
https://bugs.webkit.org/show_bug.cgi?id=68557

Reviewed by Oliver Hunt.

This will permit calls to still optimize to subclasses of JSFunction
that have the correct type (but a different C++ vptr).

This patch stops passing the globalData into numerous functions.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::isFunctionConstant):
(JSC::DFG::Graph::valueOfFunctionConstant):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::isFunctionConstant):
(JSC::DFG::JITCompiler::valueOfFunctionConstant):

  • dfg/DFGOperations.cpp:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::privateExecute):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCallVarargs):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCallVarargs):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitJumpIfNotType):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/Executable.h:

(JSC::isHostFunction):

  • runtime/JSFunction.h:

(JSC::JSFunction::createStructure):

  • runtime/JSObject.cpp:

(JSC::JSObject::put):
(JSC::JSObject::putWithAttributes):

  • runtime/JSObject.h:

(JSC::getJSFunction):
(JSC::JSObject::putDirect):
(JSC::JSObject::putDirectWithoutTransition):

  • runtime/JSType.h:
File:
1 edited

Legend:

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

    r95503 r95666  
    129129        prototype = obj->prototype();
    130130        if (prototype.isNull()) {
    131             if (!putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(globalData, value)) && slot.isStrictMode())
     131            if (!putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(value)) && slot.isStrictMode())
    132132                throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
    133133            return;
     
    172172    }
    173173   
    174     if (!putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(globalData, value)) && slot.isStrictMode())
     174    if (!putDirectInternal(globalData, propertyName, value, 0, true, slot, getJSFunction(value)) && slot.isStrictMode())
    175175        throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
    176176    return;
     
    185185void JSObject::putWithAttributes(JSGlobalData* globalData, const Identifier& propertyName, JSValue value, unsigned attributes, bool checkReadOnly, PutPropertySlot& slot)
    186186{
    187     putDirectInternal(*globalData, propertyName, value, attributes, checkReadOnly, slot, getJSFunction(*globalData, value));
     187    putDirectInternal(*globalData, propertyName, value, attributes, checkReadOnly, slot, getJSFunction(value));
    188188}
    189189
     
    191191{
    192192    PutPropertySlot slot;
    193     putDirectInternal(*globalData, propertyName, value, attributes, true, slot, getJSFunction(*globalData, value));
     193    putDirectInternal(*globalData, propertyName, value, attributes, true, slot, getJSFunction(value));
    194194}
    195195
     
    202202{
    203203    JSGlobalData& globalData = exec->globalData();
    204     putDirectInternal(globalData, propertyName, value, attributes, checkReadOnly, slot, getJSFunction(globalData, value));
     204    putDirectInternal(globalData, propertyName, value, attributes, checkReadOnly, slot, getJSFunction(value));
    205205}
    206206
     
    209209    PutPropertySlot slot;
    210210    JSGlobalData& globalData = exec->globalData();
    211     putDirectInternal(globalData, propertyName, value, attributes, true, slot, getJSFunction(globalData, value));
     211    putDirectInternal(globalData, propertyName, value, attributes, true, slot, getJSFunction(value));
    212212}
    213213
Note: See TracChangeset for help on using the changeset viewer.