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

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

Issue 446373002: VM: Fix bug in CHA for signature classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | no next file » | 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/class_finalizer.h" 5 #include "vm/class_finalizer.h"
6 6
7 #include "vm/code_generator.h" 7 #include "vm/code_generator.h"
8 #include "vm/flags.h" 8 #include "vm/flags.h"
9 #include "vm/heap.h" 9 #include "vm/heap.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 FinalizeUpperBounds(cls); 2199 FinalizeUpperBounds(cls);
2200 2200
2201 // Resolve and finalize the result and parameter types of the signature 2201 // Resolve and finalize the result and parameter types of the signature
2202 // function of this signature class. 2202 // function of this signature class.
2203 const Function& sig_function = Function::Handle(cls.signature_function()); 2203 const Function& sig_function = Function::Handle(cls.signature_function());
2204 ResolveAndFinalizeSignature(cls, sig_function); 2204 ResolveAndFinalizeSignature(cls, sig_function);
2205 2205
2206 // Resolve and finalize the signature type of this signature class. 2206 // Resolve and finalize the signature type of this signature class.
2207 const Type& sig_type = Type::Handle(cls.SignatureType()); 2207 const Type& sig_type = Type::Handle(cls.SignatureType());
2208 FinalizeType(cls, sig_type, kCanonicalizeWellFormed); 2208 FinalizeType(cls, sig_type, kCanonicalizeWellFormed);
2209
2210 // Add this class to the subclasses of the superclass (_FunctionImpl).
2211 if (!super_type.IsNull()) {
2212 ASSERT(!super_type.IsObjectType());
2213 ASSERT(!super_class.IsNull());
2214 super_class.AddDirectSubclass(cls);
2215 }
2209 return; 2216 return;
2210 } 2217 }
2211 // Finalize interface types (but not necessarily interface classes). 2218 // Finalize interface types (but not necessarily interface classes).
2212 Array& interface_types = Array::Handle(cls.interfaces()); 2219 Array& interface_types = Array::Handle(cls.interfaces());
2213 AbstractType& interface_type = AbstractType::Handle(); 2220 AbstractType& interface_type = AbstractType::Handle();
2214 AbstractType& seen_interf = AbstractType::Handle(); 2221 AbstractType& seen_interf = AbstractType::Handle();
2215 for (intptr_t i = 0; i < interface_types.Length(); i++) { 2222 for (intptr_t i = 0; i < interface_types.Length(); i++) {
2216 interface_type ^= interface_types.At(i); 2223 interface_type ^= interface_types.At(i);
2217 interface_type = FinalizeType(cls, interface_type, kCanonicalizeWellFormed); 2224 interface_type = FinalizeType(cls, interface_type, kCanonicalizeWellFormed);
2218 interface_types.SetAt(i, interface_type); 2225 interface_types.SetAt(i, interface_type);
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
3049 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields()); 3056 ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
3050 field ^= fields_array.At(0); 3057 field ^= fields_array.At(0);
3051 ASSERT(field.Offset() == ByteBuffer::data_offset()); 3058 ASSERT(field.Offset() == ByteBuffer::data_offset());
3052 name ^= field.name(); 3059 name ^= field.name();
3053 expected_name ^= String::New("_data"); 3060 expected_name ^= String::New("_data");
3054 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3061 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3055 #endif 3062 #endif
3056 } 3063 }
3057 3064
3058 } // namespace dart 3065 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/cha_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698