Commit 0ce296f1 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Rely on SharedFunctionInfo in UseIgnition.

This makes sure the SharedFunctionInfo is available whenever we evaluate
the UseIgnition predicate. This makes sure we can apply filters properly
even when the interpreter causes eager compilation (instead of lazy).

R=rmcilroy@chromium.org

Review URL: https://codereview.chromium.org/1860943002

Cr-Commit-Position: refs/heads/master@{#35263}
parent 99eea1e1
......@@ -797,13 +797,12 @@ bool CompileUnoptimizedCode(CompilationInfo* info) {
bool UseIgnition(CompilationInfo* info) {
// TODO(4681): Generator functions are not yet supported.
if ((info->has_shared_info() && info->shared_info()->is_generator()) ||
(info->has_literal() && IsGeneratorFunction(info->literal()->kind()))) {
if (info->shared_info()->is_generator()) {
return false;
}
// TODO(4681): Resuming a suspended frame is not supported.
if (info->has_shared_info() && info->shared_info()->HasBuiltinFunctionId() &&
if (info->shared_info()->HasBuiltinFunctionId() &&
(info->shared_info()->builtin_function_id() == kGeneratorObjectNext ||
info->shared_info()->builtin_function_id() == kGeneratorObjectReturn ||
info->shared_info()->builtin_function_id() == kGeneratorObjectThrow)) {
......@@ -811,13 +810,13 @@ bool UseIgnition(CompilationInfo* info) {
}
// Checks whether top level functions should be passed by the filter.
if (info->closure().is_null()) {
if (info->shared_info()->is_toplevel()) {
Vector<const char> filter = CStrVector(FLAG_ignition_filter);
return (filter.length() == 0) || (filter.length() == 1 && filter[0] == '*');
}
// Finally respect the filter.
return info->closure()->shared()->PassesFilter(FLAG_ignition_filter);
return info->shared_info()->PassesFilter(FLAG_ignition_filter);
}
int CodeAndMetadataSize(CompilationInfo* info) {
......@@ -1316,6 +1315,7 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
// Eval scripts cannot be (re-)compiled without context.
result->set_allows_lazy_compilation_without_context(false);
}
parse_info->set_shared_info(result);
// Compile the code.
if (!CompileBaselineCode(info)) {
......@@ -1763,6 +1763,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
ParseInfo parse_info(&zone, script);
CompilationInfo info(&parse_info);
parse_info.set_literal(literal);
parse_info.set_shared_info(result);
parse_info.set_scope(literal->scope());
parse_info.set_language_mode(literal->scope()->language_mode());
if (outer_info->will_serialize()) info.PrepareForSerializing();
......
......@@ -131,6 +131,7 @@ class ParseInfo {
Handle<Context> context() { return context_; }
void clear_script() { script_ = Handle<Script>::null(); }
void set_isolate(Isolate* isolate) { isolate_ = isolate; }
void set_shared_info(Handle<SharedFunctionInfo> shared) { shared_ = shared; }
void set_context(Handle<Context> context) { context_ = context; }
void set_script(Handle<Script> script) { script_ = script; }
//--------------------------------------------------------------------------
......@@ -202,7 +203,6 @@ class ParseInfo {
void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; }
bool GetFlag(Flag f) const { return (flags_ & f) != 0; }
void set_shared_info(Handle<SharedFunctionInfo> shared) { shared_ = shared; }
void set_closure(Handle<JSFunction> closure) { closure_ = closure; }
};
......
......@@ -523,11 +523,6 @@
# in interpreter.
'test-heap/CompilationCacheCachingBehavior': [FAIL],
# TODO(rmcilroy,4680): Fails with eager compilation due to SharedFunctionInfo
# being null in compiler.cc Renumber(), meaning MaybeDisableOptimization never
# gets called.
'test-profile-generator/BailoutReason': [FAIL],
# TODO(mstarzinger,4680): Fails due to the turbo-asm pipeline only being taken
# in compiler.cc GetLazyCode for uncompiled code, and no similar path for eager
# code.
......@@ -558,7 +553,6 @@
'test-run-inlining/InlineBuiltin': [FAIL],
'test-run-inlining/InlineTwiceDependent': [FAIL],
'test-run-inlining/SimpleInliningContextDeopt': [FAIL],
'test-debug/DebugBreakInline': [FAIL],
}], # ignition == 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