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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1112 } | 1112 } |
1113 | 1113 |
1114 | 1114 |
1115 EMIT_NATIVE_CODE(CatchBlockEntry, 0) { | 1115 EMIT_NATIVE_CODE(CatchBlockEntry, 0) { |
1116 __ Bind(compiler->GetJumpLabel(this)); | 1116 __ Bind(compiler->GetJumpLabel(this)); |
1117 compiler->AddExceptionHandler(catch_try_index(), | 1117 compiler->AddExceptionHandler(catch_try_index(), |
1118 try_index(), | 1118 try_index(), |
1119 compiler->assembler()->CodeSize(), | 1119 compiler->assembler()->CodeSize(), |
1120 catch_handler_types_, | 1120 catch_handler_types_, |
1121 needs_stacktrace()); | 1121 needs_stacktrace()); |
1122 __ MoveSpecial(-exception_var().index()-1, | 1122 |
1123 if (HasParallelMove()) { | |
1124 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | |
1125 } | |
1126 | |
1127 __ MoveSpecial(LocalVarIndex(0, exception_var().index()), | |
1123 Simulator::kExceptionSpecialIndex); | 1128 Simulator::kExceptionSpecialIndex); |
1124 __ MoveSpecial(-stacktrace_var().index()-1, | 1129 __ MoveSpecial(LocalVarIndex(0, stacktrace_var().index()), |
1125 Simulator::kStacktraceSpecialIndex); | 1130 Simulator::kStacktraceSpecialIndex); |
1126 __ SetFrame(compiler->StackSize()); | 1131 __ SetFrame(compiler->StackSize()); |
1127 } | 1132 } |
1128 | 1133 |
1129 | 1134 |
1130 EMIT_NATIVE_CODE(Throw, 0, Location::NoLocation(), LocationSummary::kCall) { | 1135 EMIT_NATIVE_CODE(Throw, 0, Location::NoLocation(), LocationSummary::kCall) { |
1131 __ Throw(0); | 1136 __ Throw(0); |
1132 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, | 1137 compiler->AddCurrentDescriptor(RawPcDescriptors::kOther, |
1133 deopt_id(), | 1138 deopt_id(), |
1134 token_pos()); | 1139 token_pos()); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1393 if (DeoptIfNull()) { | 1398 if (DeoptIfNull()) { |
1394 __ IfEqNull(value); | 1399 __ IfEqNull(value); |
1395 } else { | 1400 } else { |
1396 __ IfNeNull(value); | 1401 __ IfNeNull(value); |
1397 } | 1402 } |
1398 } else { | 1403 } else { |
1399 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || | 1404 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || |
1400 (unary_checks().NumberOfChecks() > 1)); | 1405 (unary_checks().NumberOfChecks() > 1)); |
1401 const intptr_t may_be_smi = | 1406 const intptr_t may_be_smi = |
1402 (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0; | 1407 (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) ? 1 : 0; |
1408 bool is_dense_switch = false; | |
1409 intptr_t cid_mask = 0; | |
1403 if (IsDenseSwitch()) { | 1410 if (IsDenseSwitch()) { |
1404 ASSERT(cids_[0] < cids_[cids_.length() - 1]); | 1411 ASSERT(cids_[0] < cids_[cids_.length() - 1]); |
1412 cid_mask = ComputeCidMask(); | |
1413 is_dense_switch = Smi::IsValid(cid_mask); | |
Florian Schneider
2016/10/04 17:07:57
I'll fix this in a follow-up CL by adding support
| |
1414 } | |
1415 if (is_dense_switch) { | |
1405 const intptr_t low_cid = cids_[0]; | 1416 const intptr_t low_cid = cids_[0]; |
1406 const intptr_t cid_mask = ComputeCidMask(); | |
1407 __ CheckDenseSwitch(value, may_be_smi); | 1417 __ CheckDenseSwitch(value, may_be_smi); |
1408 __ Nop(compiler->ToEmbeddableCid(low_cid, this)); | 1418 __ Nop(compiler->ToEmbeddableCid(low_cid, this)); |
1409 __ Nop(__ AddConstant(Smi::Handle(Smi::New(cid_mask)))); | 1419 __ Nop(__ AddConstant(Smi::Handle(Smi::New(cid_mask)))); |
1410 } else { | 1420 } else { |
1411 GrowableArray<CidTarget> sorted_ic_data; | 1421 GrowableArray<CidTarget> sorted_ic_data; |
1412 FlowGraphCompiler::SortICDataByCount(unary_checks(), | 1422 FlowGraphCompiler::SortICDataByCount(unary_checks(), |
1413 &sorted_ic_data, | 1423 &sorted_ic_data, |
1414 /* drop_smi = */ true); | 1424 /* drop_smi = */ true); |
1415 const intptr_t sorted_length = sorted_ic_data.length(); | 1425 const intptr_t sorted_length = sorted_ic_data.length(); |
1416 if (!Utils::IsUint(8, sorted_length)) { | 1426 if (!Utils::IsUint(8, sorted_length)) { |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1883 __ IfULe(length, index); | 1893 __ IfULe(length, index); |
1884 compiler->EmitDeopt(deopt_id(), | 1894 compiler->EmitDeopt(deopt_id(), |
1885 ICData::kDeoptCheckArrayBound, | 1895 ICData::kDeoptCheckArrayBound, |
1886 (generalized_ ? ICData::kGeneralized : 0) | | 1896 (generalized_ ? ICData::kGeneralized : 0) | |
1887 (licm_hoisted_ ? ICData::kHoisted : 0)); | 1897 (licm_hoisted_ ? ICData::kHoisted : 0)); |
1888 } | 1898 } |
1889 | 1899 |
1890 } // namespace dart | 1900 } // namespace dart |
1891 | 1901 |
1892 #endif // defined TARGET_ARCH_DBC | 1902 #endif // defined TARGET_ARCH_DBC |
OLD | NEW |