1. 08 Nov, 2007 1 commit
    • eric@webkit.org's avatar
      2007-11-07 Eric Seidel <eric@webkit.org> · f02d3796
      eric@webkit.org authored
              Reviewed by Darin and Oliver.
              
              Add evaluateToNumber parallel evaluation tree to speed up number operations.
              Make ImmediateNumberNode a subclass of NumberNode.
              Share evaluate logic between evaluate and evaluateToNumber using inline functions
              There is still a lot of improvement to be made here.
              
              SunSpider claims this is a 1.0% speedup overall (nbody 7.9%), base64 slowing 2.0%
              Given the huge win that this prepares us for with simple type inferencing I see the small
              regression in base64 being worth the substantial overall improvement.
      
              * kjs/grammar.y:
              * kjs/nodes.cpp:
              (KJS::Node::evaluateToNumber):
              (KJS::NumberNode::evaluate):
              (KJS::NumberNode::evaluateToNumber):
              (KJS::StringNode::evaluateToNumber):
              (KJS::LocalVarAccessNode::inlineEvaluate):
              (KJS::LocalVarAccessNode::evaluate):
              (KJS::LocalVarAccessNode::evaluateToNumber):
              (KJS::BracketAccessorNode::inlineEvaluate):
              (KJS::BracketAccessorNode::evaluate):
              (KJS::BracketAccessorNode::evaluateToNumber):
              (KJS::NegateNode::evaluate):
              (KJS::NegateNode::evaluateToNumber):
              (KJS::MultNode::inlineEvaluateToNumber):
              (KJS::MultNode::evaluate):
              (KJS::MultNode::evaluateToNumber):
              (KJS::DivNode::inlineEvaluateToNumber):
              (KJS::DivNode::evaluate):
              (KJS::DivNode::evaluateToNumber):
              (KJS::ModNode::inlineEvaluateToNumber):
              (KJS::ModNode::evaluate):
              (KJS::ModNode::evaluateToNumber):
              (KJS::throwOutOfMemoryErrorToNumber):
              (KJS::addSlowCaseToNumber):
              (KJS::add):
              (KJS::addToNumber):
              (KJS::AddNode::evaluateToNumber):
              (KJS::SubNode::inlineEvaluateToNumber):
              (KJS::SubNode::evaluate):
              (KJS::SubNode::evaluateToNumber):
              (KJS::valueForReadModifyAssignment):
              (KJS::ReadModifyLocalVarNode::evaluate):
              (KJS::ReadModifyResolveNode::evaluate):
              (KJS::ReadModifyDotNode::evaluate):
              (KJS::ReadModifyBracketNode::evaluate):
              * kjs/nodes.h:
              (KJS::Node::):
              (KJS::NumberNode::):
              (KJS::ImmediateNumberNode::):
              (KJS::AddNode::precedence):
              * kjs/nodes2string.cpp:
              (KJS::NumberNode::streamTo):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f02d3796
  2. 07 Nov, 2007 8 commits
  3. 06 Nov, 2007 11 commits
  4. 05 Nov, 2007 9 commits
  5. 04 Nov, 2007 3 commits
    • darin@apple.com's avatar
      Reviewed by Maciej. · af5544c6
      darin@apple.com authored
              - http://bugs.webkit.org/show_bug.cgi?id=15826
                optimize opcode loop and case insensitive ASCII compares for a 30% speedup
      
              SunSpider says it's 2.6% faster overall, 32.5% in the regular expression tests.
      
              * pcre/pcre_internal.h: Added OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
      
              * pcre/pcre_compile.c:
              (find_fixedlength): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC. Also
              added OP_NOT since there was no reason it should not be in here.
              (could_be_empty_branch): Ditto.
              (compile_branch): Streamlined all the single-character cases; there was a bit of
              duplicate code. Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC as needed.
              But in particular, compile to those opcodes when the single character match is
              ASCII.
              (find_firstassertedchar): Added cases for OP_ASCII_CHAR and OP_ASCII_LETTER_NC.
      
              * pcre/pcre_exec.c: (match): Removed the "min", "minimize", and "op" fields from
              the matchframe, after I discovered that none of them needed to be saved and restored
              across recursive match calls. Also eliminated the ignored result field from the
              matchframe, since I discovered that rrc ("recursive result code") was already the
              exact same thing. Moved the handling of opcodes higher than OP_BRA into the default
              statement of the switch instead of doing them before the switch. This removes a
              branch from each iteration of the opcode interpreter, just as removal of "op"
              removed at least one store from each iteration. Last, but not least, add the
              OP_ASCII_CHAR and OP_ASCII_LETTER_NC functions. Neither can ever match a
              surrogate pair and the letter case can be handled efficiently.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      af5544c6
    • darin@apple.com's avatar
    • darin@apple.com's avatar
      - fix non-Mac builds; remove some more unused PCRE stuff · 7ecf0c3c
      darin@apple.com authored
              * pcre/pcre_compile.c:
              (compile_branch): Removed branch chain and some unused ESC values.
              (compile_regex): Ditto.
              (jsRegExpCompile): Ditto.
              * pcre/pcre_exec.c:
              (match): Removed unused branch targets. Don't use macros any more.
              (jsRegExpExecute): More of the same.
      
              * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update for removed files.
              * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
              * pcre/pcre.pri: Ditto.
      
              * pcre/MERGING: Removed.
              * pcre/pcre_fullinfo.c: Removed.
              * pcre/pcre_get.c: Removed.
              * pcre/pcre_internal.h:
              * pcre/ucp.h: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7ecf0c3c
  6. 03 Nov, 2007 8 commits
    • darin@apple.com's avatar
      JavaScriptCore: · a7c3b87f
      darin@apple.com authored
              Reviewed by Maciej.
      
              - http://bugs.webkit.org/show_bug.cgi?id=15821
                remove unused PCRE features for speed
      
              A first step toward removing the PCRE features we don't use.
              This gives a 0.8% speedup on SunSpider, and a 6.5% speedup on
              the SunSpider regular expression test.
      
              Replaced the public interface with one that doesn't use the
              name PCRE. Removed code we don't need for JavaScript and various
              configurations we don't use. This is in preparation for still
              more changes in the future. We'll probably switch to C++ and
              make some even more significant changes to the regexp engine
              to get some additional speed.
      
              There's probably additional unused stuff that I haven't
              deleted yet.
      
              This does mean that our PCRE is now a fork, but I think that's
              not really a big deal.
      
              * JavaScriptCore.exp: Remove the 5 old entry points and add
              the 3 new entry points for WebCore's direct use of the regular
              expression engine.
      
              * kjs/config.h: Remove the USE(PCRE16) define. I decided to flip
              its sense and now there's a USE(POSIX_REGEX) instead, which should
              probably not be set by anyone. Maybe later we'll just get rid of it
              altogether.
      
              * kjs/regexp.h:
              * kjs/regexp.cpp:
              (KJS::RegExp::RegExp): Switch to new jsRegExp function names and
              defines. Cut down on the number of functions used.
              (KJS::RegExp::~RegExp): Ditto.
              (KJS::RegExp::match): Ditto.
      
              * pcre/dftables.c: (main): Get rid of ctype_letter and ctype_meta,
              which are unused.
      
              * pcre/pcre-config.h: Get rid of EBCIDIC, PCRE_DATA_SCOPE, const,
              size_t, HAVE_STRERROR, HAVE_MEMMOVE, HAVE_BCOPY, NEWLINE,
              POSIX_MALLOC_THRESHOLD, NO_RECURSE, SUPPORT_UCP, SUPPORT_UTF8,
              and JAVASCRIPT. These are all no longer configurable in our copy
              of the library.
      
              * pcre/pcre.h: Remove the macro-based kjs prefix hack, the PCRE
              version macros, PCRE_UTF16, the code to set up PCRE_DATA_SCOPE,
              the include of <stdlib.h>, and most of the constants and
              functions defined in this header. Changed the naming scheme to
              use a JSRegExp prefix rather than a pcre prefix. In the future,
              we'll probably change this to be a C++ header.
      
              * pcre/pcre_compile.c: Removed all unused code branches,
              including many whole functions and various byte codes.
              Kept changes outside of removal to a minimum.
              (check_escape):
              (first_significant_code):
              (find_fixedlength):
              (find_recurse):
              (could_be_empty_branch):
              (compile_branch):
              (compile_regex):
              (is_anchored):
              (is_startline):
              (find_firstassertedchar):
              (jsRegExpCompile): Renamed from pcre_compile2 and changed the
              parameters around a bit.
              (jsRegExpFree): Added.
      
              * pcre/pcre_exec.c: Removed many unused opcodes and variables.
              Also started tearing down the NO_RECURSE mechanism since it's
              now the default. In some cases there were things in the explicit
              frame that could be turned into plain old local variables and
              other small like optimizations.
              (pchars):
              (match_ref):
              (match): Changed parameters quite a bit since it's now not used
              recursively.
              (jsRegExpExecute): Renamed from pcre_exec.
      
              * pcre/pcre_internal.h: Get rid of PCRE_DEFINITION, PCRE_SPTR,
              PCRE_IMS, PCRE_ICHANGED, PCRE_NOPARTIAL, PCRE_STUDY_MAPPED,
              PUBLIC_OPTIONS, PUBLIC_EXEC_OPTIONS, PUBLIC_DFA_EXEC_OPTIONS,
              PUBLIC_STUDY_OPTIONS, MAGIC_NUMBER, 16 of the opcodes,
              _pcre_utt, _pcre_utt_size, _pcre_try_flipped, _pcre_ucp_findprop,
              and _pcre_valid_utf8. Also moved pcre_malloc and pcre_free here.
      
              * pcre/pcre_maketables.c: Changed to only compile in dftables.
              Also got rid of many of the tables that we don't use.
      
              * pcre/pcre_tables.c: Removed the unused Unicode property tables.
      
              * pcre/pcre_ucp_searchfuncs.c: Removed everything except for
              _pcre_ucp_othercase.
      
              * pcre/pcre_xclass.c: (_pcre_xclass): Removed uneeded support
              for classes based on Unicode properties.
      
              * wtf/FastMallocPCRE.cpp: Removed unused bits. It would be good
              to eliminate this completely, but we need the regular expression
              code to be C++ first.
      
              * pcre/pcre_fullinfo.c:
              * pcre/pcre_get.c:
              * pcre/ucp.h:
              Files that are no longer needed. I didn't remove them with this
              check-in, because I didn't want to modify all the project files.
      
      WebCore:
      
              Reviewed by Maciej.
      
              - WebCore part of http://bugs.webkit.org/show_bug.cgi?id=15821
                remove unused PCRE features for speed
      
              * page/Frame.cpp: (WebCore::Frame::matchLabelsAgainstElement):
              * page/mac/FrameMac.mm: (WebCore::Frame::matchLabelsAgainstElement):
              Remove use of "[[:digit:]]" syntax. This hasn't worked for some time.
              Use "\d" instead.
      
              * platform/RegularExpression.h: Remove the unused cap function. We can
              add it back later if we find we need it.
              * platform/RegularExpression.cpp:
              (WebCore::RegularExpression::Private::compile): Update for JavaScriptCore
              regular expression entry point changes.
              (WebCore::RegularExpression::Private::~Private): Ditto.
              (WebCore::RegularExpression::match): Remove the code to set PCRE_NOTBOL.
              This means that regular expressions with metacharactesr like ^ in them
              won't work any more with non-whole-string searches, but we don't use
              any regular expressions like that.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a7c3b87f
    • mjs's avatar
      Reviewed by Sam. · bf8872b6
      mjs authored
              
              - remove NaN check from JSImmediate::fromDouble for 0.5% SunSpider speedup
      
              It turns out that doing this check costs more than it saves.
              
              * kjs/JSImmediate.h:
              (KJS::JSImmediate::fromDouble):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bf8872b6
    • weinig@apple.com's avatar
      JavaScriptCore: · a845d282
      weinig@apple.com authored
              Reviewed by Oliver.
      
              Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
              The variable had been kept around for binary compatibility, but since nothing
              else is there is no point in continuing to keep it around.
      
              * API/JSCallbackConstructor.cpp:
              (KJS::):
              * API/JSCallbackFunction.cpp:
              (KJS::):
              * API/JSCallbackObject.cpp:
              (KJS::):
              * bindings/objc/objc_runtime.mm:
              * bindings/runtime_array.cpp:
              * bindings/runtime_object.cpp:
              * kjs/array_instance.cpp:
              (KJS::):
              * kjs/array_object.cpp:
              (KJS::):
              * kjs/bool_object.cpp:
              * kjs/date_object.cpp:
              (KJS::):
              * kjs/error_object.cpp:
              * kjs/function.cpp:
              (KJS::):
              * kjs/internal.cpp:
              (KJS::):
              * kjs/lookup.h:
              * kjs/math_object.cpp:
              * kjs/number_object.cpp:
              * kjs/object.h:
              * kjs/regexp_object.cpp:
              * kjs/string_object.cpp:
              (KJS::):
      
      WebCore:
      
              Reviewed by Oliver.
      
              Remove dummy variable from ClassInfo reducing the size of the struct by 1 word.
              The variable had been kept around for binary compatibility, but since nothing
              else is there is no point in continuing to keep it around.
      
              * bindings/js/JSDOMExceptionConstructor.cpp:
              (WebCore::):
              * bindings/js/JSHTMLInputElementBase.cpp:
              (WebCore::):
              * bindings/js/JSNamedNodesCollection.cpp:
              (WebCore::):
              * bindings/js/JSXMLHttpRequest.cpp:
              (KJS::):
              * bindings/js/JSXSLTProcessor.cpp:
              (KJS::):
              * bindings/js/kjs_css.cpp:
              (WebCore::):
              * bindings/js/kjs_events.cpp:
              (WebCore::):
              * bindings/js/kjs_navigator.cpp:
              (KJS::):
              * bindings/js/kjs_window.cpp:
              (KJS::):
              * bindings/scripts/CodeGeneratorJS.pm:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a845d282
    • kmccullo's avatar
      - Updated testkjs results to make the build bots green until we · 92087888
      kmccullo authored
              can fix the tests that are failing.  The new failures are in DST.
      
              * tests/mozilla/expected.html:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      92087888
    • mjs's avatar
      Reviewed by Adam. · c3c01525
      mjs authored
              
              - don't print the var twice for ForInNodes with a var declaration
      
              * kjs/nodes2string.cpp:
              (KJS::ForInNode::streamTo):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3c01525
    • darin@apple.com's avatar
      * pcre/pcre_compile.c: (check_escape): Windows build fix. Get rid of · fd93acd9
      darin@apple.com authored
              C-incompatible declaration.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fd93acd9
    • mrowe@apple.com's avatar
      2007-11-03 Mark Rowe <mrowe@apple.com> · 623b9f7e
      mrowe@apple.com authored
              Gtk build fix.
      
              * kjs/nodes.cpp:  Add missing include.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      623b9f7e
    • darin@apple.com's avatar
      JavaScriptCore: · 11f3b27e
      darin@apple.com authored
              Reviewed by Maciej.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=15814
                <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
      
              These changes cause us to match the JavaScript specification and pass the
              fast/js/kde/encode_decode_uri.html test.
      
              * kjs/function.cpp: (KJS::encode): Call the UTF-8 string conversion in its
              new strict mode, throwing an exception if there are malformed UTF-16 surrogate
              pairs in the text.
      
              * kjs/ustring.h: Added a strict version of the UTF-8 string conversion.
              * kjs/ustring.cpp:
              (KJS::decodeUTF8Sequence): Removed code to disallow U+FFFE and U+FFFF; while
              those might be illegal in some sense, they aren't supposed to get any special
              handling in the place where this function is currently used.
              (KJS::UString::UTF8String): Added the strictness.
      
      LayoutTests:
      
              Reviewed by Maciej.
      
              - updates for http://bugs.webkit.org/show_bug.cgi?id=15814
                <rdar://problem/5536644> fast/js/kde/encode_decode_uri.html fails
      
              * fast/js/kde/resources/encode_decode_uri.js: Rewrote the test to cover edges better,
              and use the should functions in a way that makes failures easier to understand.
              * fast/js/kde/encode_decode_uri-expected.txt: Updated.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      11f3b27e