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


Ignore:
Timestamp:
Oct 14, 2007, 4:31:58 AM (18 years ago)
Author:
bdash
Message:

2007-10-14 Cameron Zwarich <[email protected]>

Reviewed by Darin.

Adds NegateNode optimization from KJS. The relevant revision in KDE
is 666736.

  • kjs/grammar.y:
  • kjs/nodes.cpp: (NumberNode::evaluate):
  • kjs/nodes.h: (KJS::Node::): (KJS::NumberNode::):
  • kjs/nodes2string.cpp: (NumberNode::streamTo):

2007-10-14 Cameron Zwarich <[email protected]>

Reviewed by Darin.

Adds serialization test cases for NegateNode optimization from KDE.

  • fast/js/function-decompilation-operators-expected.txt:
  • fast/js/function-decompilation-operators.html:
File:
1 edited

Legend:

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

    r24532 r26582  
    101101    virtual Node *nodeInsideAllParens() KJS_FAST_CALL;
    102102
     103    virtual bool isNumber() const KJS_FAST_CALL { return false; }
    103104    virtual bool isLocation() const KJS_FAST_CALL { return false; }
    104105    virtual bool isResolveNode() const KJS_FAST_CALL { return false; }
     
    168169  class NumberNode : public Node {
    169170  public:
    170     NumberNode(double v) KJS_FAST_CALL : value(v) {}
    171     JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    172     virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    173   private:
    174     double value;
     171    NumberNode(double v) KJS_FAST_CALL : val(v) {}
     172    JSValue* evaluate(ExecState*) KJS_FAST_CALL;
     173    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
     174
     175    virtual bool isNumber() const KJS_FAST_CALL { return true; }
     176    double value() const KJS_FAST_CALL { return val; }
     177    void setValue(double v) KJS_FAST_CALL { val = v; }
     178  private:
     179    double val;
    175180  };
    176181
Note: See TracChangeset for help on using the changeset viewer.