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