Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: runtime/vm/code_generator_ia32.cc

Issue 8921033: Implement revised factories in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 2262
2263 2263
2264 // Pushes the type arguments of the instantiator on the stack. 2264 // Pushes the type arguments of the instantiator on the stack.
2265 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) { 2265 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) {
2266 Class& instantiator_class = Class::Handle(); 2266 Class& instantiator_class = Class::Handle();
2267 Function& outer_function = 2267 Function& outer_function =
2268 Function::Handle(parsed_function().function().raw()); 2268 Function::Handle(parsed_function().function().raw());
2269 while (outer_function.IsLocalFunction()) { 2269 while (outer_function.IsLocalFunction()) {
2270 outer_function = outer_function.parent_function(); 2270 outer_function = outer_function.parent_function();
2271 } 2271 }
2272 if (outer_function.IsFactory()) { 2272 // TODO(regis): Remove support for type parameters on factories.
2273 if (outer_function.IsFactory() &&
2274 (outer_function.signature_class() != Class::null())) {
2273 instantiator_class = outer_function.signature_class(); 2275 instantiator_class = outer_function.signature_class();
2274 } else { 2276 } else {
2275 instantiator_class = outer_function.owner(); 2277 instantiator_class = outer_function.owner();
2276 } 2278 }
2277 if (instantiator_class.NumTypeParameters() == 0) { 2279 if (instantiator_class.NumTypeParameters() == 0) {
2278 // The type arguments are compile time constants. 2280 // The type arguments are compile time constants.
2279 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); 2281 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle();
2280 // TODO(regis): Temporary type should be allocated in new gen heap. 2282 // TODO(regis): Temporary type should be allocated in new gen heap.
2281 Type& type = Type::Handle( 2283 Type& type = Type::Handle(
2282 Type::NewParameterizedType(instantiator_class, type_arguments)); 2284 Type::NewParameterizedType(instantiator_class, type_arguments));
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
2770 message_buffer, kMessageBufferSize, 2772 message_buffer, kMessageBufferSize,
2771 format, args); 2773 format, args);
2772 va_end(args); 2774 va_end(args);
2773 Isolate::Current()->long_jump_base()->Jump(1, message_buffer); 2775 Isolate::Current()->long_jump_base()->Jump(1, message_buffer);
2774 UNREACHABLE(); 2776 UNREACHABLE();
2775 } 2777 }
2776 2778
2777 } // namespace dart 2779 } // namespace dart
2778 2780
2779 #endif // defined TARGET_ARCH_IA32 2781 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698