Mark ParseInfo as eval in the constructors
BUG=v8:5501 Review-Url: https://codereview.chromium.org/2413673002 Cr-Commit-Position: refs/heads/master@{#40227}
This commit is contained in:
parent
fa814c6119
commit
d3d64736f7
@ -251,12 +251,6 @@ void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) {
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsEvalToplevel(Handle<SharedFunctionInfo> shared) {
|
||||
return shared->is_toplevel() && shared->script()->IsScript() &&
|
||||
Script::cast(shared->script())->compilation_type() ==
|
||||
Script::COMPILATION_TYPE_EVAL;
|
||||
}
|
||||
|
||||
bool Parse(ParseInfo* info) {
|
||||
// Create a canonical handle scope if compiling ignition bytecode. This is
|
||||
// required by the constant array builder to de-duplicate objects without
|
||||
@ -705,11 +699,6 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
|
||||
info->MarkAsOptimizeFromBytecode();
|
||||
}
|
||||
|
||||
if (IsEvalToplevel(shared)) {
|
||||
parse_info->set_eval();
|
||||
parse_info->set_allow_lazy_parsing(false);
|
||||
}
|
||||
|
||||
// Verify that OSR compilations are delegated to the correct graph builder.
|
||||
// Depending on the underlying frame the semantics of the {BailoutId} differ
|
||||
// and the various graph builders hard-code a certain semantic:
|
||||
@ -1234,10 +1223,6 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
|
||||
Zone zone(isolate->allocator());
|
||||
ParseInfo parse_info(&zone, function);
|
||||
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
|
||||
if (IsEvalToplevel(handle(function->shared()))) {
|
||||
parse_info.set_eval();
|
||||
parse_info.set_allow_lazy_parsing(false);
|
||||
}
|
||||
info.MarkAsDebug();
|
||||
if (GetUnoptimizedCode(&info).is_null()) {
|
||||
isolate->clear_pending_exception();
|
||||
@ -1259,10 +1244,6 @@ bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
|
||||
Zone zone(isolate->allocator());
|
||||
ParseInfo parse_info(&zone, shared);
|
||||
CompilationInfo info(&parse_info, Handle<JSFunction>::null());
|
||||
if (IsEvalToplevel(shared)) {
|
||||
parse_info.set_eval();
|
||||
parse_info.set_allow_lazy_parsing(false);
|
||||
}
|
||||
info.MarkAsDebug();
|
||||
if (GetUnoptimizedCode(&info).is_null()) {
|
||||
isolate->clear_pending_exception();
|
||||
|
@ -53,9 +53,8 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
|
||||
|
||||
Handle<Script> script(Script::cast(shared->script()));
|
||||
set_script(script);
|
||||
if (!script.is_null() && script->type() == Script::TYPE_NATIVE) {
|
||||
set_native();
|
||||
}
|
||||
set_native(script->type() == Script::TYPE_NATIVE);
|
||||
set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL);
|
||||
|
||||
Handle<HeapObject> scope_info(shared->outer_scope_info());
|
||||
if (!scope_info->IsTheHole(isolate()) &&
|
||||
@ -73,9 +72,8 @@ ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
|
||||
set_unicode_cache(isolate_->unicode_cache());
|
||||
set_script(script);
|
||||
|
||||
if (script->type() == Script::TYPE_NATIVE) {
|
||||
set_native();
|
||||
}
|
||||
set_native(script->type() == Script::TYPE_NATIVE);
|
||||
set_eval(script->compilation_type() == Script::COMPILATION_TYPE_EVAL);
|
||||
}
|
||||
|
||||
ParseInfo::~ParseInfo() {
|
||||
|
@ -3825,7 +3825,6 @@ bool Parser::Parse(ParseInfo* info) {
|
||||
pre_parse_timer_ = isolate->counters()->pre_parse();
|
||||
|
||||
if (!info->shared_info().is_null() && info->shared_info()->is_function()) {
|
||||
DCHECK(!info->is_eval());
|
||||
result = ParseLazy(isolate, info);
|
||||
} else {
|
||||
SetCachedData(info);
|
||||
|
Loading…
Reference in New Issue
Block a user