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

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

Issue 662543003: VM: Avoid repeated deoptimizations from hoisted array bounds checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm64.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 5913 matching lines...) Expand 10 before | Expand all | Expand 10 after
5924 const intptr_t kNumTemps = 0; 5924 const intptr_t kNumTemps = 0;
5925 LocationSummary* locs = new(isolate) LocationSummary( 5925 LocationSummary* locs = new(isolate) LocationSummary(
5926 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5926 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5927 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 5927 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
5928 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 5928 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
5929 return locs; 5929 return locs;
5930 } 5930 }
5931 5931
5932 5932
5933 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5933 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5934 uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
5935 flags |= licm_hoisted_ ? ICData::kHoisted : 0;
5934 Label* deopt = compiler->AddDeoptStub( 5936 Label* deopt = compiler->AddDeoptStub(
5935 deopt_id(), 5937 deopt_id(),
5936 ICData::kDeoptCheckArrayBound, 5938 ICData::kDeoptCheckArrayBound,
5937 generalized_ ? ICData::kGeneralized : 0); 5939 flags);
5938 5940
5939 Location length_loc = locs()->in(kLengthPos); 5941 Location length_loc = locs()->in(kLengthPos);
5940 Location index_loc = locs()->in(kIndexPos); 5942 Location index_loc = locs()->in(kIndexPos);
5941 5943
5942 if (length_loc.IsConstant() && index_loc.IsConstant()) { 5944 if (length_loc.IsConstant() && index_loc.IsConstant()) {
5943 ASSERT((Smi::Cast(length_loc.constant()).Value() <= 5945 ASSERT((Smi::Cast(length_loc.constant()).Value() <=
5944 Smi::Cast(index_loc.constant()).Value()) || 5946 Smi::Cast(index_loc.constant()).Value()) ||
5945 (Smi::Cast(index_loc.constant()).Value() < 0)); 5947 (Smi::Cast(index_loc.constant()).Value() < 0));
5946 // Unconditionally deoptimize for constant bounds checks because they 5948 // Unconditionally deoptimize for constant bounds checks because they
5947 // only occur only when index is out-of-bounds. 5949 // only occur only when index is out-of-bounds.
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
7008 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 7010 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
7009 #if defined(DEBUG) 7011 #if defined(DEBUG)
7010 __ LoadImmediate(R4, kInvalidObjectPointer); 7012 __ LoadImmediate(R4, kInvalidObjectPointer);
7011 __ LoadImmediate(R5, kInvalidObjectPointer); 7013 __ LoadImmediate(R5, kInvalidObjectPointer);
7012 #endif 7014 #endif
7013 } 7015 }
7014 7016
7015 } // namespace dart 7017 } // namespace dart
7016 7018
7017 #endif // defined TARGET_ARCH_ARM 7019 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698