| 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 "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1548 | 1548 |
| 1549 // 'expression_temp_var' may not be used inside this method if 'instantiator' | 1549 // 'expression_temp_var' may not be used inside this method if 'instantiator' |
| 1550 // is not NULL. | 1550 // is not NULL. |
| 1551 Value* EffectGraphVisitor::BuildInstantiatorTypeArguments( | 1551 Value* EffectGraphVisitor::BuildInstantiatorTypeArguments( |
| 1552 intptr_t token_pos, Value* instantiator) { | 1552 intptr_t token_pos, Value* instantiator) { |
| 1553 const Class& instantiator_class = Class::Handle( | 1553 const Class& instantiator_class = Class::Handle( |
| 1554 owner()->parsed_function().function().owner()); | 1554 owner()->parsed_function().function().owner()); |
| 1555 if (instantiator_class.NumTypeParameters() == 0) { | 1555 if (instantiator_class.NumTypeParameters() == 0) { |
| 1556 // The type arguments are compile time constants. | 1556 // The type arguments are compile time constants. |
| 1557 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); | 1557 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); |
| 1558 // TODO(regis): Temporary type should be allocated in new gen heap. | 1558 // Type is temporary. Only its type arguments are preserved. |
| 1559 Type& type = Type::Handle( | 1559 Type& type = Type::Handle( |
| 1560 Type::New(instantiator_class, type_arguments, token_pos)); | 1560 Type::New(instantiator_class, type_arguments, token_pos, Heap::kNew)); |
| 1561 type ^= ClassFinalizer::FinalizeType( | 1561 type ^= ClassFinalizer::FinalizeType( |
| 1562 instantiator_class, type, ClassFinalizer::kFinalizeWellFormed); | 1562 instantiator_class, type, ClassFinalizer::kFinalize); |
| 1563 ASSERT(!type.IsMalformed()); |
| 1563 type_arguments = type.arguments(); | 1564 type_arguments = type.arguments(); |
| 1565 type_arguments = type_arguments.Canonicalize(); |
| 1564 return Bind(new ConstantVal(type_arguments)); | 1566 return Bind(new ConstantVal(type_arguments)); |
| 1565 } | 1567 } |
| 1566 Function& outer_function = | 1568 Function& outer_function = |
| 1567 Function::Handle(owner()->parsed_function().function().raw()); | 1569 Function::Handle(owner()->parsed_function().function().raw()); |
| 1568 while (outer_function.IsLocalFunction()) { | 1570 while (outer_function.IsLocalFunction()) { |
| 1569 outer_function = outer_function.parent_function(); | 1571 outer_function = outer_function.parent_function(); |
| 1570 } | 1572 } |
| 1571 if (outer_function.IsFactory()) { | 1573 if (outer_function.IsFactory()) { |
| 1572 // No instantiator for factories. | 1574 // No instantiator for factories. |
| 1573 ASSERT(instantiator == NULL); | 1575 ASSERT(instantiator == NULL); |
| (...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2659 char* chars = reinterpret_cast<char*>( | 2661 char* chars = reinterpret_cast<char*>( |
| 2660 Isolate::Current()->current_zone()->Allocate(len)); | 2662 Isolate::Current()->current_zone()->Allocate(len)); |
| 2661 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2663 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2662 const Error& error = Error::Handle( | 2664 const Error& error = Error::Handle( |
| 2663 LanguageError::New(String::Handle(String::New(chars)))); | 2665 LanguageError::New(String::Handle(String::New(chars)))); |
| 2664 Isolate::Current()->long_jump_base()->Jump(1, error); | 2666 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2665 } | 2667 } |
| 2666 | 2668 |
| 2667 | 2669 |
| 2668 } // namespace dart | 2670 } // namespace dart |
| OLD | NEW |