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 LocationSummary::ContainsCall contains_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 stack_bitmap_(NULL), | 19 stack_bitmap_(NULL), |
20 is_call_(contains_call == kCall) { | 20 contains_call_(contains_call), |
21 if (is_call()) stack_bitmap_ = new BitmapBuilder(); | 21 live_registers_() { |
22 for (intptr_t i = 0; i < input_count; i++) { | 22 for (intptr_t i = 0; i < input_count; i++) { |
23 input_locations_.Add(Location()); | 23 input_locations_.Add(Location()); |
24 } | 24 } |
25 for (intptr_t i = 0; i < temp_count; i++) { | 25 for (intptr_t i = 0; i < temp_count; i++) { |
26 temp_locations_.Add(Location()); | 26 temp_locations_.Add(Location()); |
27 } | 27 } |
| 28 |
| 29 if (contains_call_ != kNoCall) { |
| 30 stack_bitmap_ = new BitmapBuilder(); |
| 31 } |
28 } | 32 } |
29 | 33 |
30 | 34 |
31 LocationSummary* LocationSummary::Make( | 35 LocationSummary* LocationSummary::Make( |
32 intptr_t input_count, | 36 intptr_t input_count, |
33 Location out, | 37 Location out, |
34 LocationSummary::ContainsCall contains_call) { | 38 LocationSummary::ContainsCall contains_call) { |
35 LocationSummary* summary = new LocationSummary(input_count, 0, contains_call); | 39 LocationSummary* summary = new LocationSummary(input_count, 0, contains_call); |
36 for (intptr_t i = 0; i < input_count; i++) { | 40 for (intptr_t i = 0; i < input_count; i++) { |
37 summary->set_in(i, Location::RequiresRegister()); | 41 summary->set_in(i, Location::RequiresRegister()); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 109 |
106 if (!out().IsInvalid()) { | 110 if (!out().IsInvalid()) { |
107 f->Print(" => "); | 111 f->Print(" => "); |
108 out().PrintTo(f); | 112 out().PrintTo(f); |
109 } | 113 } |
110 | 114 |
111 if (is_call()) f->Print(" C"); | 115 if (is_call()) f->Print(" C"); |
112 } | 116 } |
113 | 117 |
114 } // namespace dart | 118 } // namespace dart |
OLD | NEW |