Commit Graph

26 Commits

Author SHA1 Message Date
lrn@chromium.org
7aec228dbb Cleanup of mjsunit.js code and make assertEquals more strict.
Encapsulate the helper functions in mjsunit.js.
Now only exposes the exception class and the assertXXX functions.

Make assertEquals use === instead of ==.
This prevents a lot of possiblefalse positives in tests, and avoids
having to do assertTrue(expected === actual) when you need it.

Fixed some tests that were either buggy or assuming == test.

Review URL: http://codereview.chromium.org/6869007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7628 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-15 11:35:36 +00:00
lrn@chromium.org
9ec16dfe68 Fix bug 1137. No longer allow the RegExp /(*)/.
BUG=v8:1137
TEST=test/mjsunit/regexp.js

Review URL: http://codereview.chromium.org/6499016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6802 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 08:10:47 +00:00
lrn@chromium.org
90fd0ee897 Change interpretation of malformed \c? escapes in RegExp to match JSC.
Review URL: http://codereview.chromium.org/6171001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6225 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 12:35:42 +00:00
lrn@chromium.org
94bb378ee5 Make RegExp character class match JSC.
See http://trac.webkit.org/changeset/73594

Review URL: http://codereview.chromium.org/5723002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 08:33:32 +00:00
lrn@chromium.org
6691d531ab Revert 5911 (RegExp fail on invalid range syntax).
Review URL: http://codereview.chromium.org/5703001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-09 12:07:52 +00:00
lrn@chromium.org
be20c55b3e Change RegExp syntax to fail on invalid ranges like [\d-x], [x-\d] and [\d-\d].
The previous behavior was to treat the "-" as verbatim if the range was invalid.
This change matches the JSC changeset http://trac.webkit.org/changeset/72813/

Review URL: http://codereview.chromium.org/5464001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-02 08:02:37 +00:00
lrn@chromium.org
484b9df414 Limit end-anchored regexps to testing end of string where possible.
Review URL: http://codereview.chromium.org/3844006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5661 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 14:00:01 +00:00
lrn@chromium.org
00e23b719d Revert revision 5657.
TBR: erik.corry

Review URL: http://codereview.chromium.org/3812012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5658 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 10:37:54 +00:00
lrn@chromium.org
f80da64d36 Use finite-length end-anchored regexps to reduce part of regexp that is searched.
Review URL: http://codereview.chromium.org/3850005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-19 09:42:40 +00:00
lrn@chromium.org
d5ac565882 Restructure RegExp exec cache code.
Review URL: http://codereview.chromium.org/3778004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5622 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-14 12:54:00 +00:00
lrn@chromium.org
0210df5848 Use Copy-on-write arrays for cached regexp results.
Review URL: http://codereview.chromium.org/3158020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-20 09:37:22 +00:00
lrn@chromium.org
1a0bb51069 Fix bug in word-boundary-lookahead followed by end-of-input assertion.
Review URL: http://codereview.chromium.org/1712013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4504 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-04-26 15:10:42 +00:00
lrn@chromium.org
845fd15dd6 Pre-create properties on JSRegExp objects
Initialize properties in single runtime call.

Review URL: http://codereview.chromium.org/1350003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4298 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-03-26 14:19:47 +00:00
lrn@chromium.org
2e37ebe1ed Added stack overflow check for RegExp analysis phase.
A very long regexp graph can overflow the stack with recursive calls.

Review URL: http://codereview.chromium.org/113894


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2064 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-05-27 11:23:26 +00:00
lrn@chromium.org
0070e8c572 Fixed overflow bug in parsing of regexp repetitions.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-02-05 12:55:20 +00:00
lrn@chromium.org
6e13e8ce37 Parsing a RegExp decimal escape could overflow, making an otherwise too large
decimal escape be accepted as a capture index.
We introduce a limit on the nubmer of allowed captures in a regexp, and break off
parsing of the decimal escape at that point.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-30 10:38:25 +00:00
erik.corry@gmail.com
c956219ef4 * Remember to check for end of string even where we
know the character class must match.
Thanks to Mads and Christian for finding this bug
Review URL: http://codereview.chromium.org/18750

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-26 13:04:49 +00:00
lrn@chromium.org
6bd6376588 RegExp parser forgot to advance after reading \c in character class. I.e., \cM was interpreted as \ccM.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-01-22 10:37:09 +00:00
erik.corry@gmail.com
ab2d4bc9bf * Generate quick checks based on mask and compare for
the alternatives in a choice node.  The quick checks
  are conservative in the sense that they only detect
  failure with certainty.  Checks can do 2 or 4 characters
  at a time.
* Inline the quick checks to allow the alternatives to
  be checked without branching in the common case where
  they fail.
Review URL: http://codereview.chromium.org/14194

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1005 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-19 12:02:34 +00:00
erik.corry@gmail.com
ba09ec5e89 Irregexp:
* Facility for generating a node several ways.  This allows
  code to be generated for a node knowing where it is trying
  to match relative to the 'current position' and it allows
  code to be generated that knows where to backtrack to.  Both
  allow dramatic reductions in the amount of popping and pushing
  on the stack and the number of indirect jumps.
* Generate special backtracking for greedy quantifiers on
  constant-length atoms.  This allows .* to run in constant
  space relative to input string size.
* When we are checking a long sequence of characters or character
  classes in the input then we do them right to left and only the
  first (rightmost) needs to check for end-of-string.
* Record the pattern in the profile instead of just <CompiledRegExp>
* Nodes no longer contain an on_failure_ node.  This was only used
  for lookaheads and they are now handled with a choice node instead.
Review URL: http://codereview.chromium.org/12900

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@930 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-08 09:22:12 +00:00
lrn@chromium.org
ee9e6b5bae Excluded test that fails in JSCRE.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-05 10:04:40 +00:00
lrn@chromium.org
ed4e792cd5 Makes irregexp-ia32 feature complete wrt. regexps.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-12-05 09:18:55 +00:00
erik.corry@gmail.com
4722a886ec Implement $ for non-multiline.
Review URL: http://codereview.chromium.org/10992

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-28 08:53:53 +00:00
christian.plesner.hansen@gmail.com
b57b4a15cd Merge regexp2000 back into bleeding_edge
Review URL: http://codereview.chromium.org/12427

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-11-25 11:07:48 +00:00
christian.plesner.hansen@gmail.com
9bed566bdb Changed copyright header from google inc. to v8 project authors.
Added presubmit step to check copyright.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-09-09 20:08:45 +00:00
christian.plesner.hansen
c42f5829a1 Included mjsunit JavaScript test suite and C++ unit tests.
In the shell sample don't print the result of executing a script, only
evaluating expressions.

Fixed issue when building samples on Windows using a shared V8
library.  Added visibility option on Linux build which makes the
generated library 18% smaller.

Changed build system to accept multiple build modes in one build and
generate seperate objects, libraries and executables for each mode.

Removed deferred negation optimization (a * -b => -(a * b)) since this
visibly changes operand conversion order.

Improved parsing performance by introducing stack guard in preparsing.
Without a stack guard preparsing always bails out with stack overflow.


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2008-08-22 13:33:59 +00:00