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

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

Issue 10871005: Make ClassFinalizer indifferent on whether we are generating a snapshot or not. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months 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) 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/code_descriptors.h" 8 #include "vm/code_descriptors.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 Value* EffectGraphVisitor::BuildInstantiatorTypeArguments( 1578 Value* EffectGraphVisitor::BuildInstantiatorTypeArguments(
1579 intptr_t token_pos, Value* instantiator) { 1579 intptr_t token_pos, Value* instantiator) {
1580 const Class& instantiator_class = Class::Handle( 1580 const Class& instantiator_class = Class::Handle(
1581 owner()->parsed_function().function().Owner()); 1581 owner()->parsed_function().function().Owner());
1582 if (instantiator_class.NumTypeParameters() == 0) { 1582 if (instantiator_class.NumTypeParameters() == 0) {
1583 // The type arguments are compile time constants. 1583 // The type arguments are compile time constants.
1584 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle(); 1584 AbstractTypeArguments& type_arguments = AbstractTypeArguments::ZoneHandle();
1585 // Type is temporary. Only its type arguments are preserved. 1585 // Type is temporary. Only its type arguments are preserved.
1586 Type& type = Type::Handle( 1586 Type& type = Type::Handle(
1587 Type::New(instantiator_class, type_arguments, token_pos, Heap::kNew)); 1587 Type::New(instantiator_class, type_arguments, token_pos, Heap::kNew));
1588 type ^= ClassFinalizer::FinalizeType( 1588 ClassFinalizer class_finalizer(ClassFinalizer::kNotGeneratingSnapshot);
1589 type ^= class_finalizer.FinalizeType(
1589 instantiator_class, type, ClassFinalizer::kFinalize); 1590 instantiator_class, type, ClassFinalizer::kFinalize);
1590 ASSERT(!type.IsMalformed()); 1591 ASSERT(!type.IsMalformed());
1591 type_arguments = type.arguments(); 1592 type_arguments = type.arguments();
1592 type_arguments = type_arguments.Canonicalize(); 1593 type_arguments = type_arguments.Canonicalize();
1593 return Bind(Constant(type_arguments)); 1594 return Bind(Constant(type_arguments));
1594 } 1595 }
1595 Function& outer_function = 1596 Function& outer_function =
1596 Function::Handle(owner()->parsed_function().function().raw()); 1597 Function::Handle(owner()->parsed_function().function().raw());
1597 while (outer_function.IsLocalFunction()) { 1598 while (outer_function.IsLocalFunction()) {
1598 outer_function = outer_function.parent_function(); 1599 outer_function = outer_function.parent_function();
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2414 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 2415 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
2415 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 2416 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
2416 OS::SNPrint(chars, len, kFormat, function_name, reason); 2417 OS::SNPrint(chars, len, kFormat, function_name, reason);
2417 const Error& error = Error::Handle( 2418 const Error& error = Error::Handle(
2418 LanguageError::New(String::Handle(String::New(chars)))); 2419 LanguageError::New(String::Handle(String::New(chars))));
2419 Isolate::Current()->long_jump_base()->Jump(1, error); 2420 Isolate::Current()->long_jump_base()->Jump(1, error);
2420 } 2421 }
2421 2422
2422 2423
2423 } // namespace dart 2424 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698