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

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

Issue 22638011: Move Null class out of the VM isolate. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | runtime/vm/object.cc » ('J')
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/class_table.h" 5 #include "vm/class_table.h"
6 #include "vm/flags.h" 6 #include "vm/flags.h"
7 #include "vm/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/raw_object.h" 9 #include "vm/raw_object.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 11 matching lines...) Expand all
22 } else { 22 } else {
23 // Duplicate the class table from the VM isolate. 23 // Duplicate the class table from the VM isolate.
24 ClassTable* vm_class_table = Dart::vm_isolate()->class_table(); 24 ClassTable* vm_class_table = Dart::vm_isolate()->class_table();
25 capacity_ = vm_class_table->capacity_; 25 capacity_ = vm_class_table->capacity_;
26 table_ = reinterpret_cast<RawClass**>( 26 table_ = reinterpret_cast<RawClass**>(
27 calloc(capacity_, sizeof(RawClass*))); // NOLINT 27 calloc(capacity_, sizeof(RawClass*))); // NOLINT
28 for (intptr_t i = kObjectCid; i < kInstanceCid; i++) { 28 for (intptr_t i = kObjectCid; i < kInstanceCid; i++) {
29 table_[i] = vm_class_table->At(i); 29 table_[i] = vm_class_table->At(i);
30 } 30 }
31 table_[kFreeListElement] = vm_class_table->At(kFreeListElement); 31 table_[kFreeListElement] = vm_class_table->At(kFreeListElement);
32 table_[kNullCid] = vm_class_table->At(kNullCid);
33 table_[kDynamicCid] = vm_class_table->At(kDynamicCid); 32 table_[kDynamicCid] = vm_class_table->At(kDynamicCid);
34 table_[kVoidCid] = vm_class_table->At(kVoidCid); 33 table_[kVoidCid] = vm_class_table->At(kVoidCid);
35 } 34 }
36 } 35 }
37 36
38 37
39 ClassTable::~ClassTable() { 38 ClassTable::~ClassTable() {
40 free(table_); 39 free(table_);
41 } 40 }
42 41
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 for (intptr_t i = 1; i < top_; i++) { 89 for (intptr_t i = 1; i < top_; i++) {
91 cls = At(i); 90 cls = At(i);
92 if (cls.raw() != reinterpret_cast<RawClass*>(0)) { 91 if (cls.raw() != reinterpret_cast<RawClass*>(0)) {
93 name = cls.Name(); 92 name = cls.Name();
94 OS::Print("%"Pd": %s\n", i, name.ToCString()); 93 OS::Print("%"Pd": %s\n", i, name.ToCString());
95 } 94 }
96 } 95 }
97 } 96 }
98 97
99 } // namespace dart 98 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl_test.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698