Commit 86ec0923 authored by verwaest's avatar verwaest Committed by Commit bot

Get rid of ParseInfo::lazy

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2406803003
Cr-Commit-Position: refs/heads/master@{#40160}
parent 4f9976aa
......@@ -31,6 +31,7 @@ BackgroundParsingTask::BackgroundParsingTask(
// will happen in the main thread after parsing.
Zone* zone = new Zone(isolate->allocator());
ParseInfo* info = new ParseInfo(zone);
info->set_toplevel();
source->zone.reset(zone);
source->info.reset(info);
info->set_isolate(isolate);
......
......@@ -66,7 +66,6 @@ void CompilerDispatcherJob::PrepareToParseOnMainThread() {
parse_info_.reset(new ParseInfo(zone_.get()));
parse_info_->set_isolate(isolate_);
parse_info_->set_character_stream(character_stream_.get());
parse_info_->set_lazy();
parse_info_->set_hash_seed(isolate_->heap()->HashSeed());
parse_info_->set_is_named_expression(shared_->is_named_expression());
parse_info_->set_compiler_hints(shared_->compiler_hints());
......
......@@ -709,7 +709,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
parse_info->set_eval();
parse_info->set_toplevel();
parse_info->set_allow_lazy_parsing(false);
parse_info->set_lazy(false);
}
// Verify that OSR compilations are delegated to the correct graph builder.
......@@ -1252,7 +1251,6 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
parse_info.set_eval();
parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false);
parse_info.set_lazy(false);
}
info.MarkAsDebug();
if (GetUnoptimizedCode(&info).is_null()) {
......@@ -1279,7 +1277,6 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
parse_info.set_eval();
parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false);
parse_info.set_lazy(false);
}
info.MarkAsDebug();
if (GetUnoptimizedCode(&info).is_null()) {
......
......@@ -38,7 +38,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
: ParseInfo(zone) {
isolate_ = shared->GetIsolate();
set_lazy();
set_hash_seed(isolate_->heap()->HashSeed());
set_is_named_expression(shared->is_named_expression());
set_calls_eval(shared->scope_info()->CallsEval());
......
......@@ -45,7 +45,6 @@ class ParseInfo {
void setter(bool val) { SetFlag(flag, val); }
FLAG_ACCESSOR(kToplevel, is_toplevel, set_toplevel)
FLAG_ACCESSOR(kLazy, is_lazy, set_lazy)
FLAG_ACCESSOR(kEval, is_eval, set_eval)
FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode)
FLAG_ACCESSOR(kNative, is_native, set_native)
......
......@@ -3828,13 +3828,9 @@ bool Parser::Parse(ParseInfo* info) {
Isolate* isolate = info->isolate();
pre_parse_timer_ = isolate->counters()->pre_parse();
if (info->is_lazy()) {
if (!info->shared_info().is_null() && info->shared_info()->is_function()) {
DCHECK(!info->is_eval());
if (info->shared_info()->is_function()) {
result = ParseLazy(isolate, info);
} else {
result = ParseProgram(isolate, info);
}
result = ParseLazy(isolate, info);
} else {
SetCachedData(info);
result = ParseProgram(isolate, info);
......@@ -3876,12 +3872,12 @@ void Parser::ParseOnBackground(ParseInfo* info) {
// don't). We work around this by storing all the scopes which need their end
// position set at the end of the script (the top scope and possible eval
// scopes) and set their end position after we know the script length.
if (info->is_lazy()) {
result = DoParseLazy(info, info->function_name(), stream_ptr);
} else {
if (info->is_toplevel()) {
fni_ = new (zone()) FuncNameInferrer(ast_value_factory(), zone());
scanner_.Initialize(stream_ptr);
result = DoParseProgram(info);
} else {
result = DoParseLazy(info, info->function_name(), stream_ptr);
}
info->set_literal(result);
......
......@@ -52,7 +52,6 @@ class AsmTyperHarnessBuilder {
factory_->NewStringFromUtf8(CStrVector(source)).ToHandleChecked()),
script_(factory_->NewScript(source_code_)) {
ParseInfo info(zone_, script_);
info.set_lazy(false);
info.set_allow_lazy_parsing(false);
info.set_toplevel(true);
info.set_ast_value_factory(&ast_value_factory_);
......
......@@ -913,7 +913,6 @@ static void CheckParsesToNumber(const char* source, bool with_dot) {
i::ParseInfo info(handles.main_zone(), script);
i::Parser parser(&info);
info.set_lazy(false);
info.set_allow_lazy_parsing(false);
info.set_toplevel(true);
......
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