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

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

Issue 10828399: Implement class hierarchy analysis in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 } 1850 }
1851 1851
1852 1852
1853 void Class::set_interfaces(const Array& value) const { 1853 void Class::set_interfaces(const Array& value) const {
1854 // Verification and resolving of interfaces occurs in finalizer. 1854 // Verification and resolving of interfaces occurs in finalizer.
1855 ASSERT(!value.IsNull()); 1855 ASSERT(!value.IsNull());
1856 StorePointer(&raw_ptr()->interfaces_, value.raw()); 1856 StorePointer(&raw_ptr()->interfaces_, value.raw());
1857 } 1857 }
1858 1858
1859 1859
1860 void Class::AddDirectSubclass(const Class& subclass) const {
1861 ASSERT(!subclass.IsNull());
1862 ASSERT(subclass.SuperClass() == raw());
1863 // Do not keep track of the direct subclasses of class Object.
1864 ASSERT(id() != kObjectCid);
srdjan 2012/08/20 22:47:16 AS discussed need a different cid.
regis 2012/08/20 23:37:21 Changed assert and added TODO.
1865 GrowableObjectArray& direct_subclasses =
1866 GrowableObjectArray::Handle(raw_ptr()->direct_subclasses_);
1867 if (direct_subclasses.IsNull()) {
1868 direct_subclasses = GrowableObjectArray::New(4, Heap::kOld);
1869 StorePointer(&raw_ptr()->direct_subclasses_, direct_subclasses.raw());
1870 }
1871 #if defined(DEBUG)
1872 // Verify that the same class is not added twice.
1873 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) {
1874 ASSERT(direct_subclasses.At(i) != subclass.raw());
1875 }
1876 #endif
1877 direct_subclasses.Add(subclass);
1878 }
1879
1880
1860 RawArray* Class::constants() const { 1881 RawArray* Class::constants() const {
1861 return raw_ptr()->constants_; 1882 return raw_ptr()->constants_;
1862 } 1883 }
1863 1884
1864 void Class::set_constants(const Array& value) const { 1885 void Class::set_constants(const Array& value) const {
1865 ASSERT(!value.IsNull()); 1886 ASSERT(!value.IsNull());
1866 StorePointer(&raw_ptr()->constants_, value.raw()); 1887 StorePointer(&raw_ptr()->constants_, value.raw());
1867 } 1888 }
1868 1889
1869 1890
(...skipping 9257 matching lines...) Expand 10 before | Expand all | Expand 10 after
11127 } 11148 }
11128 return result.raw(); 11149 return result.raw();
11129 } 11150 }
11130 11151
11131 11152
11132 const char* WeakProperty::ToCString() const { 11153 const char* WeakProperty::ToCString() const {
11133 return "WeakProperty"; 11154 return "WeakProperty";
11134 } 11155 }
11135 11156
11136 } // namespace dart 11157 } // namespace dart
OLDNEW
« runtime/vm/class_table.cc ('K') | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698