Commit 5c566650 authored by marja's avatar marja Committed by Commit bot

PreParser / Parser consistency: Make PreParser aware of Zone and AstValueFactory.

Previously it just had hacks to have NULLs instead of them and pretended to know
nothing about Zone. The hacks provide no real benefit (probably historically
based on some weird misconception about the relationship between Zone and
Isolate), and make it harder for the PreParser to start to know more about
variables and scoping.

BUG=

Review URL: https://codereview.chromium.org/909463003

Cr-Commit-Position: refs/heads/master@{#26494}
parent d9892bbd
...@@ -671,7 +671,7 @@ const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) { ...@@ -671,7 +671,7 @@ const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) {
char array[100]; char array[100];
const char* string = const char* string =
DoubleToCString(double_value, Vector<char>(array, arraysize(array))); DoubleToCString(double_value, Vector<char>(array, arraysize(array)));
return ast_value_factory()->GetOneByteString(string); return parser_->ast_value_factory()->GetOneByteString(string);
} }
...@@ -794,8 +794,8 @@ ClassLiteral* ParserTraits::ParseClassLiteral( ...@@ -794,8 +794,8 @@ ClassLiteral* ParserTraits::ParseClassLiteral(
Parser::Parser(CompilationInfo* info, ParseInfo* parse_info) Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
: ParserBase<ParserTraits>(info->isolate(), info->zone(), &scanner_, : ParserBase<ParserTraits>(info->isolate(), info->zone(), &scanner_,
parse_info->stack_limit, info->extension(), NULL, parse_info->stack_limit, info->extension(),
this), info->ast_value_factory(), NULL, this),
scanner_(parse_info->unicode_cache), scanner_(parse_info->unicode_cache),
reusable_preparser_(NULL), reusable_preparser_(NULL),
original_scope_(NULL), original_scope_(NULL),
...@@ -833,6 +833,7 @@ Parser::Parser(CompilationInfo* info, ParseInfo* parse_info) ...@@ -833,6 +833,7 @@ Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
// info takes ownership of AstValueFactory. // info takes ownership of AstValueFactory.
info->SetAstValueFactory( info->SetAstValueFactory(
new AstValueFactory(zone(), parse_info->hash_seed)); new AstValueFactory(zone(), parse_info->hash_seed));
ast_value_factory_ = info->ast_value_factory();
} }
} }
...@@ -4037,8 +4038,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser( ...@@ -4037,8 +4038,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
DCHECK_EQ(Token::LBRACE, scanner()->current_token()); DCHECK_EQ(Token::LBRACE, scanner()->current_token());
if (reusable_preparser_ == NULL) { if (reusable_preparser_ == NULL) {
reusable_preparser_ = reusable_preparser_ = new PreParser(
new PreParser(isolate(), &scanner_, NULL, stack_limit_); isolate(), zone(), &scanner_, ast_value_factory(), NULL, stack_limit_);
reusable_preparser_->set_allow_lazy(true); reusable_preparser_->set_allow_lazy(true);
reusable_preparser_->set_allow_natives(allow_natives()); reusable_preparser_->set_allow_natives(allow_natives());
reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping()); reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping());
......
...@@ -364,7 +364,6 @@ class ParserTraits { ...@@ -364,7 +364,6 @@ class ParserTraits {
inline static Scope* ptr_to_scope(ScopePtr scope) { return scope; } inline static Scope* ptr_to_scope(ScopePtr scope) { return scope; }
typedef Variable GeneratorVariable; typedef Variable GeneratorVariable;
typedef v8::internal::Zone Zone;
typedef v8::internal::AstProperties AstProperties; typedef v8::internal::AstProperties AstProperties;
typedef Vector<VariableProxy*> ParameterIdentifierVector; typedef Vector<VariableProxy*> ParameterIdentifierVector;
...@@ -569,7 +568,6 @@ class ParserTraits { ...@@ -569,7 +568,6 @@ class ParserTraits {
int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope, int DeclareArrowParametersFromExpression(Expression* expression, Scope* scope,
Scanner::Location* dupe_loc, Scanner::Location* dupe_loc,
bool* ok); bool* ok);
V8_INLINE AstValueFactory* ast_value_factory();
// Temporary glue; these functions will move to ParserBase. // Temporary glue; these functions will move to ParserBase.
Expression* ParseV8Intrinsic(bool* ok); Expression* ParseV8Intrinsic(bool* ok);
...@@ -716,9 +714,6 @@ class Parser : public ParserBase<ParserTraits> { ...@@ -716,9 +714,6 @@ class Parser : public ParserBase<ParserTraits> {
Isolate* isolate() { return info_->isolate(); } Isolate* isolate() { return info_->isolate(); }
CompilationInfo* info() const { return info_; } CompilationInfo* info() const { return info_; }
Handle<Script> script() const { return info_->script(); } Handle<Script> script() const { return info_->script(); }
AstValueFactory* ast_value_factory() const {
return info_->ast_value_factory();
}
// Called by ParseProgram after setting up the scanner. // Called by ParseProgram after setting up the scanner.
FunctionLiteral* DoParseProgram(CompilationInfo* info, Scope** scope, FunctionLiteral* DoParseProgram(CompilationInfo* info, Scope** scope,
...@@ -947,11 +942,6 @@ void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope, ...@@ -947,11 +942,6 @@ void ParserTraits::CheckConflictingVarDeclarations(v8::internal::Scope* scope,
} }
AstValueFactory* ParserTraits::ast_value_factory() {
return parser_->ast_value_factory();
}
// Support for handling complex values (array and object literals) that // Support for handling complex values (array and object literals) that
// can be fully handled at compile time. // can be fully handled at compile time.
class CompileTimeValue: public AllStatic { class CompileTimeValue: public AllStatic {
......
...@@ -42,7 +42,6 @@ namespace internal { ...@@ -42,7 +42,6 @@ namespace internal {
// // Used by FunctionState and BlockState. // // Used by FunctionState and BlockState.
// typedef Scope; // typedef Scope;
// typedef GeneratorVariable; // typedef GeneratorVariable;
// typedef Zone;
// // Return types for traversing functions. // // Return types for traversing functions.
// typedef Identifier; // typedef Identifier;
// typedef Expression; // typedef Expression;
...@@ -68,15 +67,17 @@ class ParserBase : public Traits { ...@@ -68,15 +67,17 @@ class ParserBase : public Traits {
typedef typename Traits::Type::Literal LiteralT; typedef typename Traits::Type::Literal LiteralT;
typedef typename Traits::Type::ObjectLiteralProperty ObjectLiteralPropertyT; typedef typename Traits::Type::ObjectLiteralProperty ObjectLiteralPropertyT;
ParserBase(Isolate* isolate, typename Traits::Type::Zone* zone, ParserBase(Isolate* isolate, Zone* zone, Scanner* scanner,
Scanner* scanner, uintptr_t stack_limit, v8::Extension* extension, uintptr_t stack_limit, v8::Extension* extension,
ParserRecorder* log, typename Traits::Type::Parser this_object) AstValueFactory* ast_value_factory, ParserRecorder* log,
typename Traits::Type::Parser this_object)
: Traits(this_object), : Traits(this_object),
parenthesized_function_(false), parenthesized_function_(false),
scope_(NULL), scope_(NULL),
function_state_(NULL), function_state_(NULL),
extension_(extension), extension_(extension),
fni_(NULL), fni_(NULL),
ast_value_factory_(ast_value_factory),
log_(log), log_(log),
mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly. mode_(PARSE_EAGERLY), // Lazy mode must be set explicitly.
stack_limit_(stack_limit), stack_limit_(stack_limit),
...@@ -257,7 +258,6 @@ class ParserBase : public Traits { ...@@ -257,7 +258,6 @@ class ParserBase : public Traits {
FunctionState* outer_function_state_; FunctionState* outer_function_state_;
typename Traits::Type::Scope** scope_stack_; typename Traits::Type::Scope** scope_stack_;
typename Traits::Type::Scope* outer_scope_; typename Traits::Type::Scope* outer_scope_;
typename Traits::Type::Zone* extra_param_;
typename Traits::Type::Factory* factory_; typename Traits::Type::Factory* factory_;
friend class ParserTraits; friend class ParserTraits;
...@@ -310,12 +310,13 @@ class ParserBase : public Traits { ...@@ -310,12 +310,13 @@ class ParserBase : public Traits {
Isolate* isolate() const { return isolate_; } Isolate* isolate() const { return isolate_; }
Scanner* scanner() const { return scanner_; } Scanner* scanner() const { return scanner_; }
AstValueFactory* ast_value_factory() const { return ast_value_factory_; }
int position() { return scanner_->location().beg_pos; } int position() { return scanner_->location().beg_pos; }
int peek_position() { return scanner_->peek_location().beg_pos; } int peek_position() { return scanner_->peek_location().beg_pos; }
bool stack_overflow() const { return stack_overflow_; } bool stack_overflow() const { return stack_overflow_; }
void set_stack_overflow() { stack_overflow_ = true; } void set_stack_overflow() { stack_overflow_ = true; }
Mode mode() const { return mode_; } Mode mode() const { return mode_; }
typename Traits::Type::Zone* zone() const { return zone_; } Zone* zone() const { return zone_; }
INLINE(Token::Value peek()) { INLINE(Token::Value peek()) {
if (stack_overflow_) return Token::ILLEGAL; if (stack_overflow_) return Token::ILLEGAL;
...@@ -620,13 +621,14 @@ class ParserBase : public Traits { ...@@ -620,13 +621,14 @@ class ParserBase : public Traits {
FunctionState* function_state_; // Function state stack. FunctionState* function_state_; // Function state stack.
v8::Extension* extension_; v8::Extension* extension_;
FuncNameInferrer* fni_; FuncNameInferrer* fni_;
AstValueFactory* ast_value_factory_; // Not owned.
ParserRecorder* log_; ParserRecorder* log_;
Mode mode_; Mode mode_;
uintptr_t stack_limit_; uintptr_t stack_limit_;
private: private:
Isolate* isolate_; Isolate* isolate_;
typename Traits::Type::Zone* zone_; // Only used by Parser. Zone* zone_;
Scanner* scanner_; Scanner* scanner_;
bool stack_overflow_; bool stack_overflow_;
...@@ -1210,8 +1212,6 @@ class PreParserTraits { ...@@ -1210,8 +1212,6 @@ class PreParserTraits {
// PreParser doesn't need to store generator variables. // PreParser doesn't need to store generator variables.
typedef void GeneratorVariable; typedef void GeneratorVariable;
// No interaction with Zones.
typedef void Zone;
typedef int AstProperties; typedef int AstProperties;
typedef Vector<PreParserIdentifier> ParameterIdentifierVector; typedef Vector<PreParserIdentifier> ParameterIdentifierVector;
...@@ -1432,15 +1432,15 @@ class PreParserTraits { ...@@ -1432,15 +1432,15 @@ class PreParserTraits {
return PreParserExpression::Default(); return PreParserExpression::Default();
} }
static PreParserExpressionList NewExpressionList(int size, void* zone) { static PreParserExpressionList NewExpressionList(int size, Zone* zone) {
return PreParserExpressionList(); return PreParserExpressionList();
} }
static PreParserStatementList NewStatementList(int size, void* zone) { static PreParserStatementList NewStatementList(int size, Zone* zone) {
return PreParserStatementList(); return PreParserStatementList();
} }
static PreParserExpressionList NewPropertyList(int size, void* zone) { static PreParserExpressionList NewPropertyList(int size, Zone* zone) {
return PreParserExpressionList(); return PreParserExpressionList();
} }
...@@ -1488,7 +1488,6 @@ class PreParserTraits { ...@@ -1488,7 +1488,6 @@ class PreParserTraits {
static bool IsTaggedTemplate(const PreParserExpression tag) { static bool IsTaggedTemplate(const PreParserExpression tag) {
return !tag.IsNoTemplateTag(); return !tag.IsNoTemplateTag();
} }
static AstValueFactory* ast_value_factory() { return NULL; }
void CheckConflictingVarDeclarations(PreParserScope scope, bool* ok) {} void CheckConflictingVarDeclarations(PreParserScope scope, bool* ok) {}
...@@ -1533,10 +1532,11 @@ class PreParser : public ParserBase<PreParserTraits> { ...@@ -1533,10 +1532,11 @@ class PreParser : public ParserBase<PreParserTraits> {
kPreParseSuccess kPreParseSuccess
}; };
PreParser(Isolate* isolate, Scanner* scanner, ParserRecorder* log, PreParser(Isolate* isolate, Zone* zone, Scanner* scanner,
AstValueFactory* ast_value_factory, ParserRecorder* log,
uintptr_t stack_limit) uintptr_t stack_limit)
: ParserBase<PreParserTraits>(isolate, NULL, scanner, stack_limit, NULL, : ParserBase<PreParserTraits>(isolate, zone, scanner, stack_limit, NULL,
log, this) {} ast_value_factory, log, this) {}
// Pre-parse the program from the character stream; returns true on // Pre-parse the program from the character stream; returns true on
// success (even if parsing failed, the pre-parse data successfully // success (even if parsing failed, the pre-parse data successfully
...@@ -1759,8 +1759,7 @@ typename ParserBase<Traits>::IdentifierT ParserBase<Traits>::ParseIdentifier( ...@@ -1759,8 +1759,7 @@ typename ParserBase<Traits>::IdentifierT ParserBase<Traits>::ParseIdentifier(
ReportMessage("strict_eval_arguments"); ReportMessage("strict_eval_arguments");
*ok = false; *ok = false;
} }
if (name->IsArguments(this->ast_value_factory())) if (name->IsArguments(ast_value_factory())) scope_->RecordArgumentsUsage();
scope_->RecordArgumentsUsage();
return name; return name;
} else if (is_sloppy(language_mode()) && } else if (is_sloppy(language_mode()) &&
(next == Token::FUTURE_STRICT_RESERVED_WORD || (next == Token::FUTURE_STRICT_RESERVED_WORD ||
...@@ -1793,8 +1792,7 @@ typename ParserBase<Traits>::IdentifierT ParserBase< ...@@ -1793,8 +1792,7 @@ typename ParserBase<Traits>::IdentifierT ParserBase<
} }
IdentifierT name = this->GetSymbol(scanner()); IdentifierT name = this->GetSymbol(scanner());
if (name->IsArguments(this->ast_value_factory())) if (name->IsArguments(ast_value_factory())) scope_->RecordArgumentsUsage();
scope_->RecordArgumentsUsage();
return name; return name;
} }
...@@ -1812,8 +1810,7 @@ ParserBase<Traits>::ParseIdentifierName(bool* ok) { ...@@ -1812,8 +1810,7 @@ ParserBase<Traits>::ParseIdentifierName(bool* ok) {
} }
IdentifierT name = this->GetSymbol(scanner()); IdentifierT name = this->GetSymbol(scanner());
if (name->IsArguments(this->ast_value_factory())) if (name->IsArguments(ast_value_factory())) scope_->RecordArgumentsUsage();
scope_->RecordArgumentsUsage();
return name; return name;
} }
...@@ -2836,7 +2833,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos, ...@@ -2836,7 +2833,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos,
int handler_count = 0; int handler_count = 0;
{ {
typename Traits::Type::Factory function_factory(this->ast_value_factory()); typename Traits::Type::Factory function_factory(ast_value_factory());
FunctionState function_state(&function_state_, &scope_, FunctionState function_state(&function_state_, &scope_,
Traits::Type::ptr_to_scope(scope), Traits::Type::ptr_to_scope(scope),
kArrowFunction, &function_factory); kArrowFunction, &function_factory);
...@@ -2914,7 +2911,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos, ...@@ -2914,7 +2911,7 @@ ParserBase<Traits>::ParseArrowFunctionLiteral(int start_pos,
} }
FunctionLiteralT function_literal = factory()->NewFunctionLiteral( FunctionLiteralT function_literal = factory()->NewFunctionLiteral(
this->EmptyIdentifierString(), this->ast_value_factory(), scope, body, this->EmptyIdentifierString(), ast_value_factory(), scope, body,
materialized_literal_count, expected_property_count, handler_count, materialized_literal_count, expected_property_count, handler_count,
num_parameters, FunctionLiteral::kNoDuplicateParameters, num_parameters, FunctionLiteral::kNoDuplicateParameters,
FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction, FunctionLiteral::ANONYMOUS_EXPRESSION, FunctionLiteral::kIsFunction,
......
...@@ -157,7 +157,11 @@ TEST(ScanHTMLEndComments) { ...@@ -157,7 +157,11 @@ TEST(ScanHTMLEndComments) {
i::CompleteParserRecorder log; i::CompleteParserRecorder log;
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(
&zone, CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
CHECK_EQ(i::PreParser::kPreParseSuccess, result); CHECK_EQ(i::PreParser::kPreParseSuccess, result);
...@@ -171,7 +175,11 @@ TEST(ScanHTMLEndComments) { ...@@ -171,7 +175,11 @@ TEST(ScanHTMLEndComments) {
i::CompleteParserRecorder log; i::CompleteParserRecorder log;
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(
&zone, CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
// Even in the case of a syntax error, kPreParseSuccess is returned. // Even in the case of a syntax error, kPreParseSuccess is returned.
...@@ -317,7 +325,11 @@ TEST(StandAlonePreParser) { ...@@ -317,7 +325,11 @@ TEST(StandAlonePreParser) {
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(
&zone, CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
preparser.set_allow_natives(true); preparser.set_allow_natives(true);
preparser.set_allow_harmony_arrow_functions(true); preparser.set_allow_harmony_arrow_functions(true);
...@@ -351,7 +363,11 @@ TEST(StandAlonePreParserNoNatives) { ...@@ -351,7 +363,11 @@ TEST(StandAlonePreParserNoNatives) {
scanner.Initialize(&stream); scanner.Initialize(&stream);
// Preparser defaults to disallowing natives syntax. // Preparser defaults to disallowing natives syntax.
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(
&zone, CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
CHECK_EQ(i::PreParser::kPreParseSuccess, result); CHECK_EQ(i::PreParser::kPreParseSuccess, result);
...@@ -416,7 +432,11 @@ TEST(RegressChromium62639) { ...@@ -416,7 +432,11 @@ TEST(RegressChromium62639) {
i::CompleteParserRecorder log; i::CompleteParserRecorder log;
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, i::Zone zone;
i::AstValueFactory ast_value_factory(&zone,
CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log,
CcTest::i_isolate()->stack_guard()->real_climit()); CcTest::i_isolate()->stack_guard()->real_climit());
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
...@@ -448,7 +468,11 @@ TEST(Regress928) { ...@@ -448,7 +468,11 @@ TEST(Regress928) {
i::CompleteParserRecorder log; i::CompleteParserRecorder log;
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, i::Zone zone;
i::AstValueFactory ast_value_factory(&zone,
CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log,
CcTest::i_isolate()->stack_guard()->real_climit()); CcTest::i_isolate()->stack_guard()->real_climit());
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
...@@ -497,7 +521,11 @@ TEST(PreParseOverflow) { ...@@ -497,7 +521,11 @@ TEST(PreParseOverflow) {
i::Scanner scanner(CcTest::i_isolate()->unicode_cache()); i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(&zone,
CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
preparser.set_allow_lazy(true); preparser.set_allow_lazy(true);
preparser.set_allow_harmony_arrow_functions(true); preparser.set_allow_harmony_arrow_functions(true);
i::PreParser::PreParseResult result = preparser.PreParseProgram(); i::PreParser::PreParseResult result = preparser.PreParseProgram();
...@@ -1411,7 +1439,11 @@ void TestParserSyncWithFlags(i::Handle<i::String> source, ...@@ -1411,7 +1439,11 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
{ {
i::Scanner scanner(isolate->unicode_cache()); i::Scanner scanner(isolate->unicode_cache());
i::GenericStringUtf16CharacterStream stream(source, 0, source->length()); i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
i::PreParser preparser(CcTest::i_isolate(), &scanner, &log, stack_limit); i::Zone zone;
i::AstValueFactory ast_value_factory(
&zone, CcTest::i_isolate()->heap()->HashSeed());
i::PreParser preparser(CcTest::i_isolate(), &zone, &scanner,
&ast_value_factory, &log, stack_limit);
SetParserFlags(&preparser, flags); SetParserFlags(&preparser, flags);
scanner.Initialize(&stream); scanner.Initialize(&stream);
i::PreParser::PreParseResult result = preparser.PreParseProgram( i::PreParser::PreParseResult result = preparser.PreParseProgram(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment