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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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/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 6590 matching lines...) Expand 10 before | Expand all | Expand 10 after
6601 locs->set_out(0, Location::RequiresRegister()); 6601 locs->set_out(0, Location::RequiresRegister());
6602 return locs; 6602 return locs;
6603 } 6603 }
6604 6604
6605 6605
6606 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 6606 Condition StrictCompareInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
6607 BranchLabels labels) { 6607 BranchLabels labels) {
6608 Location left = locs()->in(0); 6608 Location left = locs()->in(0);
6609 Location right = locs()->in(1); 6609 Location right = locs()->in(1);
6610 ASSERT(!left.IsConstant() || !right.IsConstant()); 6610 ASSERT(!left.IsConstant() || !right.IsConstant());
6611 Condition true_condition;
6611 if (left.IsConstant()) { 6612 if (left.IsConstant()) {
6612 compiler->EmitEqualityRegConstCompare(right.reg(), 6613 true_condition = compiler->EmitEqualityRegConstCompare(right.reg(),
6613 left.constant(), 6614 left.constant(),
6614 needs_number_check(), 6615 needs_number_check(),
6615 token_pos()); 6616 token_pos());
6616 } else if (right.IsConstant()) { 6617 } else if (right.IsConstant()) {
6617 compiler->EmitEqualityRegConstCompare(left.reg(), 6618 true_condition = compiler->EmitEqualityRegConstCompare(left.reg(),
6618 right.constant(), 6619 right.constant(),
6619 needs_number_check(), 6620 needs_number_check(),
6620 token_pos()); 6621 token_pos());
6621 } else { 6622 } else {
6622 compiler->EmitEqualityRegRegCompare(left.reg(), 6623 true_condition = compiler->EmitEqualityRegRegCompare(left.reg(),
6623 right.reg(), 6624 right.reg(),
6624 needs_number_check(), 6625 needs_number_check(),
6625 token_pos()); 6626 token_pos());
6626 } 6627 }
6627 Condition true_condition = (kind() == Token::kEQ_STRICT) ? EQUAL : NOT_EQUAL; 6628 if (kind() != Token::kEQ_STRICT) {
6629 ASSERT(kind() == Token::kNE_STRICT);
6630 true_condition = NegateCondition(true_condition);
6631 }
6628 return true_condition; 6632 return true_condition;
6629 } 6633 }
6630 6634
6631 6635
6632 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6636 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6633 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); 6637 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
6634 6638
6635 Label is_true, is_false; 6639 Label is_true, is_false;
6636 BranchLabels labels = { &is_true, &is_false, &is_false }; 6640 BranchLabels labels = { &is_true, &is_false, &is_false };
6637 Condition true_condition = EmitComparisonCode(compiler, labels); 6641 Condition true_condition = EmitComparisonCode(compiler, labels);
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
6824 #if defined(DEBUG) 6828 #if defined(DEBUG)
6825 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6829 __ movl(EDX, Immediate(kInvalidObjectPointer));
6826 #endif 6830 #endif
6827 } 6831 }
6828 6832
6829 } // namespace dart 6833 } // namespace dart
6830 6834
6831 #undef __ 6835 #undef __
6832 6836
6833 #endif // defined TARGET_ARCH_IA32 6837 #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