Commit 18f28757 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[parser] Remove obsolete ParseInfo::is_global flag.

R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2392303004
Cr-Commit-Position: refs/heads/master@{#40070}
parent 0d2830a2
...@@ -37,7 +37,6 @@ BackgroundParsingTask::BackgroundParsingTask( ...@@ -37,7 +37,6 @@ BackgroundParsingTask::BackgroundParsingTask(
info->set_source_stream(source->source_stream.get()); info->set_source_stream(source->source_stream.get());
info->set_source_stream_encoding(source->encoding); info->set_source_stream_encoding(source->encoding);
info->set_hash_seed(isolate->heap()->HashSeed()); info->set_hash_seed(isolate->heap()->HashSeed());
info->set_global();
info->set_unicode_cache(&source_->unicode_cache); info->set_unicode_cache(&source_->unicode_cache);
info->set_compile_options(options); info->set_compile_options(options);
// Parse eagerly with ignition since we will compile eagerly. // Parse eagerly with ignition since we will compile eagerly.
......
...@@ -719,7 +719,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, ...@@ -719,7 +719,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
if (IsEvalToplevel(shared)) { if (IsEvalToplevel(shared)) {
parse_info->set_eval(); parse_info->set_eval();
if (function->context()->IsNativeContext()) parse_info->set_global();
parse_info->set_toplevel(); parse_info->set_toplevel();
parse_info->set_allow_lazy_parsing(false); parse_info->set_allow_lazy_parsing(false);
parse_info->set_lazy(false); parse_info->set_lazy(false);
...@@ -1059,9 +1058,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) { ...@@ -1059,9 +1058,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
isolate->debug()->OnBeforeCompile(script); isolate->debug()->OnBeforeCompile(script);
DCHECK(parse_info->is_eval() || parse_info->is_global() ||
parse_info->is_module());
parse_info->set_toplevel(); parse_info->set_toplevel();
Handle<SharedFunctionInfo> result; Handle<SharedFunctionInfo> result;
...@@ -1276,7 +1272,6 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) { ...@@ -1276,7 +1272,6 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
CompilationInfo info(&parse_info, Handle<JSFunction>::null()); CompilationInfo info(&parse_info, Handle<JSFunction>::null());
if (IsEvalToplevel(handle(function->shared()))) { if (IsEvalToplevel(handle(function->shared()))) {
parse_info.set_eval(); parse_info.set_eval();
if (function->context()->IsNativeContext()) parse_info.set_global();
parse_info.set_toplevel(); parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false); parse_info.set_allow_lazy_parsing(false);
parse_info.set_lazy(false); parse_info.set_lazy(false);
...@@ -1331,7 +1326,6 @@ MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) { ...@@ -1331,7 +1326,6 @@ MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) {
Zone zone(isolate->allocator()); Zone zone(isolate->allocator());
ParseInfo parse_info(&zone, script); ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info, Handle<JSFunction>::null()); CompilationInfo info(&parse_info, Handle<JSFunction>::null());
parse_info.set_global();
info.MarkAsDebug(); info.MarkAsDebug();
// TODO(635): support extensions. // TODO(635): support extensions.
...@@ -1481,7 +1475,6 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval( ...@@ -1481,7 +1475,6 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
ParseInfo parse_info(&zone, script); ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info, Handle<JSFunction>::null()); CompilationInfo info(&parse_info, Handle<JSFunction>::null());
parse_info.set_eval(); parse_info.set_eval();
if (context->IsNativeContext()) parse_info.set_global();
parse_info.set_language_mode(language_mode); parse_info.set_language_mode(language_mode);
parse_info.set_parse_restriction(restriction); parse_info.set_parse_restriction(restriction);
if (!context->IsNativeContext()) { if (!context->IsNativeContext()) {
...@@ -1649,11 +1642,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript( ...@@ -1649,11 +1642,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
Zone zone(isolate->allocator()); Zone zone(isolate->allocator());
ParseInfo parse_info(&zone, script); ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info, Handle<JSFunction>::null()); CompilationInfo info(&parse_info, Handle<JSFunction>::null());
if (is_module) { if (is_module) parse_info.set_module();
parse_info.set_module();
} else {
parse_info.set_global();
}
if (compile_options != ScriptCompiler::kNoCompileOptions) { if (compile_options != ScriptCompiler::kNoCompileOptions) {
parse_info.set_cached_data(cached_data); parse_info.set_cached_data(cached_data);
} }
......
...@@ -94,10 +94,7 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, ...@@ -94,10 +94,7 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
Handle<Script> script(Script::cast(shared_info->script())); Handle<Script> script(Script::cast(shared_info->script()));
info.reset(new ParseInfo(&zone, script)); info.reset(new ParseInfo(&zone, script));
info->set_toplevel(); info->set_toplevel();
if (scope_info->scope_type() == SCRIPT_SCOPE) { if (scope_info->scope_type() == EVAL_SCOPE) {
info->set_global();
} else {
DCHECK(scope_info->scope_type() == EVAL_SCOPE);
info->set_eval(); info->set_eval();
if (!function->context()->IsNativeContext()) { if (!function->context()->IsNativeContext()) {
info->set_outer_scope_info(handle(function->context()->scope_info())); info->set_outer_scope_info(handle(function->context()->scope_info()));
...@@ -105,6 +102,8 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector, ...@@ -105,6 +102,8 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
// Language mode may be inherited from the eval caller. // Language mode may be inherited from the eval caller.
// Retrieve it from shared function info. // Retrieve it from shared function info.
info->set_language_mode(shared_info->language_mode()); info->set_language_mode(shared_info->language_mode());
} else {
DCHECK(scope_info->scope_type() == SCRIPT_SCOPE);
} }
} else { } else {
// Inner function. // Inner function.
......
...@@ -47,7 +47,6 @@ class ParseInfo { ...@@ -47,7 +47,6 @@ class ParseInfo {
FLAG_ACCESSOR(kToplevel, is_toplevel, set_toplevel) FLAG_ACCESSOR(kToplevel, is_toplevel, set_toplevel)
FLAG_ACCESSOR(kLazy, is_lazy, set_lazy) FLAG_ACCESSOR(kLazy, is_lazy, set_lazy)
FLAG_ACCESSOR(kEval, is_eval, set_eval) FLAG_ACCESSOR(kEval, is_eval, set_eval)
FLAG_ACCESSOR(kGlobal, is_global, set_global)
FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode) FLAG_ACCESSOR(kStrictMode, is_strict_mode, set_strict_mode)
FLAG_ACCESSOR(kNative, is_native, set_native) FLAG_ACCESSOR(kNative, is_native, set_native)
FLAG_ACCESSOR(kModule, is_module, set_module) FLAG_ACCESSOR(kModule, is_module, set_module)
...@@ -198,16 +197,15 @@ class ParseInfo { ...@@ -198,16 +197,15 @@ class ParseInfo {
kToplevel = 1 << 0, kToplevel = 1 << 0,
kLazy = 1 << 1, kLazy = 1 << 1,
kEval = 1 << 2, kEval = 1 << 2,
kGlobal = 1 << 3, kStrictMode = 1 << 3,
kStrictMode = 1 << 4, kNative = 1 << 4,
kNative = 1 << 5, kParseRestriction = 1 << 5,
kParseRestriction = 1 << 6, kModule = 1 << 6,
kModule = 1 << 7, kAllowLazyParsing = 1 << 7,
kAllowLazyParsing = 1 << 8, kIsNamedExpression = 1 << 8,
kIsNamedExpression = 1 << 9, kCallsEval = 1 << 9,
kCallsEval = 1 << 10,
// ---------- Output flags -------------------------- // ---------- Output flags --------------------------
kAstValueFactoryOwned = 1 << 11 kAstValueFactoryOwned = 1 << 10
}; };
//------------- Inputs to parsing and scope analysis ----------------------- //------------- Inputs to parsing and scope analysis -----------------------
......
...@@ -52,7 +52,6 @@ class AsmTyperHarnessBuilder { ...@@ -52,7 +52,6 @@ class AsmTyperHarnessBuilder {
factory_->NewStringFromUtf8(CStrVector(source)).ToHandleChecked()), factory_->NewStringFromUtf8(CStrVector(source)).ToHandleChecked()),
script_(factory_->NewScript(source_code_)) { script_(factory_->NewScript(source_code_)) {
ParseInfo info(zone_, script_); ParseInfo info(zone_, script_);
info.set_global();
info.set_lazy(false); info.set_lazy(false);
info.set_allow_lazy_parsing(false); info.set_allow_lazy_parsing(false);
info.set_toplevel(true); info.set_toplevel(true);
......
...@@ -858,7 +858,6 @@ TEST(ScopeUsesArgumentsSuperThis) { ...@@ -858,7 +858,6 @@ TEST(ScopeUsesArgumentsSuperThis) {
i::Zone zone(CcTest::i_isolate()->allocator()); i::Zone zone(CcTest::i_isolate()->allocator());
i::ParseInfo info(&zone, script); i::ParseInfo info(&zone, script);
i::Parser parser(&info); i::Parser parser(&info);
info.set_global();
CHECK(parser.Parse(&info)); CHECK(parser.Parse(&info));
CHECK(i::Rewriter::Rewrite(&info)); CHECK(i::Rewriter::Rewrite(&info));
i::DeclarationScope::Analyze(&info, i::AnalyzeMode::kRegular); i::DeclarationScope::Analyze(&info, i::AnalyzeMode::kRegular);
...@@ -914,7 +913,6 @@ static void CheckParsesToNumber(const char* source, bool with_dot) { ...@@ -914,7 +913,6 @@ static void CheckParsesToNumber(const char* source, bool with_dot) {
i::ParseInfo info(handles.main_zone(), script); i::ParseInfo info(handles.main_zone(), script);
i::Parser parser(&info); i::Parser parser(&info);
info.set_global();
info.set_lazy(false); info.set_lazy(false);
info.set_allow_lazy_parsing(false); info.set_allow_lazy_parsing(false);
info.set_toplevel(true); info.set_toplevel(true);
...@@ -1179,7 +1177,6 @@ TEST(ScopePositions) { ...@@ -1179,7 +1177,6 @@ TEST(ScopePositions) {
i::ParseInfo info(&zone, script); i::ParseInfo info(&zone, script);
i::Parser parser(&info); i::Parser parser(&info);
parser.set_allow_lazy(true); parser.set_allow_lazy(true);
info.set_global();
info.set_language_mode(source_data[i].language_mode); info.set_language_mode(source_data[i].language_mode);
parser.Parse(&info); parser.Parse(&info);
CHECK(info.literal() != NULL); CHECK(info.literal() != NULL);
...@@ -1374,11 +1371,7 @@ void TestParserSyncWithFlags(i::Handle<i::String> source, ...@@ -1374,11 +1371,7 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
i::ParseInfo info(&zone, script); i::ParseInfo info(&zone, script);
i::Parser parser(&info); i::Parser parser(&info);
SetParserFlags(&parser, flags); SetParserFlags(&parser, flags);
if (is_module) { if (is_module) info.set_module();
info.set_module();
} else {
info.set_global();
}
parser.Parse(&info); parser.Parse(&info);
function = info.literal(); function = info.literal();
if (function) { if (function) {
...@@ -5690,7 +5683,6 @@ TEST(BasicImportExportParsing) { ...@@ -5690,7 +5683,6 @@ TEST(BasicImportExportParsing) {
i::Zone zone(CcTest::i_isolate()->allocator()); i::Zone zone(CcTest::i_isolate()->allocator());
i::ParseInfo info(&zone, script); i::ParseInfo info(&zone, script);
i::Parser parser(&info); i::Parser parser(&info);
info.set_global();
CHECK(!parser.Parse(&info)); CHECK(!parser.Parse(&info));
isolate->clear_pending_exception(); isolate->clear_pending_exception();
} }
...@@ -6269,7 +6261,6 @@ void TestLanguageMode(const char* source, ...@@ -6269,7 +6261,6 @@ void TestLanguageMode(const char* source,
i::Zone zone(CcTest::i_isolate()->allocator()); i::Zone zone(CcTest::i_isolate()->allocator());
i::ParseInfo info(&zone, script); i::ParseInfo info(&zone, script);
i::Parser parser(&info); i::Parser parser(&info);
info.set_global();
parser.Parse(&info); parser.Parse(&info);
CHECK(info.literal() != NULL); CHECK(info.literal() != NULL);
CHECK_EQ(expected_language_mode, info.literal()->language_mode()); CHECK_EQ(expected_language_mode, info.literal()->language_mode());
......
...@@ -36,7 +36,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { ...@@ -36,7 +36,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
factory->NewScript(source.ToHandleChecked()); factory->NewScript(source.ToHandleChecked());
v8::internal::Zone zone(i_isolate->allocator()); v8::internal::Zone zone(i_isolate->allocator());
v8::internal::ParseInfo info(&zone, script); v8::internal::ParseInfo info(&zone, script);
info.set_global();
v8::internal::Parser parser(&info); v8::internal::Parser parser(&info);
parser.Parse(&info); parser.Parse(&info);
isolate->RequestGarbageCollectionForTesting( isolate->RequestGarbageCollectionForTesting(
......
...@@ -95,7 +95,6 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser( ...@@ -95,7 +95,6 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
{ {
Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator()); Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator());
ParseInfo info(&zone, script); ParseInfo info(&zone, script);
info.set_global();
info.set_cached_data(&cached_data_impl); info.set_cached_data(&cached_data_impl);
info.set_compile_options(v8::ScriptCompiler::kProduceParserCache); info.set_compile_options(v8::ScriptCompiler::kProduceParserCache);
v8::base::ElapsedTimer timer; v8::base::ElapsedTimer timer;
...@@ -113,7 +112,6 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser( ...@@ -113,7 +112,6 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
{ {
Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator()); Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator());
ParseInfo info(&zone, script); ParseInfo info(&zone, script);
info.set_global();
info.set_cached_data(&cached_data_impl); info.set_cached_data(&cached_data_impl);
info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache); info.set_compile_options(v8::ScriptCompiler::kConsumeParserCache);
v8::base::ElapsedTimer timer; v8::base::ElapsedTimer timer;
......
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