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

Side by Side Diff: runtime/vm/intermediate_language_dbc.cc

Issue 2149023002: VM: Array bounds checks that don't deoptimize for precompiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 4 years, 5 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/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('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" // 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 M(UnboxInteger32) \ 58 M(UnboxInteger32) \
59 59
60 // List of instructions that are not used by DBC. 60 // List of instructions that are not used by DBC.
61 // Things we aren't planning to implement for DBC: 61 // Things we aren't planning to implement for DBC:
62 // - Unboxed SIMD, 62 // - Unboxed SIMD,
63 // - Unboxed Mint, 63 // - Unboxed Mint,
64 // - Optimized RegExps, 64 // - Optimized RegExps,
65 // - Precompilation. 65 // - Precompilation.
66 #define FOR_EACH_UNREACHABLE_INSTRUCTION(M) \ 66 #define FOR_EACH_UNREACHABLE_INSTRUCTION(M) \
67 M(CaseInsensitiveCompareUC16) \ 67 M(CaseInsensitiveCompareUC16) \
68 M(GenericCheckBound) \
68 M(GrowRegExpStack) \ 69 M(GrowRegExpStack) \
69 M(IndirectGoto) \ 70 M(IndirectGoto) \
70 M(MintToDouble) \ 71 M(MintToDouble) \
71 M(BinaryMintOp) \ 72 M(BinaryMintOp) \
72 M(ShiftMintOp) \ 73 M(ShiftMintOp) \
73 M(UnaryMintOp) \ 74 M(UnaryMintOp) \
74 M(BinaryFloat32x4Op) \ 75 M(BinaryFloat32x4Op) \
75 M(Simd32x4Shuffle) \ 76 M(Simd32x4Shuffle) \
76 M(Simd32x4ShuffleMix) \ 77 M(Simd32x4ShuffleMix) \
77 M(Simd32x4GetSignMask) \ 78 M(Simd32x4GetSignMask) \
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 BranchInstr* branch) { 1429 BranchInstr* branch) {
1429 BranchLabels labels = compiler->CreateBranchLabels(branch); 1430 BranchLabels labels = compiler->CreateBranchLabels(branch);
1430 Condition true_condition = EmitComparisonCode(compiler, labels); 1431 Condition true_condition = EmitComparisonCode(compiler, labels);
1431 EmitBranchOnCondition(compiler, true_condition, labels); 1432 EmitBranchOnCondition(compiler, true_condition, labels);
1432 } 1433 }
1433 1434
1434 1435
1435 EMIT_NATIVE_CODE(CheckArrayBound, 2) { 1436 EMIT_NATIVE_CODE(CheckArrayBound, 2) {
1436 const Register length = locs()->in(kLengthPos).reg(); 1437 const Register length = locs()->in(kLengthPos).reg();
1437 const Register index = locs()->in(kIndexPos).reg(); 1438 const Register index = locs()->in(kIndexPos).reg();
1439 const intptr_t index_cid = this->index()->Type()->ToCid();
1440 if (index_cid != kSmiCid) {
1441 __ CheckSmi(index);
1442 compiler->EmitDeopt(deopt_id(),
1443 ICData::kDeoptCheckArrayBound,
1444 (generalized_ ? ICData::kGeneralized : 0) |
1445 (licm_hoisted_ ? ICData::kHoisted : 0));
1446 }
1438 __ IfULe(length, index); 1447 __ IfULe(length, index);
1439 compiler->EmitDeopt(deopt_id(), 1448 compiler->EmitDeopt(deopt_id(),
1440 ICData::kDeoptCheckArrayBound, 1449 ICData::kDeoptCheckArrayBound,
1441 (generalized_ ? ICData::kGeneralized : 0) | 1450 (generalized_ ? ICData::kGeneralized : 0) |
1442 (licm_hoisted_ ? ICData::kHoisted : 0)); 1451 (licm_hoisted_ ? ICData::kHoisted : 0));
1443 } 1452 }
1444 1453
1445 } // namespace dart 1454 } // namespace dart
1446 1455
1447 #endif // defined TARGET_ARCH_DBC 1456 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698