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

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

Issue 23190035: Distinguish between malformed and malbounded types (fix issues 12552 and 12554). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 AbstractType::CheckedHandle(arguments.ArgAt(1)); 604 AbstractType::CheckedHandle(arguments.ArgAt(1));
605 const Instance& dst_instantiator = 605 const Instance& dst_instantiator =
606 Instance::CheckedHandle(arguments.ArgAt(2)); 606 Instance::CheckedHandle(arguments.ArgAt(2));
607 const AbstractTypeArguments& instantiator_type_arguments = 607 const AbstractTypeArguments& instantiator_type_arguments =
608 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(3)); 608 AbstractTypeArguments::CheckedHandle(arguments.ArgAt(3));
609 const String& dst_name = String::CheckedHandle(arguments.ArgAt(4)); 609 const String& dst_name = String::CheckedHandle(arguments.ArgAt(4));
610 const SubtypeTestCache& cache = 610 const SubtypeTestCache& cache =
611 SubtypeTestCache::CheckedHandle(arguments.ArgAt(5)); 611 SubtypeTestCache::CheckedHandle(arguments.ArgAt(5));
612 ASSERT(!dst_type.IsDynamicType()); // No need to check assignment. 612 ASSERT(!dst_type.IsDynamicType()); // No need to check assignment.
613 ASSERT(!dst_type.IsMalformed()); // Already checked in code generator. 613 ASSERT(!dst_type.IsMalformed()); // Already checked in code generator.
614 ASSERT(!dst_type.IsMalbounded()); // Already checked in code generator.
614 ASSERT(!src_instance.IsNull()); // Already checked in inlined code. 615 ASSERT(!src_instance.IsNull()); // Already checked in inlined code.
615 616
616 Error& malformed_error = Error::Handle(); 617 Error& malformed_error = Error::Handle();
617 const bool is_instance_of = src_instance.IsInstanceOf( 618 const bool is_instance_of = src_instance.IsInstanceOf(
618 dst_type, instantiator_type_arguments, &malformed_error); 619 dst_type, instantiator_type_arguments, &malformed_error);
619 620
620 if (FLAG_trace_type_checks) { 621 if (FLAG_trace_type_checks) {
621 PrintTypeCheck("TypeCheck", 622 PrintTypeCheck("TypeCheck",
622 src_instance, dst_type, instantiator_type_arguments, 623 src_instance, dst_type, instantiator_type_arguments,
623 is_instance_of ? Bool::True() : Bool::False()); 624 is_instance_of ? Bool::True() : Bool::False());
(...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 field.UpdateCid(cid); 1891 field.UpdateCid(cid);
1891 intptr_t list_length = Field::kNoFixedLength; 1892 intptr_t list_length = Field::kNoFixedLength;
1892 if ((field.guarded_cid() != kDynamicCid) && 1893 if ((field.guarded_cid() != kDynamicCid) &&
1893 field.is_final() && RawObject::IsBuiltinListClassId(cid)) { 1894 field.is_final() && RawObject::IsBuiltinListClassId(cid)) {
1894 list_length = GetListLength(value); 1895 list_length = GetListLength(value);
1895 } 1896 }
1896 field.UpdateLength(list_length); 1897 field.UpdateLength(list_length);
1897 } 1898 }
1898 1899
1899 } // namespace dart 1900 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698