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/runtime/Structure.h

    r154127 r154199  
    3737#include "PropertyOffset.h"
    3838#include "Protect.h"
     39#include "PutPropertySlot.h"
    3940#include "StructureRareData.h"
    4041#include "StructureTransitionTable.h"
     
    9697    static void dumpStatistics();
    9798
    98     JS_EXPORT_PRIVATE static Structure* addPropertyTransition(VM&, Structure*, PropertyName, unsigned attributes, JSCell* specificValue, PropertyOffset&);
     99    JS_EXPORT_PRIVATE static Structure* addPropertyTransition(VM&, Structure*, PropertyName, unsigned attributes, JSCell* specificValue, PropertyOffset&, PutPropertySlot::Context = PutPropertySlot::UnknownContext);
    99100    static Structure* addPropertyTransitionToExistingStructureConcurrently(Structure*, StringImpl* uid, unsigned attributes, JSCell* specificValue, PropertyOffset&);
    100101    JS_EXPORT_PRIVATE static Structure* addPropertyTransitionToExistingStructure(Structure*, PropertyName, unsigned attributes, JSCell* specificValue, PropertyOffset&);
     
    465466
    466467    static const int s_maxTransitionLength = 64;
     468    static const int s_maxTransitionLengthForNonEvalPutById = 512;
    467469
    468470    static const unsigned maxSpecificFunctionThrashCount = 3;
Note: See TracChangeset for help on using the changeset viewer.