Revision: 9878
Author:   [email protected]
Date:     Fri Nov  4 02:18:12 2011
Log:      Port r9643 to 3.1 branch.

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

Modified:
 /branches/3.1/src/compiler.h
 /branches/3.1/src/parser.cc
 /branches/3.1/src/version.cc

=======================================
--- /branches/3.1/src/compiler.h        Thu Feb 24 02:10:44 2011
+++ /branches/3.1/src/compiler.h        Fri Nov  4 02:18:12 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -80,6 +80,12 @@
     ASSERT(is_lazy());
     flags_ |= IsInLoop::encode(true);
   }
+  void MarkAsNative() {
+    flags_ |= IsNative::encode(true);
+  }
+  bool is_native() const {
+    return IsNative::decode(flags_);
+  }
   void SetFunction(FunctionLiteral* literal) {
     ASSERT(function_ == NULL);
     function_ = literal;
@@ -152,6 +158,9 @@

   void Initialize(Mode mode) {
     mode_ = V8::UseCrankshaft() ? mode : NONOPT;
+    if (script_->type()->value() == Script::TYPE_NATIVE) {
+      MarkAsNative();
+    }
     if (!shared_info_.is_null() && shared_info_->strict_mode()) {
       MarkAsStrict();
     }
@@ -174,6 +183,8 @@
   class IsInLoop: public BitField<bool, 3, 1> {};
   // Strict mode - used in eager compilation.
   class IsStrict: public BitField<bool, 4, 1> {};
+  // Is this a function from our natives.
+  class IsNative: public BitField<bool, 6, 1> {};

   unsigned flags_;

=======================================
--- /branches/3.1/src/parser.cc Tue Jun  7 05:08:20 2011
+++ /branches/3.1/src/parser.cc Fri Nov  4 02:18:12 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -5142,11 +5142,14 @@
   FunctionLiteral* result = NULL;
   Handle<Script> script = info->script();
   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);
     result = parser.ParseLazy(info);
   } else {
     bool allow_natives_syntax =
-        FLAG_allow_natives_syntax || Bootstrapper::IsActive();
+        info->is_native() || FLAG_allow_natives_syntax;
     ScriptDataImpl* pre_data = info->pre_parse_data();
Parser parser(script, allow_natives_syntax, info->extension(), pre_data);
     if (pre_data != NULL && pre_data->has_error()) {
=======================================
--- /branches/3.1/src/version.cc        Fri Jul  8 03:33:59 2011
+++ /branches/3.1/src/version.cc        Fri Nov  4 02:18:12 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     1
 #define BUILD_NUMBER      8
-#define PATCH_LEVEL       26
+#define PATCH_LEVEL       27
 #define CANDIDATE_VERSION false

 // Define SONAME to have the SCons build the put a specific SONAME into the

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

Reply via email to