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

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

Issue 269253005: Put metadata fields in their owner class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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) 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 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 ASSERT(!super_class.IsNull()); 2282 ASSERT(!super_class.IsNull());
2283 super_class.AddDirectSubclass(cls); 2283 super_class.AddDirectSubclass(cls);
2284 } 2284 }
2285 // A top level class is parsed eagerly so just finalize it. 2285 // A top level class is parsed eagerly so just finalize it.
2286 if (cls.IsTopLevel()) { 2286 if (cls.IsTopLevel()) {
2287 FinalizeClass(cls); 2287 FinalizeClass(cls);
2288 } else { 2288 } else {
2289 // This class should not contain any fields or functions yet, because it has 2289 // This class should not contain any fields or functions yet, because it has
2290 // not been compiled yet. Since 'ResolveAndFinalizeMemberTypes(cls)' has not 2290 // not been compiled yet. Since 'ResolveAndFinalizeMemberTypes(cls)' has not
2291 // been called yet, unfinalized member types could choke the snapshotter. 2291 // been called yet, unfinalized member types could choke the snapshotter.
2292 ASSERT(Array::Handle(cls.fields()).Length() == 0);
rmacnak 2014/05/08 01:35:21 This assert no longer holds because we can have me
2293 ASSERT(Array::Handle(cls.functions()).Length() == 0); 2292 ASSERT(Array::Handle(cls.functions()).Length() == 0);
2294 } 2293 }
2295 } 2294 }
2296 2295
2297 2296
2298 void ClassFinalizer::FinalizeClass(const Class& cls) { 2297 void ClassFinalizer::FinalizeClass(const Class& cls) {
2299 HANDLESCOPE(Isolate::Current()); 2298 HANDLESCOPE(Isolate::Current());
2300 if (cls.is_finalized()) { 2299 if (cls.is_finalized()) {
2301 return; 2300 return;
2302 } 2301 }
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
3072 expected_name ^= String::New("_offset"); 3071 expected_name ^= String::New("_offset");
3073 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); 3072 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name));
3074 field ^= fields_array.At(2); 3073 field ^= fields_array.At(2);
3075 ASSERT(field.Offset() == TypedDataView::length_offset()); 3074 ASSERT(field.Offset() == TypedDataView::length_offset());
3076 name ^= field.name(); 3075 name ^= field.name();
3077 ASSERT(name.Equals("length")); 3076 ASSERT(name.Equals("length"));
3078 #endif 3077 #endif
3079 } 3078 }
3080 3079
3081 } // namespace dart 3080 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698