Version 2.3.6

RegExp literals create a new object every time they are evaluated (issue 704).

Object.seal and Object.freeze return the modified object (issue 809).

Fix building using GCC 4.4.4.

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

git-svn-id: http://v8.googlecode.com/svn/trunk@5208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/regexp.js b/src/regexp.js
index 58e620d..fa702b2 100644
--- a/src/regexp.js
+++ b/src/regexp.js
@@ -126,7 +126,7 @@
   this.regExp = 0;
   this.subject = 0;
   this.replaceString = 0;
-  this.lastIndex = 0;
+  this.lastIndex = 0;  // Also used for splitLimit when type is "split"
   this.answer = 0;
   // answerSaved marks whether the contents of answer is valid for a cache
   // hit in RegExpExec, StringMatch and StringSplit.
@@ -194,7 +194,7 @@
 
   if (%_ObjectEquals(cache.type, 'exec') &&
       %_ObjectEquals(cache.lastIndex, this.lastIndex) &&
-      %_ObjectEquals(cache.regExp, this) &&
+      %_IsRegExpEquivalent(cache.regExp, this) &&
       %_ObjectEquals(cache.subject, string)) {
     if (cache.answerSaved) {
       return CloneRegExpResult(cache.answer);
@@ -290,7 +290,7 @@
   var lastIndex = this.lastIndex;
   var cache = regExpCache;
   if (%_ObjectEquals(cache.type, 'test') &&
-      %_ObjectEquals(cache.regExp, this) &&
+      %_IsRegExpEquivalent(cache.regExp, this) &&
       %_ObjectEquals(cache.subject, string) &&
       %_ObjectEquals(cache.lastIndex, lastIndex)) {
     return cache.answer;