v8/test/cctest/compiler/test-run-unwinding-info.cc
Clemens Backes 25f242ad76 Remove --perf-prof flag on non-linux
The fuzzers picked up this flag, and are now complaining that they run
into UNREACHABLE/FATAL too often because the {PerfJitLogger} is not
implemented on non-linux platforms.
This CL removes the flag if it's not supported, so users get a warning
about the unknown flag, but otherwise it's ignored. This should unblock
the fuzzers, and slightly reduces binary size on non-linux.

R=ahaas@chromium.org

Bug: chromium:1035233
Change-Id: I6b9282318bc82ff23173bc83ae31cb2d8cbdcdb7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1993969
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65695}
2020-01-10 13:58:50 +00:00

63 lines
1.9 KiB
C++

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Test enabled only on supported architectures.
#if V8_OS_LINUX && \
(defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
defined(V8_TARGET_ARCH_ARM64))
#include "src/flags/flags.h"
#include "src/objects/objects-inl.h"
#include "src/objects/objects.h"
#include "test/cctest/compiler/function-tester.h"
namespace v8 {
namespace internal {
namespace compiler {
TEST(RunUnwindingInfo) {
FLAG_always_opt = true;
FLAG_perf_prof_unwinding_info = true;
FunctionTester tester(
"(function (x) {\n"
" function f(x) { return x*x; }\n"
" return x > 0 ? x+1 : f(x);\n"
"})");
tester.Call(tester.Val(-1));
CHECK(tester.function->code().has_unwinding_info());
}
// TODO(ssanfilippo) Build low-level graph and check that state is correctly
// restored in the following situation:
//
// +-----------------+
// | no frame |---+
// check that a +-----------------+ |
// a noframe state | construct frame |<--+
// is restored here --> +-----------------+ |
// | construct frame |<--+
// +-----------------+
//
// Same for <construct>/<destruct>/<destruct> (a <construct> status is restored)
// TODO(ssanfilippo) Intentionally reach a BB with different initial states
// and check that the UnwindingInforWriter fails in debug mode:
//
// +----------------+
// +---| State A |
// | +----------------+
// | | State B != A |---+
// | +----------------+ |
// +-->| Failure here |<--+
// +----------------+
} // namespace compiler
} // namespace internal
} // namespace v8
#endif