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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/constants_dbc.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_DBC) 6 #if defined(TARGET_ARCH_DBC)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/stack_frame.h" 9 #include "vm/stack_frame.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 1125
1126 1126
1127 ASSEMBLER_TEST_RUN(CreateArrayTOS, test) { 1127 ASSEMBLER_TEST_RUN(CreateArrayTOS, test) {
1128 const Object& obj = EXECUTE_TEST_CODE_OBJECT(test->code()); 1128 const Object& obj = EXECUTE_TEST_CODE_OBJECT(test->code());
1129 EXPECT(obj.IsArray()); 1129 EXPECT(obj.IsArray());
1130 Array& array = Array::Handle(); 1130 Array& array = Array::Handle();
1131 array ^= obj.raw(); 1131 array ^= obj.raw();
1132 EXPECT_EQ(10, array.Length()); 1132 EXPECT_EQ(10, array.Length());
1133 } 1133 }
1134 1134
1135
1136 // - CheckSmi rA
1137 //
1138 // If FP[rA] is a Smi, then skip the next instruction.
1139 ASSEMBLER_TEST_GENERATE(CheckSmiPass, assembler) {
1140 __ Frame(1);
1141 __ PushConstant(Smi::Handle(Smi::New(42)));
1142 __ LoadConstant(0, Smi::Handle(Smi::New(0)));
1143 __ CheckSmi(0);
1144 __ PushConstant(Smi::Handle(Smi::New(-1)));
1145 __ ReturnTOS();
1146 }
1147
1148
1149 ASSEMBLER_TEST_RUN(CheckSmiPass, test) {
1150 EXPECT_EQ(42, EXECUTE_TEST_CODE_INTPTR(test->code()));
1151 }
1152
1153
1154 ASSEMBLER_TEST_GENERATE(CheckSmiFail, assembler) {
1155 __ Frame(1);
1156 __ PushConstant(Smi::Handle(Smi::New(-1)));
1157 __ LoadConstant(0, Bool::True());
1158 __ CheckSmi(0);
1159 __ PushConstant(Smi::Handle(Smi::New(42)));
1160 __ ReturnTOS();
1161 }
1162
1163
1164 ASSEMBLER_TEST_RUN(CheckSmiFail, test) {
1165 EXPECT_EQ(42, EXECUTE_TEST_CODE_INTPTR(test->code()));
1166 }
1167
1135 } // namespace dart 1168 } // namespace dart
1136 1169
1137 #endif // defined(TARGET_ARCH_DBC) 1170 #endif // defined(TARGET_ARCH_DBC)
OLDNEW
« 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