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

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

Issue 2152683003: Revert "VM: Array bounds checks that don't deoptimize for precompiled code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 M(ShiftUint32Op) \ 94 M(ShiftUint32Op) \
95 M(UnaryUint32Op) \ 95 M(UnaryUint32Op) \
96 M(UnboxedIntConverter) \ 96 M(UnboxedIntConverter) \
97 M(BoxInteger32) \ 97 M(BoxInteger32) \
98 M(UnboxInteger32) \ 98 M(UnboxInteger32) \
99 M(CheckedSmiOp) \ 99 M(CheckedSmiOp) \
100 100
101 // List of instructions that are not used by DBC. 101 // List of instructions that are not used by DBC.
102 #define FOR_EACH_UNREACHABLE_INSTRUCTION(M) \ 102 #define FOR_EACH_UNREACHABLE_INSTRUCTION(M) \
103 M(CaseInsensitiveCompareUC16) \ 103 M(CaseInsensitiveCompareUC16) \
104 M(GenericCheckBound) \
105 M(GrowRegExpStack) \ 104 M(GrowRegExpStack) \
106 M(IndirectGoto) 105 M(IndirectGoto)
107 106
108 // Location summaries actually are not used by the unoptimizing DBC compiler 107 // Location summaries actually are not used by the unoptimizing DBC compiler
109 // because we don't allocate any registers. 108 // because we don't allocate any registers.
110 static LocationSummary* CreateLocationSummary( 109 static LocationSummary* CreateLocationSummary(
111 Zone* zone, 110 Zone* zone,
112 intptr_t num_inputs, 111 intptr_t num_inputs,
113 Location output = Location::NoLocation(), 112 Location output = Location::NoLocation(),
114 LocationSummary::ContainsCall contains_call = LocationSummary::kNoCall) { 113 LocationSummary::ContainsCall contains_call = LocationSummary::kNoCall) {
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 BranchInstr* branch) { 1343 BranchInstr* branch) {
1345 BranchLabels labels = compiler->CreateBranchLabels(branch); 1344 BranchLabels labels = compiler->CreateBranchLabels(branch);
1346 Condition true_condition = EmitComparisonCode(compiler, labels); 1345 Condition true_condition = EmitComparisonCode(compiler, labels);
1347 EmitBranchOnCondition(compiler, true_condition, labels); 1346 EmitBranchOnCondition(compiler, true_condition, labels);
1348 } 1347 }
1349 1348
1350 1349
1351 EMIT_NATIVE_CODE(CheckArrayBound, 2) { 1350 EMIT_NATIVE_CODE(CheckArrayBound, 2) {
1352 const Register length = locs()->in(kLengthPos).reg(); 1351 const Register length = locs()->in(kLengthPos).reg();
1353 const Register index = locs()->in(kIndexPos).reg(); 1352 const Register index = locs()->in(kIndexPos).reg();
1354 const intptr_t index_cid = this->index()->Type()->ToCid();
1355 if (index_cid != kSmiCid) {
1356 __ CheckSmi(index);
1357 compiler->EmitDeopt(deopt_id(),
1358 ICData::kDeoptCheckArrayBound,
1359 (generalized_ ? ICData::kGeneralized : 0) |
1360 (licm_hoisted_ ? ICData::kHoisted : 0));
1361 }
1362 __ IfULe(length, index); 1353 __ IfULe(length, index);
1363 compiler->EmitDeopt(deopt_id(), 1354 compiler->EmitDeopt(deopt_id(),
1364 ICData::kDeoptCheckArrayBound, 1355 ICData::kDeoptCheckArrayBound,
1365 (generalized_ ? ICData::kGeneralized : 0) | 1356 (generalized_ ? ICData::kGeneralized : 0) |
1366 (licm_hoisted_ ? ICData::kHoisted : 0)); 1357 (licm_hoisted_ ? ICData::kHoisted : 0));
1367 } 1358 }
1368 1359
1369 } // namespace dart 1360 } // namespace dart
1370 1361
1371 #endif // defined TARGET_ARCH_DBC 1362 #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