Revision: 9644
Author:   [email protected]
Date:     Mon Oct 17 02:04:20 2011
Log:      Port r9643 to 3.6 branch.

TBR danno.
[email protected]

Review URL: http://codereview.chromium.org/8312014
http://code.google.com/p/v8/source/detail?r=9644

Modified:
 /branches/3.6/src/compiler.cc
 /branches/3.6/src/compiler.h
 /branches/3.6/src/parser.cc
 /branches/3.6/src/version.cc
 /branches/3.6/test/mjsunit/regress/regress-1521.js

=======================================
--- /branches/3.6/src/compiler.cc       Thu Sep  8 09:33:10 2011
+++ /branches/3.6/src/compiler.cc       Mon Oct 17 02:04:20 2011
@@ -516,9 +516,6 @@
     info.MarkAsGlobal();
     info.SetExtension(extension);
     info.SetPreParseData(pre_data);
-    if (natives == NATIVES_CODE) {
-      info.MarkAsAllowingNativesSyntax();
-    }
     result = MakeFunctionInfo(&info);
     if (extension == NULL && !result.is_null()) {
       compilation_cache->PutScript(source, result);
=======================================
--- /branches/3.6/src/compiler.h        Tue Sep 13 01:21:47 2011
+++ /branches/3.6/src/compiler.h        Mon Oct 17 02:04:20 2011
@@ -83,12 +83,6 @@
     ASSERT(is_lazy());
     flags_ |= IsInLoop::encode(true);
   }
-  void MarkAsAllowingNativesSyntax() {
-    flags_ |= IsNativesSyntaxAllowed::encode(true);
-  }
-  bool allows_natives_syntax() const {
-    return IsNativesSyntaxAllowed::decode(flags_);
-  }
   void MarkAsNative() {
     flags_ |= IsNative::encode(true);
   }
@@ -199,8 +193,6 @@
   class IsInLoop: public BitField<bool, 3, 1> {};
   // Strict mode - used in eager compilation.
   class IsStrictMode: public BitField<bool, 4, 1> {};
-  // Native syntax (%-stuff) allowed?
-  class IsNativesSyntaxAllowed: public BitField<bool, 5, 1> {};
   // Is this a function from our natives.
   class IsNative: public BitField<bool, 6, 1> {};

=======================================
--- /branches/3.6/src/parser.cc Fri Oct 14 05:43:19 2011
+++ /branches/3.6/src/parser.cc Mon Oct 17 02:04:20 2011
@@ -5198,13 +5198,16 @@
   bool harmony_block_scoping = !info->is_native() &&
                                FLAG_harmony_block_scoping;
   if (info->is_lazy()) {
-    Parser parser(script, true, NULL, NULL);
+    bool allow_natives_syntax =
+        FLAG_allow_natives_syntax ||
+        info->is_native();
+    Parser parser(script, allow_natives_syntax, NULL, NULL);
     parser.SetHarmonyBlockScoping(harmony_block_scoping);
     result = parser.ParseLazy(info);
   } else {
     // Whether we allow %identifier(..) syntax.
     bool allow_natives_syntax =
-        info->allows_natives_syntax() || FLAG_allow_natives_syntax;
+        info->is_native() || FLAG_allow_natives_syntax;
     ScriptDataImpl* pre_data = info->pre_parse_data();
     Parser parser(script,
                   allow_natives_syntax,
=======================================
--- /branches/3.6/src/version.cc        Fri Oct 14 05:43:19 2011
+++ /branches/3.6/src/version.cc        Mon Oct 17 02:04:20 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     6
 #define BUILD_NUMBER      6
-#define PATCH_LEVEL       3
+#define PATCH_LEVEL       4
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.6/test/mjsunit/regress/regress-1521.js Mon Jul 4 07:01:31 2011 +++ /branches/3.6/test/mjsunit/regress/regress-1521.js Mon Oct 17 02:04:20 2011
@@ -24,6 +24,8 @@
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Flags: --allow-natives-syntax

 // Optimized variable access inside through a catch context should work.
 function test(x) {
@@ -44,4 +46,3 @@
 }

 test(3);
-

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to