Revision: 9876
Author: [email protected]
Date: Fri Nov 4 02:14:08 2011
Log: Port r9643 to 3.0 branch.
Review URL: http://codereview.chromium.org/8465006
http://code.google.com/p/v8/source/detail?r=9876
Modified:
/branches/3.0/src/compiler.h
/branches/3.0/src/parser.cc
/branches/3.0/src/version.cc
=======================================
--- /branches/3.0/src/compiler.h Wed Jan 19 03:11:08 2011
+++ /branches/3.0/src/compiler.h Fri Nov 4 02:14:08 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:
@@ -73,6 +73,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;
@@ -145,6 +151,9 @@
void Initialize(Mode mode) {
mode_ = V8::UseCrankshaft() ? mode : NONOPT;
+ if (script_->type()->value() == Script::TYPE_NATIVE) {
+ MarkAsNative();
+ }
}
void SetMode(Mode mode) {
@@ -162,6 +171,8 @@
class IsGlobal: public BitField<bool, 2, 1> {};
// Flags that can be set for lazy compilation.
class IsInLoop: public BitField<bool, 3, 1> {};
+ // Is this a function from our natives.
+ class IsNative: public BitField<bool, 6, 1> {};
unsigned flags_;
=======================================
--- /branches/3.0/src/parser.cc Tue Jun 7 05:07:54 2011
+++ /branches/3.0/src/parser.cc Fri Nov 4 02:14:08 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:
@@ -5019,11 +5019,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.0/src/version.cc Tue Jun 7 05:07:54 2011
+++ /branches/3.0/src/version.cc Fri Nov 4 02:14:08 2011
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 0
#define BUILD_NUMBER 12
-#define PATCH_LEVEL 41
+#define PATCH_LEVEL 42
#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