| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 case Token::kGT: return GT; | 489 case Token::kGT: return GT; |
| 490 case Token::kLTE: return LE; | 490 case Token::kLTE: return LE; |
| 491 case Token::kGTE: return GE; | 491 case Token::kGTE: return GE; |
| 492 default: | 492 default: |
| 493 UNREACHABLE(); | 493 UNREACHABLE(); |
| 494 return VS; | 494 return VS; |
| 495 } | 495 } |
| 496 } | 496 } |
| 497 | 497 |
| 498 | 498 |
| 499 static Condition FlipCondition(Condition condition) { |
| 500 UNIMPLEMENTED(); |
| 501 return condition; |
| 502 } |
| 503 |
| 504 |
| 499 static void EmitSmiComparisonOp(FlowGraphCompiler* compiler, | 505 static void EmitSmiComparisonOp(FlowGraphCompiler* compiler, |
| 500 const LocationSummary& locs, | 506 const LocationSummary& locs, |
| 501 Token::Kind kind, | 507 Token::Kind kind, |
| 502 BranchInstr* branch) { | 508 BranchInstr* branch) { |
| 503 __ TraceSimMsg("EmitSmiComparisonOp"); | 509 __ TraceSimMsg("EmitSmiComparisonOp"); |
| 504 Location left = locs.in(0); | 510 Location left = locs.in(0); |
| 505 Location right = locs.in(1); | 511 Location right = locs.in(1); |
| 506 ASSERT(!left.IsConstant() || !right.IsConstant()); | 512 ASSERT(!left.IsConstant() || !right.IsConstant()); |
| 507 | 513 |
| 508 Condition true_condition = TokenKindToSmiCondition(kind); | 514 Condition true_condition = TokenKindToSmiCondition(kind); |
| 509 | 515 |
| 510 if (left.IsConstant()) { | 516 if (left.IsConstant()) { |
| 511 __ CompareObject(CMPRES, right.reg(), left.constant()); | 517 __ CompareObject(CMPRES, right.reg(), left.constant()); |
| 512 true_condition = FlowGraphCompiler::FlipCondition(true_condition); | 518 true_condition = FlipCondition(true_condition); |
| 513 } else if (right.IsConstant()) { | 519 } else if (right.IsConstant()) { |
| 514 __ CompareObject(CMPRES, left.reg(), right.constant()); | 520 __ CompareObject(CMPRES, left.reg(), right.constant()); |
| 515 } else { | 521 } else { |
| 516 __ subu(CMPRES, left.reg(), right.reg()); | 522 __ subu(CMPRES, left.reg(), right.reg()); |
| 517 } | 523 } |
| 518 | 524 |
| 519 if (branch != NULL) { | 525 if (branch != NULL) { |
| 520 branch->EmitBranchOnCondition(compiler, true_condition); | 526 branch->EmitBranchOnCondition(compiler, true_condition); |
| 521 } else { | 527 } else { |
| 522 Register result = locs.out().reg(); | 528 Register result = locs.out().reg(); |
| (...skipping 2376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2899 compiler->GenerateCall(token_pos(), | 2905 compiler->GenerateCall(token_pos(), |
| 2900 &label, | 2906 &label, |
| 2901 PcDescriptors::kOther, | 2907 PcDescriptors::kOther, |
| 2902 locs()); | 2908 locs()); |
| 2903 __ Drop(2); // Discard type arguments and receiver. | 2909 __ Drop(2); // Discard type arguments and receiver. |
| 2904 } | 2910 } |
| 2905 | 2911 |
| 2906 } // namespace dart | 2912 } // namespace dart |
| 2907 | 2913 |
| 2908 #endif // defined TARGET_ARCH_MIPS | 2914 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |