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

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

Issue 10578004: Fix bad assert in static type propagation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | tests/co19/co19-runtime.status » ('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/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/flow_graph_compiler.h" 9 #include "vm/flow_graph_compiler.h"
10 #include "vm/locations.h" 10 #include "vm/locations.h"
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 501
502 RawAbstractType* ClosureCallComp::StaticType() const { 502 RawAbstractType* ClosureCallComp::StaticType() const {
503 // The closure is the first argument to the call. 503 // The closure is the first argument to the call.
504 const AbstractType& function_type = 504 const AbstractType& function_type =
505 AbstractType::Handle(ArgumentAt(0)->StaticType()); 505 AbstractType::Handle(ArgumentAt(0)->StaticType());
506 if (function_type.IsDynamicType() || function_type.IsFunctionInterface()) { 506 if (function_type.IsDynamicType() || function_type.IsFunctionInterface()) {
507 // The function type is not statically known or simply Function. 507 // The function type is not statically known or simply Function.
508 return Type::DynamicType(); 508 return Type::DynamicType();
509 } 509 }
510 const Class& signature_class = Class::Handle(function_type.type_class()); 510 const Class& signature_class = Class::Handle(function_type.type_class());
511 ASSERT(signature_class.IsSignatureClass());
512 const Function& signature_function = 511 const Function& signature_function =
513 Function::Handle(signature_class.signature_function()); 512 Function::Handle(signature_class.signature_function());
513 if (signature_function.IsNull()) {
514 // Attempting to invoke a non-closure object.
515 return Type::DynamicType();
516 }
514 // TODO(regis): The result type may be generic. Consider upper bounds. 517 // TODO(regis): The result type may be generic. Consider upper bounds.
515 return signature_function.result_type(); 518 return signature_function.result_type();
516 } 519 }
517 520
518 521
519 RawAbstractType* InstanceCallComp::StaticType() const { 522 RawAbstractType* InstanceCallComp::StaticType() const {
520 return Type::DynamicType(); 523 return Type::DynamicType();
521 } 524 }
522 525
523 526
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint()); 1199 const ExternalLabel label(closure_function.ToCString(), stub.EntryPoint());
1197 compiler->GenerateCall(token_index(), try_index(), &label, 1200 compiler->GenerateCall(token_index(), try_index(), &label,
1198 PcDescriptors::kOther); 1201 PcDescriptors::kOther);
1199 __ Drop(2); // Discard type arguments and receiver. 1202 __ Drop(2); // Discard type arguments and receiver.
1200 } 1203 }
1201 1204
1202 1205
1203 #undef __ 1206 #undef __
1204 1207
1205 } // namespace dart 1208 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698