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

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

Issue 263083010: Remove unreachable code from the code generator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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_mips.cc ('k') | no next file » | 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 5242 matching lines...) Expand 10 before | Expand all | Expand 10 after
5253 5253
5254 5254
5255 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5255 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5256 Label* deopt = compiler->AddDeoptStub(deopt_id(), 5256 Label* deopt = compiler->AddDeoptStub(deopt_id(),
5257 ICData::kDeoptCheckArrayBound); 5257 ICData::kDeoptCheckArrayBound);
5258 5258
5259 Location length_loc = locs()->in(kLengthPos); 5259 Location length_loc = locs()->in(kLengthPos);
5260 Location index_loc = locs()->in(kIndexPos); 5260 Location index_loc = locs()->in(kIndexPos);
5261 5261
5262 if (length_loc.IsConstant() && index_loc.IsConstant()) { 5262 if (length_loc.IsConstant() && index_loc.IsConstant()) {
5263 // TODO(srdjan): remove this code once failures are fixed.
5264 if ((Smi::Cast(length_loc.constant()).Value() >
5265 Smi::Cast(index_loc.constant()).Value()) &&
5266 (Smi::Cast(index_loc.constant()).Value() >= 0)) {
5267 // This CheckArrayBoundInstr should have been eliminated.
5268 return;
5269 }
5270 ASSERT((Smi::Cast(length_loc.constant()).Value() <= 5263 ASSERT((Smi::Cast(length_loc.constant()).Value() <=
5271 Smi::Cast(index_loc.constant()).Value()) || 5264 Smi::Cast(index_loc.constant()).Value()) ||
5272 (Smi::Cast(index_loc.constant()).Value() < 0)); 5265 (Smi::Cast(index_loc.constant()).Value() < 0));
5273 // Unconditionally deoptimize for constant bounds checks because they 5266 // Unconditionally deoptimize for constant bounds checks because they
5274 // only occur only when index is out-of-bounds. 5267 // only occur only when index is out-of-bounds.
5275 __ jmp(deopt); 5268 __ jmp(deopt);
5276 return; 5269 return;
5277 } 5270 }
5278 5271
5279 if (index_loc.IsConstant()) { 5272 if (index_loc.IsConstant()) {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
5612 PcDescriptors::kOther, 5605 PcDescriptors::kOther,
5613 locs()); 5606 locs());
5614 __ Drop(ArgumentCount()); // Discard arguments. 5607 __ Drop(ArgumentCount()); // Discard arguments.
5615 } 5608 }
5616 5609
5617 } // namespace dart 5610 } // namespace dart
5618 5611
5619 #undef __ 5612 #undef __
5620 5613
5621 #endif // defined TARGET_ARCH_X64 5614 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698