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

Unified Diff: test/cctest/compiler/test-run-inlining.cc

Issue 612043003: Add inlining for intrinsics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Move decls. Created 6 years, 2 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 | « src/flag-definitions.h ('k') | test/cctest/compiler/test-run-intrinsics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-inlining.cc
diff --git a/test/cctest/compiler/test-run-inlining.cc b/test/cctest/compiler/test-run-inlining.cc
index ad82fecaa20fab5e7f8f8eb7e8b274781cb38fe9..8656b986b43033dba9ac6f0fcaeabb4fd1233427 100644
--- a/test/cctest/compiler/test-run-inlining.cc
+++ b/test/cctest/compiler/test-run-inlining.cc
@@ -350,4 +350,101 @@ TEST(InlineNonStrictIntoStrict) {
}
+TEST(InlineIntrinsicIsSmi) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T(
+ "(function () {"
+ "var x = 42;"
+ "function bar(s,t) { return %_IsSmi(x); };"
+ "return bar;"
+ "})();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ InstallAssertInlineCountHelper(CcTest::isolate());
+ T.CheckCall(T.true_value(), T.Val(12), T.Val(4));
+}
+
+
+TEST(InlineIntrinsicIsNonNegativeSmi) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T(
+ "(function () {"
+ "var x = 42;"
+ "function bar(s,t) { return %_IsNonNegativeSmi(x); };"
+ "return bar;"
+ "})();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ InstallAssertInlineCountHelper(CcTest::isolate());
+ T.CheckCall(T.true_value(), T.Val(12), T.Val(4));
+}
+
+
+TEST(InlineIntrinsicIsArray) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T(
+ "(function () {"
+ "var x = [1,2,3];"
+ "function bar(s,t) { return %_IsArray(x); };"
+ "return bar;"
+ "})();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ InstallAssertInlineCountHelper(CcTest::isolate());
+ T.CheckCall(T.true_value(), T.Val(12), T.Val(4));
+
+ FunctionTester T2(
+ "(function () {"
+ "var x = 32;"
+ "function bar(s,t) { return %_IsArray(x); };"
+ "return bar;"
+ "})();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ T2.CheckCall(T.false_value(), T.Val(12), T.Val(4));
+
+ FunctionTester T3(
+ "(function () {"
+ "var x = bar;"
+ "function bar(s,t) { return %_IsArray(x); };"
+ "return bar;"
+ "})();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ T3.CheckCall(T.false_value(), T.Val(12), T.Val(4));
+}
+
+
+TEST(InlineWithArguments) {
+ FLAG_turbo_deoptimization = true;
+ FunctionTester T(
+ "(function () {"
+ " function foo(s,t,u) { AssertInlineCount(2); "
+ " return foo.arguments.length == 3 && "
+ " foo.arguments[0] == 13 && "
+ " foo.arguments[1] == 14 && "
+ " foo.arguments[2] == 15; "
+ " }"
+ " function bar() { return foo(13, 14, 15); };"
+ " return bar;"
+ "}"
+ ")();",
+ CompilationInfo::kInliningEnabled |
+ CompilationInfo::kContextSpecializing |
+ CompilationInfo::kTypingEnabled);
+
+ InstallAssertInlineCountHelper(CcTest::isolate());
+ T.CheckCall(T.true_value(), T.Val(12), T.Val(14));
+}
+
#endif // V8_TURBOFAN_TARGET
« no previous file with comments | « src/flag-definitions.h ('k') | test/cctest/compiler/test-run-intrinsics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698