OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 14 matching lines...) Expand all Loading... |
25 // on the stack and return the result in a fixed register RAX. | 25 // on the stack and return the result in a fixed register RAX. |
26 LocationSummary* Computation::MakeCallSummary() { | 26 LocationSummary* Computation::MakeCallSummary() { |
27 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 27 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); |
28 result->set_out(Location::RegisterLocation(RAX)); | 28 result->set_out(Location::RegisterLocation(RAX)); |
29 return result; | 29 return result; |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 33 void BindInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
34 computation()->EmitNativeCode(compiler); | 34 computation()->EmitNativeCode(compiler); |
35 if (is_used() && locs()->out().kind() == Location::kRegister) { | 35 if (is_used() && locs()->out().IsRegister()) { |
36 // TODO(vegorov): this should really happen only for comparisons fused | 36 // TODO(vegorov): this should really happen only for comparisons fused |
37 // with branches. Currrently IR does not provide an easy way to remove | 37 // with branches. Currrently IR does not provide an easy way to remove |
38 // instructions from the graph so we just leave fused comparison in it | 38 // instructions from the graph so we just leave fused comparison in it |
39 // but change its result location to be NoLocation. | 39 // but change its result location to be NoLocation. |
40 compiler->frame_register_allocator()->Push(locs()->out().reg(), this); | 40 compiler->frame_register_allocator()->Push(locs()->out().reg(), this); |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 LocationSummary* ReturnInstr::MakeLocationSummary() const { | 45 LocationSummary* ReturnInstr::MakeLocationSummary() const { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 LocationSummary* RelationalOpComp::MakeLocationSummary() const { | 441 LocationSummary* RelationalOpComp::MakeLocationSummary() const { |
442 const LocationSummary::ContainsBranch contains_branch = | 442 const LocationSummary::ContainsBranch contains_branch = |
443 is_fused_with_branch() ? LocationSummary::kBranch | 443 is_fused_with_branch() ? LocationSummary::kBranch |
444 : LocationSummary::kNoBranch; | 444 : LocationSummary::kNoBranch; |
445 | 445 |
446 if (operands_class_id() == kSmi || operands_class_id() == kDouble) { | 446 if (operands_class_id() == kSmi || operands_class_id() == kDouble) { |
447 const intptr_t kNumInputs = 2; | 447 const intptr_t kNumInputs = 2; |
448 const intptr_t kNumTemps = 1; | 448 const intptr_t kNumTemps = 1; |
449 LocationSummary* summary = new LocationSummary(kNumInputs, | 449 LocationSummary* summary = new LocationSummary(kNumInputs, |
450 kNumTemps, | 450 kNumTemps, |
451 LocationSummary::kCall, | 451 LocationSummary::kNoCall, |
452 contains_branch); | 452 contains_branch); |
453 summary->set_in(0, Location::RequiresRegister()); | 453 summary->set_in(0, Location::RequiresRegister()); |
454 summary->set_in(1, Location::RequiresRegister()); | 454 summary->set_in(1, Location::RequiresRegister()); |
455 if (!is_fused_with_branch()) { | 455 if (!is_fused_with_branch()) { |
456 summary->set_out(Location::RequiresRegister()); | 456 summary->set_out(Location::RequiresRegister()); |
457 } | 457 } |
458 summary->set_temp(0, Location::RequiresRegister()); | 458 summary->set_temp(0, Location::RequiresRegister()); |
459 return summary; | 459 return summary; |
460 } | 460 } |
461 ASSERT(!is_fused_with_branch()); | 461 ASSERT(!is_fused_with_branch()); |
(...skipping 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 compiler->GenerateStaticCall(instance_call()->cid(), | 1974 compiler->GenerateStaticCall(instance_call()->cid(), |
1975 instance_call()->token_pos(), | 1975 instance_call()->token_pos(), |
1976 instance_call()->try_index(), | 1976 instance_call()->try_index(), |
1977 target, | 1977 target, |
1978 instance_call()->ArgumentCount(), | 1978 instance_call()->ArgumentCount(), |
1979 instance_call()->argument_names()); | 1979 instance_call()->argument_names()); |
1980 } | 1980 } |
1981 __ Bind(&done); | 1981 __ Bind(&done); |
1982 } | 1982 } |
1983 | 1983 |
| 1984 |
1984 } // namespace dart | 1985 } // namespace dart |
1985 | 1986 |
1986 #undef __ | 1987 #undef __ |
1987 | 1988 |
1988 #endif // defined TARGET_ARCH_X64 | 1989 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |