| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 Class::ZoneHandle(Z, isolate()->object_store()->closure_class()); | 2354 Class::ZoneHandle(Z, isolate()->object_store()->closure_class()); |
| 2355 ZoneGrowableArray<PushArgumentInstr*>* no_arguments = | 2355 ZoneGrowableArray<PushArgumentInstr*>* no_arguments = |
| 2356 new (Z) ZoneGrowableArray<PushArgumentInstr*>(0); | 2356 new (Z) ZoneGrowableArray<PushArgumentInstr*>(0); |
| 2357 AllocateObjectInstr* alloc = new (Z) | 2357 AllocateObjectInstr* alloc = new (Z) |
| 2358 AllocateObjectInstr(node->token_pos(), closure_class, no_arguments); | 2358 AllocateObjectInstr(node->token_pos(), closure_class, no_arguments); |
| 2359 alloc->set_closure_function(function); | 2359 alloc->set_closure_function(function); |
| 2360 | 2360 |
| 2361 Value* closure_val = Bind(alloc); | 2361 Value* closure_val = Bind(alloc); |
| 2362 { | 2362 { |
| 2363 LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val); | 2363 LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val); |
| 2364 // Store instantiator type arguments if scope class is generic. | 2364 // Store instantiator type arguments if signature is uninstantiated. |
| 2365 const Type& function_type = Type::ZoneHandle(Z, function.SignatureType()); | 2365 if (!function.HasInstantiatedSignature(kClass)) { |
| 2366 const Class& scope_cls = Class::ZoneHandle(Z, function_type.type_class()); | |
| 2367 if (scope_cls.IsGeneric()) { | |
| 2368 ASSERT(function.Owner() == scope_cls.raw()); | |
| 2369 Value* closure_tmp_val = | 2366 Value* closure_tmp_val = |
| 2370 Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos())); | 2367 Bind(new (Z) LoadLocalInstr(*closure_tmp_var, node->token_pos())); |
| 2371 Value* type_arguments = BuildInstantiatorTypeArguments(node->token_pos()); | 2368 Value* type_arguments = BuildInstantiatorTypeArguments(node->token_pos()); |
| 2372 Do(new (Z) StoreInstanceFieldInstr(Closure::instantiator_offset(), | 2369 Do(new (Z) StoreInstanceFieldInstr(Closure::instantiator_offset(), |
| 2373 closure_tmp_val, type_arguments, | 2370 closure_tmp_val, type_arguments, |
| 2374 kEmitStoreBarrier, node->token_pos())); | 2371 kEmitStoreBarrier, node->token_pos())); |
| 2375 } | 2372 } |
| 2376 | 2373 |
| 2377 // Store function. | 2374 // Store function. |
| 2378 Value* closure_tmp_val = | 2375 Value* closure_tmp_val = |
| (...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4355 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); | 4352 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); |
| 4356 ASSERT(found); | 4353 ASSERT(found); |
| 4357 } | 4354 } |
| 4358 | 4355 |
| 4359 | 4356 |
| 4360 void FlowGraphBuilder::Bailout(const char* reason) const { | 4357 void FlowGraphBuilder::Bailout(const char* reason) const { |
| 4361 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4358 parsed_function_.Bailout("FlowGraphBuilder", reason); |
| 4362 } | 4359 } |
| 4363 | 4360 |
| 4364 } // namespace dart | 4361 } // namespace dart |
| OLD | NEW |