From 50ef25e0f397f01d49007e7c7bcebebcbcfc73a6 Mon Sep 17 00:00:00 2001 From: "lrn@chromium.org" Date: Mon, 17 Oct 2011 09:02:26 +0000 Subject: [PATCH] Remove redundant allow-natives flag from CompilationInfo. Just use script being native and FLAG_allow_natives_syntax directly. Review URL: http://codereview.chromium.org/8314018 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9643 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 3 --- src/compiler.h | 8 -------- src/parser.cc | 7 +++++-- test/mjsunit/regress/regress-1521.js | 3 ++- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 4979a7f866..544d1904f9 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -516,9 +516,6 @@ Handle Compiler::Compile(Handle source, 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); diff --git a/src/compiler.h b/src/compiler.h index 09aa23dec9..69ab27d9c8 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -83,12 +83,6 @@ class CompilationInfo BASE_EMBEDDED { 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 CompilationInfo BASE_EMBEDDED { class IsInLoop: public BitField {}; // Strict mode - used in eager compilation. class IsStrictMode: public BitField {}; - // Native syntax (%-stuff) allowed? - class IsNativesSyntaxAllowed: public BitField {}; // Is this a function from our natives. class IsNative: public BitField {}; diff --git a/src/parser.cc b/src/parser.cc index fb94a1a60b..3bf2cf911c 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -5196,13 +5196,16 @@ bool ParserApi::Parse(CompilationInfo* info) { Handle