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

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

Issue 10797031: Add missing type finalization for function literals not assigned to a function (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/vm/object.cc » ('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) 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 781
782 RawAbstractType* CreateArrayComp::StaticType() const { 782 RawAbstractType* CreateArrayComp::StaticType() const {
783 UNREACHABLE(); 783 UNREACHABLE();
784 return AbstractType::null(); 784 return AbstractType::null();
785 } 785 }
786 786
787 787
788 RawAbstractType* CreateClosureComp::StaticType() const { 788 RawAbstractType* CreateClosureComp::StaticType() const {
789 const Function& fun = function(); 789 const Function& fun = function();
790 const Class& signature_class = Class::Handle(fun.signature_class()); 790 const Class& signature_class = Class::Handle(fun.signature_class());
791 // TODO(regis): The signature type may be generic. Consider upper bounds. 791 return signature_class.SignatureType();
792 // For now, we return Dynamic (no type test elimination) if the signature
793 // class is parameterized, or a non-parameterized finalized type otherwise.
794 if (signature_class.HasTypeArguments()) {
795 return Type::DynamicType();
796 }
797 // Make sure we use the canonical signature class.
798 const Type& type = Type::Handle(signature_class.SignatureType());
799 const Class& canonical_signature_class = Class::Handle(type.type_class());
800 return Type::NewNonParameterizedType(canonical_signature_class);
801 } 792 }
802 793
803 794
804 RawAbstractType* AllocateObjectComp::StaticType() const { 795 RawAbstractType* AllocateObjectComp::StaticType() const {
805 UNREACHABLE(); 796 UNREACHABLE();
806 return AbstractType::null(); 797 return AbstractType::null();
807 } 798 }
808 799
809 800
810 RawAbstractType* AllocateObjectWithBoundsCheckComp::StaticType() const { 801 RawAbstractType* AllocateObjectWithBoundsCheckComp::StaticType() const {
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); 1304 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
1314 compiler->GenerateCall(token_pos(), try_index(), &label, 1305 compiler->GenerateCall(token_pos(), try_index(), &label,
1315 PcDescriptors::kOther); 1306 PcDescriptors::kOther);
1316 __ Drop(2); // Discard type arguments and receiver. 1307 __ Drop(2); // Discard type arguments and receiver.
1317 } 1308 }
1318 1309
1319 1310
1320 #undef __ 1311 #undef __
1321 1312
1322 } // namespace dart 1313 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/builtin_natives.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698