| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |