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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_arm64.cc ('k') | runtime/vm/intermediate_language_mips.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 5572 matching lines...) Expand 10 before | Expand all | Expand 10 after
5583 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 5583 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
5584 } else { 5584 } else {
5585 locs->set_in(kLengthPos, Location::PrefersRegister()); 5585 locs->set_in(kLengthPos, Location::PrefersRegister());
5586 } 5586 }
5587 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 5587 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
5588 return locs; 5588 return locs;
5589 } 5589 }
5590 5590
5591 5591
5592 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5592 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5593 uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
5594 flags |= licm_hoisted_ ? ICData::kHoisted : 0;
5593 Label* deopt = compiler->AddDeoptStub( 5595 Label* deopt = compiler->AddDeoptStub(
5594 deopt_id(), 5596 deopt_id(),
5595 ICData::kDeoptCheckArrayBound, 5597 ICData::kDeoptCheckArrayBound,
5596 generalized_ ? ICData::kGeneralized : 0); 5598 flags);
5597 5599
5598 Location length_loc = locs()->in(kLengthPos); 5600 Location length_loc = locs()->in(kLengthPos);
5599 Location index_loc = locs()->in(kIndexPos); 5601 Location index_loc = locs()->in(kIndexPos);
5600 5602
5601 if (length_loc.IsConstant() && index_loc.IsConstant()) { 5603 if (length_loc.IsConstant() && index_loc.IsConstant()) {
5602 ASSERT((Smi::Cast(length_loc.constant()).Value() <= 5604 ASSERT((Smi::Cast(length_loc.constant()).Value() <=
5603 Smi::Cast(index_loc.constant()).Value()) || 5605 Smi::Cast(index_loc.constant()).Value()) ||
5604 (Smi::Cast(index_loc.constant()).Value() < 0)); 5606 (Smi::Cast(index_loc.constant()).Value() < 0));
5605 // Unconditionally deoptimize for constant bounds checks because they 5607 // Unconditionally deoptimize for constant bounds checks because they
5606 // only occur only when index is out-of-bounds. 5608 // only occur only when index is out-of-bounds.
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
6784 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6786 __ movl(EDX, Immediate(kInvalidObjectPointer));
6785 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6787 __ movl(EDX, Immediate(kInvalidObjectPointer));
6786 #endif 6788 #endif
6787 } 6789 }
6788 6790
6789 } // namespace dart 6791 } // namespace dart
6790 6792
6791 #undef __ 6793 #undef __
6792 6794
6793 #endif // defined TARGET_ARCH_IA32 6795 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698