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

Side by Side Diff: runtime/vm/intermediate_language_arm.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 | « no previous file | 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) 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 5469 matching lines...) Expand 10 before | Expand all | Expand 10 after
5480 5480
5481 5481
5482 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5482 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5483 Label* deopt = compiler->AddDeoptStub(deopt_id(), 5483 Label* deopt = compiler->AddDeoptStub(deopt_id(),
5484 ICData::kDeoptCheckArrayBound); 5484 ICData::kDeoptCheckArrayBound);
5485 5485
5486 Location length_loc = locs()->in(kLengthPos); 5486 Location length_loc = locs()->in(kLengthPos);
5487 Location index_loc = locs()->in(kIndexPos); 5487 Location index_loc = locs()->in(kIndexPos);
5488 5488
5489 if (length_loc.IsConstant() && index_loc.IsConstant()) { 5489 if (length_loc.IsConstant() && index_loc.IsConstant()) {
5490 // TODO(srdjan): remove this code once failures are fixed.
5491 if ((Smi::Cast(length_loc.constant()).Value() >
5492 Smi::Cast(index_loc.constant()).Value()) &&
5493 (Smi::Cast(index_loc.constant()).Value() >= 0)) {
5494 // This CheckArrayBoundInstr should have been eliminated.
5495 return;
5496 }
5497 ASSERT((Smi::Cast(length_loc.constant()).Value() <= 5490 ASSERT((Smi::Cast(length_loc.constant()).Value() <=
5498 Smi::Cast(index_loc.constant()).Value()) || 5491 Smi::Cast(index_loc.constant()).Value()) ||
5499 (Smi::Cast(index_loc.constant()).Value() < 0)); 5492 (Smi::Cast(index_loc.constant()).Value() < 0));
5500 // Unconditionally deoptimize for constant bounds checks because they 5493 // Unconditionally deoptimize for constant bounds checks because they
5501 // only occur only when index is out-of-bounds. 5494 // only occur only when index is out-of-bounds.
5502 __ b(deopt); 5495 __ b(deopt);
5503 return; 5496 return;
5504 } 5497 }
5505 5498
5506 if (index_loc.IsConstant()) { 5499 if (index_loc.IsConstant()) {
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
6088 compiler->GenerateCall(token_pos(), 6081 compiler->GenerateCall(token_pos(),
6089 &label, 6082 &label,
6090 PcDescriptors::kOther, 6083 PcDescriptors::kOther,
6091 locs()); 6084 locs());
6092 __ Drop(ArgumentCount()); // Discard arguments. 6085 __ Drop(ArgumentCount()); // Discard arguments.
6093 } 6086 }
6094 6087
6095 } // namespace dart 6088 } // namespace dart
6096 6089
6097 #endif // defined TARGET_ARCH_ARM 6090 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698