Changeset 24532 in webkit for trunk/JavaScriptCore/kjs/nodes.h


Ignore:
Timestamp:
Jul 23, 2007, 12:10:35 AM (18 years ago)
Author:
mjs
Message:

Reviewed by Darin.

-fixed <rdar://problem/5353293> REGRESSION (r24287): 1% i-Bench JS slowdown from JavaScript compatibility fix (14719)
http://bugs.webkit.org/show_bug.cgi?id=14719


My fix for this actually resulted in JS iBench being 1% faster than before the regression
and the Celtic Kane benchmark being 5% faster than before the regression.


  • kjs/nodes.cpp: (VarDeclNode::handleSlowCase): factored out the slow code path to be out of line. (VarDeclNode::evaluate): I did a couple of things: (1) Don't check if the variable is already declared by looking for the property in the variable object, that code path was dead code. (2) Special-case the common case where the top of the scope and the variable object are the same; in that case the variable must always be in the variable object. (3) Don't return a jsString() of the variable name, nothing uses the return value from this node types evaluate method.
  • kjs/nodes.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.h

    r21080 r24532  
    3535#else
    3636#define KJS_FAST_CALL
     37#endif
     38
     39#if COMPILER(GCC)
     40#define KJS_NO_INLINE __attribute__((noinline))
     41#else
     42#define KJS_NO_INLINE
    3743#endif
    3844
     
    784790  };
    785791
    786   class VarDeclNode : public Node {
     792  class VarDeclNode: public Node {
    787793  public:
    788794    enum Type { Variable, Constant };
     
    792798    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    793799  private:
     800    JSValue* handleSlowCase(ExecState*, const ScopeChain&, JSValue*) KJS_FAST_CALL KJS_NO_INLINE;
    794801    Type varType;
    795802    Identifier ident;
Note: See TracChangeset for help on using the changeset viewer.