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

Unified Diff: runtime/vm/assembler_dbc_test.cc

Issue 2039913006: DBC: Eager deoptimization and CheckSmi instruction. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 6 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 | « runtime/tests/vm/vm.status ('k') | runtime/vm/constants_dbc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_dbc_test.cc
diff --git a/runtime/vm/assembler_dbc_test.cc b/runtime/vm/assembler_dbc_test.cc
index 3d5b7514249bef94e77a36f5181e68c69cebebd4..0542ae697d50bcfdbd9ffdc1ebbf927344455535 100644
--- a/runtime/vm/assembler_dbc_test.cc
+++ b/runtime/vm/assembler_dbc_test.cc
@@ -1132,6 +1132,39 @@ ASSEMBLER_TEST_RUN(CreateArrayTOS, test) {
EXPECT_EQ(10, array.Length());
}
+
+// - CheckSmi rA
+//
+// If FP[rA] is a Smi, then skip the next instruction.
+ASSEMBLER_TEST_GENERATE(CheckSmiPass, assembler) {
+ __ Frame(1);
+ __ PushConstant(Smi::Handle(Smi::New(42)));
+ __ LoadConstant(0, Smi::Handle(Smi::New(0)));
+ __ CheckSmi(0);
+ __ PushConstant(Smi::Handle(Smi::New(-1)));
+ __ ReturnTOS();
+}
+
+
+ASSEMBLER_TEST_RUN(CheckSmiPass, test) {
+ EXPECT_EQ(42, EXECUTE_TEST_CODE_INTPTR(test->code()));
+}
+
+
+ASSEMBLER_TEST_GENERATE(CheckSmiFail, assembler) {
+ __ Frame(1);
+ __ PushConstant(Smi::Handle(Smi::New(-1)));
+ __ LoadConstant(0, Bool::True());
+ __ CheckSmi(0);
+ __ PushConstant(Smi::Handle(Smi::New(42)));
+ __ ReturnTOS();
+}
+
+
+ASSEMBLER_TEST_RUN(CheckSmiFail, test) {
+ EXPECT_EQ(42, EXECUTE_TEST_CODE_INTPTR(test->code()));
+}
+
} // namespace dart
#endif // defined(TARGET_ARCH_DBC)
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/constants_dbc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698