Commit 8f66bb64 authored by verwaest's avatar verwaest Committed by Commit bot

Mark ParseInfo as top-level in the constructors

If we're parsing a script or based on a SharedFunctionInfo marked as toplevel, we can implicitly set it. Only manually set in the background parsing task where we manually set up ParseInfo.

BUG=v8:5501

Review-Url: https://codereview.chromium.org/2405263003
Cr-Commit-Position: refs/heads/master@{#40215}
parent 35fc3d58
......@@ -707,7 +707,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
if (IsEvalToplevel(shared)) {
parse_info->set_eval();
parse_info->set_toplevel();
parse_info->set_allow_lazy_parsing(false);
}
......@@ -1045,8 +1044,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
isolate->debug()->OnBeforeCompile(script);
parse_info->set_toplevel();
Handle<SharedFunctionInfo> result;
{ VMState<COMPILER> state(info->isolate());
......@@ -1239,7 +1236,6 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
if (IsEvalToplevel(handle(function->shared()))) {
parse_info.set_eval();
parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false);
}
info.MarkAsDebug();
......@@ -1265,7 +1261,6 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
if (IsEvalToplevel(shared)) {
parse_info.set_eval();
parse_info.set_toplevel();
parse_info.set_allow_lazy_parsing(false);
}
info.MarkAsDebug();
......
......@@ -93,7 +93,6 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
// Global or eval code.
Handle<Script> script(Script::cast(shared_info->script()));
info.reset(new ParseInfo(&zone, script));
info->set_toplevel();
if (scope_info->scope_type() == EVAL_SCOPE) {
info->set_eval();
if (!function->context()->IsNativeContext()) {
......
......@@ -38,6 +38,7 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
: ParseInfo(zone) {
isolate_ = shared->GetIsolate();
set_toplevel(shared->is_toplevel());
set_allow_lazy_parsing(FLAG_lazy_inner_functions);
set_hash_seed(isolate_->heap()->HashSeed());
set_is_named_expression(shared->is_named_expression());
......@@ -66,6 +67,7 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
isolate_ = script->GetIsolate();
set_toplevel();
set_hash_seed(isolate_->heap()->HashSeed());
set_stack_limit(isolate_->stack_guard()->real_climit());
set_unicode_cache(isolate_->unicode_cache());
......
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