Commit ec12d3d5 authored by Yoshisato Yanagisawa's avatar Yoshisato Yanagisawa Committed by V8 LUCI CQ

Fix: Experimental_IsNopFunction should not compile twice.

In the previous CL
(https://chromium-review.googlesource.com/c/v8/v8/+/3778969), we
executed i::Compiler::Compile regardless of the function has been
compiled or not.  That caused DCHECK failures in the Compile function,
which allows to compile only once.

Bug: chromium:1347319
Change-Id: I240591cbec46dc4fac4028a80a8ba5ab2f05c450
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3806929Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82217}
parent 5242128f
......@@ -5427,7 +5427,8 @@ bool Function::Experimental_IsNopFunction() const {
i::SharedFunctionInfo sfi = i::JSFunction::cast(*self).shared();
i::Isolate* i_isolate = sfi.GetIsolate();
i::IsCompiledScope is_compiled_scope(sfi.is_compiled_scope(i_isolate));
if (!i::Compiler::Compile(i_isolate, i::handle(sfi, i_isolate),
if (!is_compiled_scope.is_compiled() &&
!i::Compiler::Compile(i_isolate, i::handle(sfi, i_isolate),
i::Compiler::CLEAR_EXCEPTION, &is_compiled_scope)) {
return false;
}
......
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