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 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 new(Z) ZoneGrowableArray<PushArgumentInstr*>(0); | 2498 new(Z) ZoneGrowableArray<PushArgumentInstr*>(0); |
2499 AllocateObjectInstr* alloc = new(Z) AllocateObjectInstr(node->token_pos(), | 2499 AllocateObjectInstr* alloc = new(Z) AllocateObjectInstr(node->token_pos(), |
2500 closure_class, | 2500 closure_class, |
2501 no_arguments); | 2501 no_arguments); |
2502 alloc->set_closure_function(function); | 2502 alloc->set_closure_function(function); |
2503 | 2503 |
2504 Value* closure_val = Bind(alloc); | 2504 Value* closure_val = Bind(alloc); |
2505 { LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val, | 2505 { LocalVariable* closure_tmp_var = EnterTempLocalScope(closure_val, |
2506 node->token_pos()); | 2506 node->token_pos()); |
2507 // Store type arguments if scope class is generic. | 2507 // Store type arguments if scope class is generic. |
2508 const FunctionType& function_type = | 2508 const Type& function_type = Type::ZoneHandle(Z, function.SignatureType()); |
2509 FunctionType::ZoneHandle(Z, function.SignatureType()); | 2509 const Class& scope_cls = Class::ZoneHandle(Z, function_type.type_class()); |
2510 const Class& scope_cls = Class::ZoneHandle(Z, function_type.scope_class()); | |
2511 if (scope_cls.IsGeneric()) { | 2510 if (scope_cls.IsGeneric()) { |
2512 ASSERT(function.Owner() == scope_cls.raw()); | 2511 ASSERT(function.Owner() == scope_cls.raw()); |
2513 Value* closure_tmp_val = Bind(new(Z) LoadLocalInstr(*closure_tmp_var, | 2512 Value* closure_tmp_val = Bind(new(Z) LoadLocalInstr(*closure_tmp_var, |
2514 node->token_pos())); | 2513 node->token_pos())); |
2515 const Class& instantiator_class = Class::Handle( | 2514 const Class& instantiator_class = Class::Handle( |
2516 Z, owner()->function().Owner()); | 2515 Z, owner()->function().Owner()); |
2517 Value* type_arguments = BuildInstantiatorTypeArguments(node->token_pos(), | 2516 Value* type_arguments = BuildInstantiatorTypeArguments(node->token_pos(), |
2518 instantiator_class, | 2517 instantiator_class, |
2519 NULL); | 2518 NULL); |
2520 Do(new(Z) StoreInstanceFieldInstr(Closure::type_arguments_offset(), | 2519 Do(new(Z) StoreInstanceFieldInstr(Closure::type_arguments_offset(), |
(...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4661 Script::Handle(function.script()), | 4660 Script::Handle(function.script()), |
4662 function.token_pos(), | 4661 function.token_pos(), |
4663 Report::AtLocation, | 4662 Report::AtLocation, |
4664 "FlowGraphBuilder Bailout: %s %s", | 4663 "FlowGraphBuilder Bailout: %s %s", |
4665 String::Handle(function.name()).ToCString(), | 4664 String::Handle(function.name()).ToCString(), |
4666 reason); | 4665 reason); |
4667 UNREACHABLE(); | 4666 UNREACHABLE(); |
4668 } | 4667 } |
4669 | 4668 |
4670 } // namespace dart | 4669 } // namespace dart |
OLD | NEW |