Revision: 17192
Author: [email protected]
Date: Mon Oct 14 13:07:20 2013 UTC
Log: Remove deprecated v8::preparser namespace.
[email protected]
Review URL: https://codereview.chromium.org/27174002
http://code.google.com/p/v8/source/detail?r=17192
Modified:
/branches/bleeding_edge/src/parser.cc
/branches/bleeding_edge/src/parser.h
/branches/bleeding_edge/src/preparser.cc
/branches/bleeding_edge/src/preparser.h
/branches/bleeding_edge/test/cctest/test-parsing.cc
=======================================
--- /branches/bleeding_edge/src/parser.cc Mon Oct 14 11:06:15 2013 UTC
+++ /branches/bleeding_edge/src/parser.cc Mon Oct 14 13:07:20 2013 UTC
@@ -4375,9 +4375,8 @@
// 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 @@
}
-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 @@
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 @@
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;
}
=======================================
--- /branches/bleeding_edge/src/parser.h Mon Oct 14 09:24:58 2013 UTC
+++ /branches/bleeding_edge/src/parser.h Mon Oct 14 13:07:20 2013 UTC
@@ -843,7 +843,7 @@
Handle<String> type,
Vector< Handle<Object> > arguments);
- preparser::PreParser::PreParseResult LazyParseFunctionLiteral(
+ PreParser::PreParseResult LazyParseFunctionLiteral(
SingletonLogger* logger);
AstNodeFactory<AstConstructionVisitor>* factory() {
@@ -855,7 +855,7 @@
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_;
=======================================
--- /branches/bleeding_edge/src/preparser.cc Thu Oct 10 11:58:16 2013 UTC
+++ /branches/bleeding_edge/src/preparser.cc Mon Oct 14 13:07:20 2013 UTC
@@ -53,8 +53,7 @@
#endif
namespace v8 {
-
-namespace preparser {
+namespace internal {
PreParser::PreParseResult PreParser::PreParseLazyFunction(
i::LanguageMode mode, bool is_generator, i::ParserRecorder* log) {
@@ -1663,4 +1662,4 @@
next == i::Token::YIELD;
}
-} } // v8::preparser
+} } // v8::internal
=======================================
--- /branches/bleeding_edge/src/preparser.h Fri Oct 11 14:03:54 2013 UTC
+++ /branches/bleeding_edge/src/preparser.h Mon Oct 14 13:07:20 2013 UTC
@@ -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 @@
}
}
-} // 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 @@
// 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 @@
friend class i::ObjectLiteralChecker<PreParser>;
};
-} } // v8::preparser
+} } // v8::internal
#endif // V8_PREPARSER_H
=======================================
--- /branches/bleeding_edge/test/cctest/test-parsing.cc Tue Oct 1 09:56:04
2013 UTC
+++ /branches/bleeding_edge/test/cctest/test-parsing.cc Mon Oct 14 13:07:20
2013 UTC
@@ -264,12 +264,11 @@
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 @@
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 @@
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 @@
{
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());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.