Revision: 4800
Author: [email protected]
Date: Fri Jun 4 06:37:28 2010
Log: Simplify criteria for doing an optimized test call
Review URL: http://codereview.chromium.org/2662002
http://code.google.com/p/v8/source/detail?r=4800
Modified:
/branches/bleeding_edge/src/regexp.js
=======================================
--- /branches/bleeding_edge/src/regexp.js Fri Jun 4 04:58:40 2010
+++ /branches/bleeding_edge/src/regexp.js Fri Jun 4 06:37:28 2010
@@ -293,15 +293,12 @@
return cache.answer;
}
- // Remove irrelevant '.*' around a test regexp. The expression
- // checks whether this.source starts and ends with '.*' and that the
third
- // char is not a '?' and that the third to last char is not a '\'.
+ // Remove irrelevant preceeding '.*' in a test regexp. The expression
+ // checks whether this.source starts with '.*' and that the third
+ // char is not a '?'
if (%_StringCharCodeAt(this.source,0) == 46 && // '.'
%_StringCharCodeAt(this.source,1) == 42 && // '*'
- %_StringCharCodeAt(this.source,2) != 63 && // '?'
- %_StringCharCodeAt(this.source,this.source.length - 3) != 28 &&
// '\'
- %_StringCharCodeAt(this.source,this.source.length - 2) == 46 &&
// '.'
- %_StringCharCodeAt(this.source,this.source.length - 1) == 42) {
// '*'
+ %_StringCharCodeAt(this.source,2) != 63) { // '?'
if (!%_ObjectEquals(regexp_key, this)) {
regexp_key = this;
regexp_val = new $RegExp(this.source.substring(2,
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev