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

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

Issue 8372041: Canonicalize types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 } 2163 }
2164 2164
2165 2165
2166 // Pushes the type arguments of the instantiator on the stack. 2166 // Pushes the type arguments of the instantiator on the stack.
2167 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) { 2167 void CodeGenerator::GenerateInstantiatorTypeArguments(intptr_t token_index) {
2168 const Class& instantiator_class = 2168 const Class& instantiator_class =
2169 Class::Handle(parsed_function().function().owner()); 2169 Class::Handle(parsed_function().function().owner());
2170 if (instantiator_class.NumTypeParameters() == 0) { 2170 if (instantiator_class.NumTypeParameters() == 0) {
2171 // The type arguments are compile time constants. 2171 // The type arguments are compile time constants.
2172 TypeArguments& type_arguments = TypeArguments::ZoneHandle(); 2172 TypeArguments& type_arguments = TypeArguments::ZoneHandle();
2173 const Type& type = Type::Handle( 2173 Type& type = Type::Handle(
2174 Type::NewParameterizedType(instantiator_class, type_arguments)); 2174 Type::NewParameterizedType(instantiator_class, type_arguments));
2175 const String& errmsg = String::Handle( 2175 String& errmsg = String::Handle();
2176 ClassFinalizer::FinalizeTypeWhileParsing(type)); 2176 type = ClassFinalizer::FinalizeAndCanonicalizeType(type, &errmsg);
2177 if (!errmsg.IsNull()) { 2177 if (!errmsg.IsNull()) {
2178 ErrorMsg(token_index, errmsg.ToCString()); 2178 ErrorMsg(token_index, errmsg.ToCString());
2179 } 2179 }
2180 type_arguments = type.arguments(); 2180 type_arguments = type.arguments();
2181 __ PushObject(type_arguments); 2181 __ PushObject(type_arguments);
2182 } else { 2182 } else {
2183 ASSERT(parsed_function().instantiator() != NULL); 2183 ASSERT(parsed_function().instantiator() != NULL);
2184 parsed_function().instantiator()->Visit(this); 2184 parsed_function().instantiator()->Visit(this);
2185 if (!parsed_function().function().IsInFactoryScope()) { 2185 if (!parsed_function().function().IsInFactoryScope()) {
2186 __ popl(EAX); // Pop instantiator. 2186 __ popl(EAX); // Pop instantiator.
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 const Class& cls = Class::Handle(parsed_function_.function().owner()); 2638 const Class& cls = Class::Handle(parsed_function_.function().owner());
2639 const Script& script = Script::Handle(cls.script()); 2639 const Script& script = Script::Handle(cls.script());
2640 Parser::ReportMsg(script, token_index, "Error", error_msg, format, args); 2640 Parser::ReportMsg(script, token_index, "Error", error_msg, format, args);
2641 Isolate::Current()->long_jump_base()->Jump(1, error_msg); 2641 Isolate::Current()->long_jump_base()->Jump(1, error_msg);
2642 UNREACHABLE(); 2642 UNREACHABLE();
2643 } 2643 }
2644 2644
2645 } // namespace dart 2645 } // namespace dart
2646 2646
2647 #endif // defined TARGET_ARCH_IA32 2647 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698