Ignore:
Timestamp:
Sep 10, 2008, 2:23:35 AM (17 years ago)
Author:
[email protected]
Message:

Add optimised access to known properties on the global object.

Reviewed by Maciej Stachowiak

Improve cross scope access to the global object by emitting
code to access it directly rather than by walking the scope chain.

This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeGenerator.h

    r36263 r36317  
    104104        // NB: depth does _not_ include the local scope.  eg. a depth of 0 refers
    105105        // to the scope containing this codeblock.
    106         bool findScopedProperty(const Identifier&, int& index, size_t& depth, bool forWriting);
     106        bool findScopedProperty(const Identifier&, int& index, size_t& depth, bool forWriting, JSValue*& globalObject);
    107107
    108108        // Returns the register storing "this"
     
    257257
    258258        RegisterID* emitResolve(RegisterID* dst, const Identifier& property);
    259         RegisterID* emitGetScopedVar(RegisterID* dst, size_t skip, int index);
    260         RegisterID* emitPutScopedVar(size_t skip, int index, RegisterID* value);
     259        RegisterID* emitGetScopedVar(RegisterID* dst, size_t skip, int index, JSValue* globalObject);
     260        RegisterID* emitPutScopedVar(size_t skip, int index, RegisterID* value, JSValue* globalObject);
    261261
    262262        RegisterID* emitResolveBase(RegisterID* dst, const Identifier& property);
Note: See TracChangeset for help on using the changeset viewer.