Ignore:
Timestamp:
Nov 11, 2007, 8:27:33 PM (18 years ago)
Author:
[email protected]
Message:

Reviewed by Sam Weinig.


Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
15% of string-validate-input.js is spent compiling the same regular expression


Store a compiled representation of the regular expression in the AST.


Only a .2% SunSpider speedup overall, but a 10.6% speedup on
string-validate-input.js.

  • kjs/nodes.cpp: (KJS::RegExpNode::evaluate):
  • kjs/nodes.h: (KJS::RegExpNode::):
  • kjs/nodes2string.cpp: (KJS::RegExpNode::streamTo):
  • kjs/regexp.cpp: (KJS::RegExp::flags):
  • kjs/regexp.h: (KJS::RegExp::pattern):
  • kjs/regexp_object.cpp: (KJS::RegExpObjectImp::construct): (KJS::RegExpObjectImp::createRegExpImp):
  • kjs/regexp_object.h:
File:
1 edited

Legend:

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

    r27571 r27702  
    8686        virtual bool implementsConstruct() const;
    8787        virtual JSObject* construct(ExecState*, const List&);
     88        JSObject* createRegExpImp(ExecState*, PassRefPtr<RegExp>);
    8889        virtual JSValue* callAsFunction(ExecState*, JSObject*, const List&);
    8990        virtual void put(ExecState*, const Identifier&, JSValue*, int attributes = None);
Note: See TracChangeset for help on using the changeset viewer.