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/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
9 | 9 |
10 #include "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2292 | 2292 |
2293 | 2293 |
2294 // Pushes the type arguments of the instantiator on the stack. | 2294 // Pushes the type arguments of the instantiator on the stack. |
2295 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) { | 2295 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) { |
2296 const Class& instantiator_class = Class::Handle( | 2296 const Class& instantiator_class = Class::Handle( |
2297 parsed_function().function().owner()); | 2297 parsed_function().function().owner()); |
2298 if (instantiator_class.NumTypeParameters() == 0) { | 2298 if (instantiator_class.NumTypeParameters() == 0) { |
2299 // The type arguments are compile time constants. | 2299 // The type arguments are compile time constants. |
2300 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); | 2300 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); |
2301 // TODO(regis): Temporary type should be allocated in new gen heap. | 2301 // TODO(regis): Temporary type should be allocated in new gen heap. |
2302 Type& type = Type::Handle(Type::New(instantiator_class, type_arguments)); | 2302 Type& type = Type::Handle( |
2303 Error& error = Error::Handle(); | 2303 Type::New(instantiator_class, type_arguments, token_index)); |
2304 type ^= ClassFinalizer::FinalizeAndCanonicalizeType(instantiator_class, | 2304 type ^= ClassFinalizer::FinalizeType(instantiator_class, type); |
2305 type, | |
2306 &error); | |
2307 if (!error.IsNull()) { | |
2308 ErrorMsg(token_index, error.ToErrorCString()); | |
2309 } | |
2310 type_arguments = type.arguments(); | 2305 type_arguments = type.arguments(); |
2311 __ PushObject(type_arguments); | 2306 __ PushObject(type_arguments); |
2312 } else { | 2307 } else { |
2313 ASSERT(parsed_function().instantiator() != NULL); | 2308 ASSERT(parsed_function().instantiator() != NULL); |
2314 parsed_function().instantiator()->Visit(this); | 2309 parsed_function().instantiator()->Visit(this); |
2315 Function& outer_function = | 2310 Function& outer_function = |
2316 Function::Handle(parsed_function().function().raw()); | 2311 Function::Handle(parsed_function().function().raw()); |
2317 while (outer_function.IsLocalFunction()) { | 2312 while (outer_function.IsLocalFunction()) { |
2318 outer_function = outer_function.parent_function(); | 2313 outer_function = outer_function.parent_function(); |
2319 } | 2314 } |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 const Error& error = Error::Handle( | 2789 const Error& error = Error::Handle( |
2795 Parser::FormatError(script, token_index, "Error", format, args)); | 2790 Parser::FormatError(script, token_index, "Error", format, args)); |
2796 va_end(args); | 2791 va_end(args); |
2797 Isolate::Current()->long_jump_base()->Jump(1, error); | 2792 Isolate::Current()->long_jump_base()->Jump(1, error); |
2798 UNREACHABLE(); | 2793 UNREACHABLE(); |
2799 } | 2794 } |
2800 | 2795 |
2801 } // namespace dart | 2796 } // namespace dart |
2802 | 2797 |
2803 #endif // defined TARGET_ARCH_X64 | 2798 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |