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

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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('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/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 // TODO(regis): Replace assert below with ASSERT(id() != kDartObjectCid).
1865 ASSERT(!IsObjectClass());
1866 GrowableObjectArray& direct_subclasses =
1867 GrowableObjectArray::Handle(raw_ptr()->direct_subclasses_);
1868 if (direct_subclasses.IsNull()) {
1869 direct_subclasses = GrowableObjectArray::New(4, Heap::kOld);
1870 StorePointer(&raw_ptr()->direct_subclasses_, direct_subclasses.raw());
1871 }
1872 #if defined(DEBUG)
1873 // Verify that the same class is not added twice.
1874 for (intptr_t i = 0; i < direct_subclasses.Length(); i++) {
1875 ASSERT(direct_subclasses.At(i) != subclass.raw());
1876 }
1877 #endif
1878 direct_subclasses.Add(subclass);
1879 }
1880
1881
1860 RawArray* Class::constants() const { 1882 RawArray* Class::constants() const {
1861 return raw_ptr()->constants_; 1883 return raw_ptr()->constants_;
1862 } 1884 }
1863 1885
1864 void Class::set_constants(const Array& value) const { 1886 void Class::set_constants(const Array& value) const {
1865 ASSERT(!value.IsNull()); 1887 ASSERT(!value.IsNull());
1866 StorePointer(&raw_ptr()->constants_, value.raw()); 1888 StorePointer(&raw_ptr()->constants_, value.raw());
1867 } 1889 }
1868 1890
1869 1891
(...skipping 9257 matching lines...) Expand 10 before | Expand all | Expand 10 after
11127 } 11149 }
11128 return result.raw(); 11150 return result.raw();
11129 } 11151 }
11130 11152
11131 11153
11132 const char* WeakProperty::ToCString() const { 11154 const char* WeakProperty::ToCString() const {
11133 return "WeakProperty"; 11155 return "WeakProperty";
11134 } 11156 }
11135 11157
11136 } // namespace dart 11158 } // namespace dart
OLDNEW
« no previous file with comments | « 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