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/PutPropertySlot.h

    r121925 r154199  
    3838    public:
    3939        enum Type { Uncachable, ExistingProperty, NewProperty };
     40        enum Context { UnknownContext, PutById, PutByIdEval };
    4041
    41         PutPropertySlot(bool isStrictMode = false)
     42        PutPropertySlot(bool isStrictMode = false, Context context = UnknownContext)
    4243            : m_type(Uncachable)
    4344            , m_base(0)
    4445            , m_isStrictMode(isStrictMode)
     46            , m_context(context)
    4547        {
    4648        }
     
    5961            m_offset = offset;
    6062        }
     63       
     64        Context context() const { return static_cast<Context>(m_context); }
    6165
    6266        Type type() const { return m_type; }
     
    7680        PropertyOffset m_offset;
    7781        bool m_isStrictMode;
     82        uint8_t m_context;
    7883    };
    7984
Note: See TracChangeset for help on using the changeset viewer.