Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: test/cctest/compiler/test-run-unwinding-info.cc

Issue 2026313002: Emit unwinding information for TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame
Patch Set: MarkFrameConstructed inside has_frame branch on ARM. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-unwinding-info.cc
diff --git a/test/cctest/compiler/test-run-unwinding-info.cc b/test/cctest/compiler/test-run-unwinding-info.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4536725d4fe8dcd96f9b5a327d417d42eb7ef5ff
--- /dev/null
+++ b/test/cctest/compiler/test-run-unwinding-info.cc
@@ -0,0 +1,58 @@
+// 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 defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_ARM) || \
+ defined(V8_TARGET_ARCH_ARM64)
+
+#include "test/cctest/compiler/function-tester.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+TEST(RunUnwindingInfo) {
+ FLAG_turbo = 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
« no previous file with comments | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698