| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 48 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
| 49 // where PushArgument is handled by BindInstr::EmitNativeCode. | 49 // where PushArgument is handled by BindInstr::EmitNativeCode. |
| 50 if (compiler->is_optimizing()) { | 50 if (compiler->is_optimizing()) { |
| 51 Location value = locs()->in(0); | 51 Location value = locs()->in(0); |
| 52 if (value.IsRegister()) { | 52 if (value.IsRegister()) { |
| 53 __ pushl(value.reg()); | 53 __ pushl(value.reg()); |
| 54 } else if (value.IsConstant()) { | 54 } else if (value.IsConstant()) { |
| 55 __ PushObject(value.constant()); | 55 __ PushObject(value.constant()); |
| 56 } else { | 56 } else { |
| 57 ASSERT(value.IsStackSlot()); | 57 ASSERT(value.IsStackSlot()); |
| 58 __ pushl(value.ToStackSlotAddress()); | 58 __ pushl(Address::StackSlotAddress(value)); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 LocationSummary* ReturnInstr::MakeLocationSummary() const { | 64 LocationSummary* ReturnInstr::MakeLocationSummary() const { |
| 65 const intptr_t kNumInputs = 1; | 65 const intptr_t kNumInputs = 1; |
| 66 const intptr_t kNumTemps = 0; | 66 const intptr_t kNumTemps = 0; |
| 67 LocationSummary* locs = | 67 LocationSummary* locs = |
| 68 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 68 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 ASSERT(!left.IsConstant() || !right.IsConstant()); | 621 ASSERT(!left.IsConstant() || !right.IsConstant()); |
| 622 | 622 |
| 623 Condition true_condition = TokenKindToSmiCondition(kind); | 623 Condition true_condition = TokenKindToSmiCondition(kind); |
| 624 | 624 |
| 625 if (left.IsConstant()) { | 625 if (left.IsConstant()) { |
| 626 __ CompareObject(right.reg(), left.constant()); | 626 __ CompareObject(right.reg(), left.constant()); |
| 627 true_condition = FlipCondition(true_condition); | 627 true_condition = FlipCondition(true_condition); |
| 628 } else if (right.IsConstant()) { | 628 } else if (right.IsConstant()) { |
| 629 __ CompareObject(left.reg(), right.constant()); | 629 __ CompareObject(left.reg(), right.constant()); |
| 630 } else if (right.IsStackSlot()) { | 630 } else if (right.IsStackSlot()) { |
| 631 __ cmpl(left.reg(), right.ToStackSlotAddress()); | 631 __ cmpl(left.reg(), Address::StackSlotAddress(right)); |
| 632 } else { | 632 } else { |
| 633 __ cmpl(left.reg(), right.reg()); | 633 __ cmpl(left.reg(), right.reg()); |
| 634 } | 634 } |
| 635 | 635 |
| 636 if (branch != NULL) { | 636 if (branch != NULL) { |
| 637 branch->EmitBranchOnCondition(compiler, true_condition); | 637 branch->EmitBranchOnCondition(compiler, true_condition); |
| 638 } else { | 638 } else { |
| 639 Register result = locs.out().reg(); | 639 Register result = locs.out().reg(); |
| 640 Label done, is_true; | 640 Label done, is_true; |
| 641 __ j(true_condition, &is_true); | 641 __ j(true_condition, &is_true); |
| (...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2454 } | 2454 } |
| 2455 | 2455 |
| 2456 default: | 2456 default: |
| 2457 UNREACHABLE(); | 2457 UNREACHABLE(); |
| 2458 break; | 2458 break; |
| 2459 } | 2459 } |
| 2460 return; | 2460 return; |
| 2461 } // if locs()->in(1).IsConstant() | 2461 } // if locs()->in(1).IsConstant() |
| 2462 | 2462 |
| 2463 if (locs()->in(1).IsStackSlot()) { | 2463 if (locs()->in(1).IsStackSlot()) { |
| 2464 const Address& right = locs()->in(1).ToStackSlotAddress(); | 2464 const Address& right = Address::StackSlotAddress(locs()->in(1)); |
| 2465 switch (op_kind()) { | 2465 switch (op_kind()) { |
| 2466 case Token::kADD: { | 2466 case Token::kADD: { |
| 2467 __ addl(left, right); | 2467 __ addl(left, right); |
| 2468 if (deopt != NULL) __ j(OVERFLOW, deopt); | 2468 if (deopt != NULL) __ j(OVERFLOW, deopt); |
| 2469 break; | 2469 break; |
| 2470 } | 2470 } |
| 2471 case Token::kSUB: { | 2471 case Token::kSUB: { |
| 2472 __ subl(left, right); | 2472 __ subl(left, right); |
| 2473 if (deopt != NULL) __ j(OVERFLOW, deopt); | 2473 if (deopt != NULL) __ j(OVERFLOW, deopt); |
| 2474 break; | 2474 break; |
| (...skipping 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4778 PcDescriptors::kOther, | 4778 PcDescriptors::kOther, |
| 4779 locs()); | 4779 locs()); |
| 4780 __ Drop(2); // Discard type arguments and receiver. | 4780 __ Drop(2); // Discard type arguments and receiver. |
| 4781 } | 4781 } |
| 4782 | 4782 |
| 4783 } // namespace dart | 4783 } // namespace dart |
| 4784 | 4784 |
| 4785 #undef __ | 4785 #undef __ |
| 4786 | 4786 |
| 4787 #endif // defined TARGET_ARCH_IA32 | 4787 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |