Revision: 9719
Author:   [email protected]
Date:     Thu Oct 20 04:00:46 2011
Log:      Port r9643 to 3.2 branch.

TBR:danno
[email protected]

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

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

=======================================
--- /branches/3.2/src/compiler.cc       Wed Jun 22 08:46:29 2011
+++ /branches/3.2/src/compiler.cc       Thu Oct 20 04:00:46 2011
@@ -525,7 +525,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.2/src/compiler.h        Mon Apr 11 05:33:05 2011
+++ /branches/3.2/src/compiler.h        Thu Oct 20 04:00:46 2011
@@ -83,11 +83,11 @@
     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);
+  }
+  bool is_native() const {
+    return IsNative::decode(flags_);
   }
   void SetFunction(FunctionLiteral* literal) {
     ASSERT(function_ == NULL);
@@ -163,6 +163,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()) {
       MarkAsStrictMode();
     }
@@ -185,8 +188,8 @@
   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> {};

   unsigned flags_;

=======================================
--- /branches/3.2/src/parser.cc Tue Jun  7 05:08:41 2011
+++ /branches/3.2/src/parser.cc Thu Oct 20 04:00:46 2011
@@ -5141,11 +5141,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 =
-        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, info->extension(), pre_data);
     if (pre_data != NULL && pre_data->has_error()) {
=======================================
--- /branches/3.2/src/version.cc        Mon Aug 22 06:29:53 2011
+++ /branches/3.2/src/version.cc        Thu Oct 20 04:00:46 2011
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     2
 #define BUILD_NUMBER      10
-#define PATCH_LEVEL       38
+#define PATCH_LEVEL       39
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

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

Reply via email to