| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 2235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2246 StubCode::GetAllocationStubForClosure(closure_function)); | 2246 StubCode::GetAllocationStubForClosure(closure_function)); |
| 2247 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); | 2247 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); |
| 2248 compiler->GenerateCall(token_pos(), | 2248 compiler->GenerateCall(token_pos(), |
| 2249 &label, | 2249 &label, |
| 2250 PcDescriptors::kOther, | 2250 PcDescriptors::kOther, |
| 2251 locs()); | 2251 locs()); |
| 2252 __ Drop(2); // Discard type arguments and receiver. | 2252 __ Drop(2); // Discard type arguments and receiver. |
| 2253 } | 2253 } |
| 2254 | 2254 |
| 2255 | 2255 |
| 2256 LocationSummary* PushArgumentInstr::MakeLocationSummary() const { | |
| 2257 const intptr_t kNumInputs = 1; | |
| 2258 const intptr_t kNumTemps= 0; | |
| 2259 LocationSummary* locs = | |
| 2260 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | |
| 2261 // TODO(fschneider): Use Any() once it is supported by all code generators. | |
| 2262 locs->set_in(0, Location::RequiresRegister()); | |
| 2263 return locs; | |
| 2264 } | |
| 2265 | |
| 2266 | |
| 2267 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 2268 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | |
| 2269 // where PushArgument is handled by BindInstr::EmitNativeCode. | |
| 2270 // TODO(fschneider): Avoid special-casing for SSA mode here. | |
| 2271 if (compiler->is_optimizing()) { | |
| 2272 ASSERT(locs()->in(0).IsRegister()); | |
| 2273 __ PushRegister(locs()->in(0).reg()); | |
| 2274 } | |
| 2275 } | |
| 2276 | |
| 2277 | |
| 2278 Environment* Environment::From(const GrowableArray<Definition*>& definitions, | 2256 Environment* Environment::From(const GrowableArray<Definition*>& definitions, |
| 2279 intptr_t fixed_parameter_count, | 2257 intptr_t fixed_parameter_count, |
| 2280 const Function& function) { | 2258 const Function& function) { |
| 2281 Environment* env = | 2259 Environment* env = |
| 2282 new Environment(definitions.length(), | 2260 new Environment(definitions.length(), |
| 2283 fixed_parameter_count, | 2261 fixed_parameter_count, |
| 2284 Isolate::kNoDeoptId, | 2262 Isolate::kNoDeoptId, |
| 2285 function, | 2263 function, |
| 2286 NULL); | 2264 NULL); |
| 2287 for (intptr_t i = 0; i < definitions.length(); ++i) { | 2265 for (intptr_t i = 0; i < definitions.length(); ++i) { |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2939 default: | 2917 default: |
| 2940 UNREACHABLE(); | 2918 UNREACHABLE(); |
| 2941 return -1; | 2919 return -1; |
| 2942 } | 2920 } |
| 2943 } | 2921 } |
| 2944 | 2922 |
| 2945 | 2923 |
| 2946 #undef __ | 2924 #undef __ |
| 2947 | 2925 |
| 2948 } // namespace dart | 2926 } // namespace dart |
| OLD | NEW |