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

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

Issue 798643003: Pass condition result explicitly. Do not imply the existence of a status (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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/flow_graph_compiler_x64.cc ('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 6813 matching lines...) Expand 10 before | Expand all | Expand 10 after
6824 locs->set_out(0, Location::RequiresRegister()); 6824 locs->set_out(0, Location::RequiresRegister());
6825 return locs; 6825 return locs;
6826 } 6826 }
6827 6827
6828 6828
6829 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 6829 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
6830 BranchLabels labels) { 6830 BranchLabels labels) {
6831 Location left = locs()->in(0); 6831 Location left = locs()->in(0);
6832 Location right = locs()->in(1); 6832 Location right = locs()->in(1);
6833 ASSERT(!left.IsConstant() || !right.IsConstant()); 6833 ASSERT(!left.IsConstant() || !right.IsConstant());
6834 Condition true_condition;
6834 if (left.IsConstant()) { 6835 if (left.IsConstant()) {
6835 compiler->EmitEqualityRegConstCompare(right.reg(), 6836 true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
6836 left.constant(), 6837 left.constant(),
6837 needs_number_check(), 6838 needs_number_check(),
6838 token_pos()); 6839 token_pos());
6839 } else if (right.IsConstant()) { 6840 } else if (right.IsConstant()) {
6840 compiler->EmitEqualityRegConstCompare(left.reg(), 6841 true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
6841 right.constant(), 6842 right.constant(),
6842 needs_number_check(), 6843 needs_number_check(),
6843 token_pos()); 6844 token_pos());
6844 } else { 6845 } else {
6845 compiler->EmitEqualityRegRegCompare(left.reg(), 6846 true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
6846 right.reg(), 6847 right.reg(),
6847 needs_number_check(), 6848 needs_number_check(),
6848 token_pos()); 6849 token_pos());
6849 } 6850 }
6850 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQ : NE; 6851 if (kind() != Token::kEQ_STRICT) {
6852 ASSERT(kind() == Token::kNE_STRICT);
6853 true_condition = NegateCondition(true_condition);
6854 }
6851 return true_condition; 6855 return true_condition;
6852 } 6856 }
6853 6857
6854 6858
6855 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6859 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6856 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); 6860 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
6857 6861
6858 // The ARM code does not use true- and false-labels here. 6862 // The ARM code does not use true- and false-labels here.
6859 BranchLabels labels = { NULL, NULL, NULL }; 6863 BranchLabels labels = { NULL, NULL, NULL };
6860 Condition true_condition = EmitComparisonCode(compiler, labels); 6864 Condition true_condition = EmitComparisonCode(compiler, labels);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
6922 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 6926 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
6923 #if defined(DEBUG) 6927 #if defined(DEBUG)
6924 __ LoadImmediate(R4, kInvalidObjectPointer); 6928 __ LoadImmediate(R4, kInvalidObjectPointer);
6925 __ LoadImmediate(R5, kInvalidObjectPointer); 6929 __ LoadImmediate(R5, kInvalidObjectPointer);
6926 #endif 6930 #endif
6927 } 6931 }
6928 6932
6929 } // namespace dart 6933 } // namespace dart
6930 6934
6931 #endif // defined TARGET_ARCH_ARM 6935 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698