Ignore:
Timestamp:
Aug 16, 2013, 12:15:31 PM (12 years ago)
Author:
[email protected]
Message:

Object properties added using dot syntax (o.f = ...) from code that isn't in eval should be less likely to cause an object to become a dictionary
https://bugs.webkit.org/show_bug.cgi?id=119897

Source/JavaScriptCore:

Reviewed by Oliver Hunt.

6-10x speed-up on microbenchmarks that create large static objects. 40-65% speed-up
on Octane/gbemu. 3% overall speed-up on Octane. No slow-downs anywhere; our ability
to turn objects into dictionaries when you're storing using bracket syntax or using
eval is still in place.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::putByIdContext):

  • dfg/DFGOperations.cpp:
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/JSObject.h:

(JSC::JSObject::putDirectInternal):

  • runtime/PutPropertySlot.h:

(JSC::PutPropertySlot::PutPropertySlot):
(JSC::PutPropertySlot::context):

  • runtime/Structure.cpp:

(JSC::Structure::addPropertyTransition):

  • runtime/Structure.h:

LayoutTests:

Reviewed by Oliver Hunt.

  • fast/js/regress/lots-of-fields-expected.txt: Added.
  • fast/js/regress/lots-of-fields.html: Added.
  • fast/js/regress/script-tests/lots-of-fields.js: Added.

(foo):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r154159 r154199  
    476476    STUB_INIT_STACK_FRAME(stackFrame);
    477477
    478     PutPropertySlot slot(stackFrame.callFrame->codeBlock()->isStrictMode());
     478    PutPropertySlot slot(
     479        stackFrame.callFrame->codeBlock()->isStrictMode(),
     480        stackFrame.callFrame->codeBlock()->putByIdContext());
    479481    stackFrame.args[0].jsValue().put(stackFrame.callFrame, stackFrame.args[1].identifier(), stackFrame.args[2].jsValue(), slot);
    480482    CHECK_FOR_EXCEPTION_AT_END();
     
    485487    STUB_INIT_STACK_FRAME(stackFrame);
    486488   
    487     PutPropertySlot slot(stackFrame.callFrame->codeBlock()->isStrictMode());
     489    PutPropertySlot slot(
     490        stackFrame.callFrame->codeBlock()->isStrictMode(),
     491        stackFrame.callFrame->codeBlock()->putByIdContext());
    488492    JSValue baseValue = stackFrame.args[0].jsValue();
    489493    ASSERT(baseValue.isObject());
     
    517521    AccessType accessType = static_cast<AccessType>(stubInfo->accessType);
    518522
    519     PutPropertySlot slot(callFrame->codeBlock()->isStrictMode());
     523    PutPropertySlot slot(
     524        callFrame->codeBlock()->isStrictMode(),
     525        callFrame->codeBlock()->putByIdContext());
    520526    stackFrame.args[0].jsValue().put(callFrame, ident, stackFrame.args[2].jsValue(), slot);
    521527   
     
    538544    AccessType accessType = static_cast<AccessType>(stubInfo->accessType);
    539545
    540     PutPropertySlot slot(callFrame->codeBlock()->isStrictMode());
     546    PutPropertySlot slot(
     547        callFrame->codeBlock()->isStrictMode(),
     548        callFrame->codeBlock()->putByIdContext());
    541549    JSValue baseValue = stackFrame.args[0].jsValue();
    542550    ASSERT(baseValue.isObject());
     
    559567    Identifier& ident = stackFrame.args[1].identifier();
    560568   
    561     PutPropertySlot slot(callFrame->codeBlock()->isStrictMode());
     569    PutPropertySlot slot(
     570        callFrame->codeBlock()->isStrictMode(),
     571        callFrame->codeBlock()->putByIdContext());
    562572    stackFrame.args[0].jsValue().put(callFrame, ident, stackFrame.args[2].jsValue(), slot);
    563573
     
    572582    Identifier& ident = stackFrame.args[1].identifier();
    573583   
    574     PutPropertySlot slot(callFrame->codeBlock()->isStrictMode());
     584    PutPropertySlot slot(
     585        callFrame->codeBlock()->isStrictMode(),
     586        callFrame->codeBlock()->putByIdContext());
    575587    JSValue baseValue = stackFrame.args[0].jsValue();
    576588    ASSERT(baseValue.isObject());
Note: See TracChangeset for help on using the changeset viewer.