| OLD | NEW |
| 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" // Needed here to get TARGET_ARCH_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
| 6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace dart { | 26 namespace dart { |
| 27 | 27 |
| 28 DECLARE_FLAG(bool, emit_edge_counters); | 28 DECLARE_FLAG(bool, emit_edge_counters); |
| 29 DECLARE_FLAG(int, optimization_counter_threshold); | 29 DECLARE_FLAG(int, optimization_counter_threshold); |
| 30 | 30 |
| 31 // List of instructions that are still unimplemented by DBC backend. | 31 // List of instructions that are still unimplemented by DBC backend. |
| 32 #define FOR_EACH_UNIMPLEMENTED_INSTRUCTION(M) \ | 32 #define FOR_EACH_UNIMPLEMENTED_INSTRUCTION(M) \ |
| 33 M(IndirectGoto) \ | 33 M(IndirectGoto) \ |
| 34 M(LoadCodeUnits) \ | 34 M(LoadCodeUnits) \ |
| 35 M(InstanceOf) \ | |
| 36 M(LoadUntagged) \ | 35 M(LoadUntagged) \ |
| 37 M(AllocateUninitializedContext) \ | 36 M(AllocateUninitializedContext) \ |
| 38 M(BinaryInt32Op) \ | 37 M(BinaryInt32Op) \ |
| 39 M(UnaryDoubleOp) \ | 38 M(UnaryDoubleOp) \ |
| 40 M(SmiToDouble) \ | 39 M(SmiToDouble) \ |
| 41 M(Int32ToDouble) \ | 40 M(Int32ToDouble) \ |
| 42 M(MintToDouble) \ | 41 M(MintToDouble) \ |
| 43 M(DoubleToInteger) \ | 42 M(DoubleToInteger) \ |
| 44 M(DoubleToSmi) \ | 43 M(DoubleToSmi) \ |
| 45 M(DoubleToDouble) \ | 44 M(DoubleToDouble) \ |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 FOR_EACH_UNIMPLEMENTED_INSTRUCTION(DEFINE_UNIMPLEMENTED) | 171 FOR_EACH_UNIMPLEMENTED_INSTRUCTION(DEFINE_UNIMPLEMENTED) |
| 173 | 172 |
| 174 #undef DEFINE_UNIMPLEMENTED | 173 #undef DEFINE_UNIMPLEMENTED |
| 175 | 174 |
| 176 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(TestCids) | 175 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(TestCids) |
| 177 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(TestSmi) | 176 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(TestSmi) |
| 178 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(RelationalOp) | 177 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(RelationalOp) |
| 179 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(EqualityCompare) | 178 DEFINE_UNIMPLEMENTED_EMIT_BRANCH_CODE(EqualityCompare) |
| 180 | 179 |
| 181 | 180 |
| 181 EMIT_NATIVE_CODE(InstanceOf, 2, Location::SameAsFirstInput(), |
| 182 LocationSummary::kCall) { |
| 183 SubtypeTestCache& test_cache = SubtypeTestCache::Handle(); |
| 184 if (!type().IsVoidType() && type().IsInstantiated()) { |
| 185 test_cache = SubtypeTestCache::New(); |
| 186 } |
| 187 |
| 188 if (compiler->is_optimizing()) { |
| 189 __ Push(locs()->in(0).reg()); // Value. |
| 190 __ Push(locs()->in(1).reg()); // Instantiator type arguments. |
| 191 } |
| 192 |
| 193 __ PushConstant(type()); |
| 194 __ PushConstant(test_cache); |
| 195 __ InstanceOf(negate_result() ? 1 : 0); |
| 196 compiler->RecordSafepoint(locs()); |
| 197 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, |
| 198 deopt_id(), |
| 199 token_pos()); |
| 200 |
| 201 if (compiler->is_optimizing()) { |
| 202 __ PopLocal(locs()->out(0).reg()); |
| 203 } |
| 204 } |
| 205 |
| 206 |
| 182 DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 2, | 207 DEFINE_MAKE_LOCATION_SUMMARY(AssertAssignable, 2, |
| 183 Location::SameAsFirstInput(), | 208 Location::SameAsFirstInput(), |
| 184 LocationSummary::kCall); | 209 LocationSummary::kCall); |
| 185 | 210 |
| 186 | 211 |
| 187 EMIT_NATIVE_CODE(AssertBoolean, | 212 EMIT_NATIVE_CODE(AssertBoolean, |
| 188 1, Location::SameAsFirstInput(), | 213 1, Location::SameAsFirstInput(), |
| 189 LocationSummary::kCall) { | 214 LocationSummary::kCall) { |
| 190 if (compiler->is_optimizing()) { | 215 if (compiler->is_optimizing()) { |
| 191 __ Push(locs()->in(0).reg()); | 216 __ Push(locs()->in(0).reg()); |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 __ BitNot(locs()->out(0).reg(), locs()->in(0).reg()); | 1039 __ BitNot(locs()->out(0).reg(), locs()->in(0).reg()); |
| 1015 break; | 1040 break; |
| 1016 default: | 1041 default: |
| 1017 UNREACHABLE(); | 1042 UNREACHABLE(); |
| 1018 } | 1043 } |
| 1019 } | 1044 } |
| 1020 | 1045 |
| 1021 } // namespace dart | 1046 } // namespace dart |
| 1022 | 1047 |
| 1023 #endif // defined TARGET_ARCH_DBC | 1048 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |