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

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

Issue 19464002: Replaces Location::ToStackSlotAddress() with Location::ToStackSlotOffset() (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months 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
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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode 49 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
50 // where PushArgument is handled by BindInstr::EmitNativeCode. 50 // where PushArgument is handled by BindInstr::EmitNativeCode.
51 if (compiler->is_optimizing()) { 51 if (compiler->is_optimizing()) {
52 Location value = locs()->in(0); 52 Location value = locs()->in(0);
53 if (value.IsRegister()) { 53 if (value.IsRegister()) {
54 __ pushq(value.reg()); 54 __ pushq(value.reg());
55 } else if (value.IsConstant()) { 55 } else if (value.IsConstant()) {
56 __ PushObject(value.constant()); 56 __ PushObject(value.constant());
57 } else { 57 } else {
58 ASSERT(value.IsStackSlot()); 58 ASSERT(value.IsStackSlot());
59 __ pushq(value.ToStackSlotAddress()); 59 __ pushq(Address::StackSlotAddress(value));
60 } 60 }
61 } 61 }
62 } 62 }
63 63
64 64
65 LocationSummary* ReturnInstr::MakeLocationSummary() const { 65 LocationSummary* ReturnInstr::MakeLocationSummary() const {
66 const intptr_t kNumInputs = 1; 66 const intptr_t kNumInputs = 1;
67 const intptr_t kNumTemps = 0; 67 const intptr_t kNumTemps = 0;
68 LocationSummary* locs = 68 LocationSummary* locs =
69 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 69 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 ASSERT(!left.IsConstant() || !right.IsConstant()); 778 ASSERT(!left.IsConstant() || !right.IsConstant());
779 779
780 Condition true_condition = TokenKindToSmiCondition(kind); 780 Condition true_condition = TokenKindToSmiCondition(kind);
781 781
782 if (left.IsConstant()) { 782 if (left.IsConstant()) {
783 __ CompareObject(right.reg(), left.constant()); 783 __ CompareObject(right.reg(), left.constant());
784 true_condition = FlipCondition(true_condition); 784 true_condition = FlipCondition(true_condition);
785 } else if (right.IsConstant()) { 785 } else if (right.IsConstant()) {
786 __ CompareObject(left.reg(), right.constant()); 786 __ CompareObject(left.reg(), right.constant());
787 } else if (right.IsStackSlot()) { 787 } else if (right.IsStackSlot()) {
788 __ cmpq(left.reg(), right.ToStackSlotAddress()); 788 __ cmpq(left.reg(), Address::StackSlotAddress(right));
789 } else { 789 } else {
790 __ cmpq(left.reg(), right.reg()); 790 __ cmpq(left.reg(), right.reg());
791 } 791 }
792 792
793 if (branch != NULL) { 793 if (branch != NULL) {
794 branch->EmitBranchOnCondition(compiler, true_condition); 794 branch->EmitBranchOnCondition(compiler, true_condition);
795 } else { 795 } else {
796 Register result = locs.out().reg(); 796 Register result = locs.out().reg();
797 Label done, is_true; 797 Label done, is_true;
798 __ j(true_condition, &is_true); 798 __ j(true_condition, &is_true);
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after
2485 default: 2485 default:
2486 UNREACHABLE(); 2486 UNREACHABLE();
2487 break; 2487 break;
2488 } 2488 }
2489 Emit53BitOverflowCheck(compiler, deopt, result); 2489 Emit53BitOverflowCheck(compiler, deopt, result);
2490 return; 2490 return;
2491 } // locs()->in(1).IsConstant(). 2491 } // locs()->in(1).IsConstant().
2492 2492
2493 2493
2494 if (locs()->in(1).IsStackSlot()) { 2494 if (locs()->in(1).IsStackSlot()) {
2495 const Address& right = locs()->in(1).ToStackSlotAddress(); 2495 const Address& right = Address::StackSlotAddress(locs()->in(1));
2496 switch (op_kind()) { 2496 switch (op_kind()) {
2497 case Token::kADD: { 2497 case Token::kADD: {
2498 __ addq(left, right); 2498 __ addq(left, right);
2499 if (deopt != NULL) __ j(OVERFLOW, deopt); 2499 if (deopt != NULL) __ j(OVERFLOW, deopt);
2500 break; 2500 break;
2501 } 2501 }
2502 case Token::kSUB: { 2502 case Token::kSUB: {
2503 __ subq(left, right); 2503 __ subq(left, right);
2504 if (deopt != NULL) __ j(OVERFLOW, deopt); 2504 if (deopt != NULL) __ j(OVERFLOW, deopt);
2505 break; 2505 break;
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after
4448 PcDescriptors::kOther, 4448 PcDescriptors::kOther,
4449 locs()); 4449 locs());
4450 __ Drop(2); // Discard type arguments and receiver. 4450 __ Drop(2); // Discard type arguments and receiver.
4451 } 4451 }
4452 4452
4453 } // namespace dart 4453 } // namespace dart
4454 4454
4455 #undef __ 4455 #undef __
4456 4456
4457 #endif // defined TARGET_ARCH_X64 4457 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698