Remove deprecated v8::preparser namespace.
R=ulan@chromium.org Review URL: https://codereview.chromium.org/27174002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
15db1d7c3a
commit
00125f43f0
@ -4375,9 +4375,8 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
||||
// building an AST. This gathers the data needed to build a lazy
|
||||
// function.
|
||||
SingletonLogger logger;
|
||||
preparser::PreParser::PreParseResult result =
|
||||
LazyParseFunctionLiteral(&logger);
|
||||
if (result == preparser::PreParser::kPreParseStackOverflow) {
|
||||
PreParser::PreParseResult result = LazyParseFunctionLiteral(&logger);
|
||||
if (result == PreParser::kPreParseStackOverflow) {
|
||||
// Propagate stack overflow.
|
||||
stack_overflow_ = true;
|
||||
*ok = false;
|
||||
@ -4535,16 +4534,14 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
||||
}
|
||||
|
||||
|
||||
preparser::PreParser::PreParseResult Parser::LazyParseFunctionLiteral(
|
||||
PreParser::PreParseResult Parser::LazyParseFunctionLiteral(
|
||||
SingletonLogger* logger) {
|
||||
HistogramTimerScope preparse_scope(isolate()->counters()->pre_parse());
|
||||
ASSERT_EQ(Token::LBRACE, scanner().current_token());
|
||||
|
||||
if (reusable_preparser_ == NULL) {
|
||||
intptr_t stack_limit = isolate()->stack_guard()->real_climit();
|
||||
reusable_preparser_ = new preparser::PreParser(&scanner_,
|
||||
NULL,
|
||||
stack_limit);
|
||||
reusable_preparser_ = new PreParser(&scanner_, NULL, stack_limit);
|
||||
reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping());
|
||||
reusable_preparser_->set_allow_modules(allow_modules());
|
||||
reusable_preparser_->set_allow_natives_syntax(allow_natives_syntax());
|
||||
@ -4554,7 +4551,7 @@ preparser::PreParser::PreParseResult Parser::LazyParseFunctionLiteral(
|
||||
reusable_preparser_->set_allow_harmony_numeric_literals(
|
||||
allow_harmony_numeric_literals());
|
||||
}
|
||||
preparser::PreParser::PreParseResult result =
|
||||
PreParser::PreParseResult result =
|
||||
reusable_preparser_->PreParseLazyFunction(top_scope_->language_mode(),
|
||||
is_generator(),
|
||||
logger);
|
||||
@ -5821,15 +5818,15 @@ ScriptDataImpl* PreParserApi::PreParse(Isolate* isolate,
|
||||
HistogramTimerScope timer(isolate->counters()->pre_parse());
|
||||
Scanner scanner(isolate->unicode_cache());
|
||||
intptr_t stack_limit = isolate->stack_guard()->real_climit();
|
||||
preparser::PreParser preparser(&scanner, &recorder, stack_limit);
|
||||
PreParser preparser(&scanner, &recorder, stack_limit);
|
||||
preparser.set_allow_lazy(true);
|
||||
preparser.set_allow_generators(FLAG_harmony_generators);
|
||||
preparser.set_allow_for_of(FLAG_harmony_iteration);
|
||||
preparser.set_allow_harmony_scoping(FLAG_harmony_scoping);
|
||||
preparser.set_allow_harmony_numeric_literals(FLAG_harmony_numeric_literals);
|
||||
scanner.Initialize(source);
|
||||
preparser::PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
if (result == preparser::PreParser::kPreParseStackOverflow) {
|
||||
PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
if (result == PreParser::kPreParseStackOverflow) {
|
||||
isolate->StackOverflow();
|
||||
return NULL;
|
||||
}
|
||||
|
@ -843,7 +843,7 @@ class Parser BASE_EMBEDDED {
|
||||
Handle<String> type,
|
||||
Vector< Handle<Object> > arguments);
|
||||
|
||||
preparser::PreParser::PreParseResult LazyParseFunctionLiteral(
|
||||
PreParser::PreParseResult LazyParseFunctionLiteral(
|
||||
SingletonLogger* logger);
|
||||
|
||||
AstNodeFactory<AstConstructionVisitor>* factory() {
|
||||
@ -855,7 +855,7 @@ class Parser BASE_EMBEDDED {
|
||||
|
||||
Handle<Script> script_;
|
||||
Scanner scanner_;
|
||||
preparser::PreParser* reusable_preparser_;
|
||||
PreParser* reusable_preparser_;
|
||||
Scope* top_scope_;
|
||||
Scope* original_scope_; // for ES5 function declarations in sloppy eval
|
||||
FunctionState* current_function_state_;
|
||||
|
@ -53,8 +53,7 @@ int isfinite(double value);
|
||||
#endif
|
||||
|
||||
namespace v8 {
|
||||
|
||||
namespace preparser {
|
||||
namespace internal {
|
||||
|
||||
PreParser::PreParseResult PreParser::PreParseLazyFunction(
|
||||
i::LanguageMode mode, bool is_generator, i::ParserRecorder* log) {
|
||||
@ -1663,4 +1662,4 @@ bool PreParser::peek_any_identifier() {
|
||||
next == i::Token::YIELD;
|
||||
}
|
||||
|
||||
} } // v8::preparser
|
||||
} } // v8::internal
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "scanner.h"
|
||||
|
||||
namespace v8 {
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Used to detect duplicates in object literals. Each of the values
|
||||
@ -125,11 +124,6 @@ void ObjectLiteralChecker<P>::CheckProperty(Token::Value property,
|
||||
}
|
||||
}
|
||||
|
||||
} // v8::internal
|
||||
|
||||
namespace preparser {
|
||||
|
||||
typedef uint8_t byte;
|
||||
|
||||
// Preparsing checks a JavaScript program and emits preparse-data that helps
|
||||
// a later parsing to be faster.
|
||||
@ -144,6 +138,7 @@ typedef uint8_t byte;
|
||||
// That means that contextual checks (like a label being declared where
|
||||
// it is used) are generally omitted.
|
||||
|
||||
typedef uint8_t byte;
|
||||
namespace i = v8::internal;
|
||||
|
||||
class PreParser {
|
||||
@ -693,6 +688,6 @@ class PreParser {
|
||||
friend class i::ObjectLiteralChecker<PreParser>;
|
||||
};
|
||||
|
||||
} } // v8::preparser
|
||||
} } // v8::internal
|
||||
|
||||
#endif // V8_PREPARSER_H
|
||||
|
@ -264,12 +264,11 @@ TEST(StandAlonePreParser) {
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
v8::preparser::PreParser preparser(&scanner, &log, stack_limit);
|
||||
i::PreParser preparser(&scanner, &log, stack_limit);
|
||||
preparser.set_allow_lazy(true);
|
||||
preparser.set_allow_natives_syntax(true);
|
||||
v8::preparser::PreParser::PreParseResult result =
|
||||
preparser.PreParseProgram();
|
||||
CHECK_EQ(v8::preparser::PreParser::kPreParseSuccess, result);
|
||||
i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
CHECK_EQ(i::PreParser::kPreParseSuccess, result);
|
||||
i::ScriptDataImpl data(log.ExtractData());
|
||||
CHECK(!data.has_error());
|
||||
}
|
||||
@ -300,11 +299,10 @@ TEST(StandAlonePreParserNoNatives) {
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
// Preparser defaults to disallowing natives syntax.
|
||||
v8::preparser::PreParser preparser(&scanner, &log, stack_limit);
|
||||
i::PreParser preparser(&scanner, &log, stack_limit);
|
||||
preparser.set_allow_lazy(true);
|
||||
v8::preparser::PreParser::PreParseResult result =
|
||||
preparser.PreParseProgram();
|
||||
CHECK_EQ(v8::preparser::PreParser::kPreParseSuccess, result);
|
||||
i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
CHECK_EQ(i::PreParser::kPreParseSuccess, result);
|
||||
i::ScriptDataImpl data(log.ExtractData());
|
||||
// Data contains syntax error.
|
||||
CHECK(data.has_error());
|
||||
@ -402,11 +400,10 @@ TEST(PreParseOverflow) {
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
v8::preparser::PreParser preparser(&scanner, &log, stack_limit);
|
||||
i::PreParser preparser(&scanner, &log, stack_limit);
|
||||
preparser.set_allow_lazy(true);
|
||||
v8::preparser::PreParser::PreParseResult result =
|
||||
preparser.PreParseProgram();
|
||||
CHECK_EQ(v8::preparser::PreParser::kPreParseStackOverflow, result);
|
||||
i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
CHECK_EQ(i::PreParser::kPreParseStackOverflow, result);
|
||||
}
|
||||
|
||||
|
||||
@ -1121,12 +1118,11 @@ void TestParserSyncWithFlags(i::Handle<i::String> source, unsigned flags) {
|
||||
{
|
||||
i::Scanner scanner(isolate->unicode_cache());
|
||||
i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
|
||||
v8::preparser::PreParser preparser(&scanner, &log, stack_limit);
|
||||
i::PreParser preparser(&scanner, &log, stack_limit);
|
||||
SET_PARSER_FLAGS(preparser, flags);
|
||||
scanner.Initialize(&stream);
|
||||
v8::preparser::PreParser::PreParseResult result =
|
||||
preparser.PreParseProgram();
|
||||
CHECK_EQ(v8::preparser::PreParser::kPreParseSuccess, result);
|
||||
i::PreParser::PreParseResult result = preparser.PreParseProgram();
|
||||
CHECK_EQ(i::PreParser::kPreParseSuccess, result);
|
||||
}
|
||||
i::ScriptDataImpl data(log.ExtractData());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user