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/locations.h" | 5 #include "vm/locations.h" |
6 | 6 |
7 #include "vm/il_printer.h" | 7 #include "vm/il_printer.h" |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 #include "vm/flow_graph_compiler.h" | 9 #include "vm/flow_graph_compiler.h" |
10 | 10 |
11 namespace dart { | 11 namespace dart { |
12 | 12 |
13 LocationSummary::LocationSummary(intptr_t input_count, | 13 LocationSummary::LocationSummary(intptr_t input_count, |
14 intptr_t temp_count, | 14 intptr_t temp_count, |
15 ContainsCall call) | 15 LocationSummary::ContainsCall contains_call) |
16 : input_locations_(input_count), | 16 : input_locations_(input_count), |
17 temp_locations_(temp_count), | 17 temp_locations_(temp_count), |
18 output_location_(), | 18 output_location_(), |
19 is_call_(call == kCall) { | 19 is_call_(contains_call == LocationSummary::kCall) { |
20 for (intptr_t i = 0; i < input_count; i++) { | 20 for (intptr_t i = 0; i < input_count; i++) { |
21 input_locations_.Add(Location()); | 21 input_locations_.Add(Location()); |
22 } | 22 } |
23 for (intptr_t i = 0; i < temp_count; i++) { | 23 for (intptr_t i = 0; i < temp_count; i++) { |
24 temp_locations_.Add(Location()); | 24 temp_locations_.Add(Location()); |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
28 | 28 |
29 LocationSummary* LocationSummary::Make(intptr_t input_count, | 29 LocationSummary* LocationSummary::Make( |
30 Location out, | 30 intptr_t input_count, |
31 ContainsCall contains_call) { | 31 Location out, |
32 LocationSummary* summary = new LocationSummary(input_count, | 32 LocationSummary::ContainsCall contains_call) { |
33 0, | 33 LocationSummary* summary = new LocationSummary(input_count, 0, contains_call); |
34 contains_call); | |
35 for (intptr_t i = 0; i < input_count; i++) { | 34 for (intptr_t i = 0; i < input_count; i++) { |
36 summary->set_in(i, Location::RequiresRegister()); | 35 summary->set_in(i, Location::RequiresRegister()); |
37 } | 36 } |
38 summary->set_out(out); | 37 summary->set_out(out); |
39 return summary; | 38 return summary; |
40 } | 39 } |
41 | 40 |
42 | 41 |
43 const char* Location::Name() const { | 42 const char* Location::Name() const { |
44 switch (kind()) { | 43 switch (kind()) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 94 |
96 if (!out().IsInvalid()) { | 95 if (!out().IsInvalid()) { |
97 f->Print(" => "); | 96 f->Print(" => "); |
98 out().PrintTo(f); | 97 out().PrintTo(f); |
99 } | 98 } |
100 | 99 |
101 if (is_call()) f->Print(" C"); | 100 if (is_call()) f->Print(" C"); |
102 } | 101 } |
103 | 102 |
104 } // namespace dart | 103 } // namespace dart |
105 | |
OLD | NEW |