OLD | NEW |
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/object_store.h" | 5 #include "vm/object_store.h" |
6 | 6 |
7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 void ObjectStore::Init(Isolate* isolate) { | 116 void ObjectStore::Init(Isolate* isolate) { |
117 ASSERT(isolate->object_store() == NULL); | 117 ASSERT(isolate->object_store() == NULL); |
118 ObjectStore* store = new ObjectStore(); | 118 ObjectStore* store = new ObjectStore(); |
119 isolate->set_object_store(store); | 119 isolate->set_object_store(store); |
120 } | 120 } |
121 | 121 |
122 | 122 |
| 123 void ObjectStore::PrintToJSONObject(JSONObject* jsobj) { |
| 124 if (!FLAG_support_service) { |
| 125 return; |
| 126 } |
| 127 jsobj->AddProperty("type", "_ObjectStore"); |
| 128 |
| 129 { |
| 130 JSONObject fields(jsobj, "fields"); |
| 131 Object& value = Object::Handle(); |
| 132 #define PRINT_OBJECT_STORE_FIELD(type, name) \ |
| 133 value = name; \ |
| 134 fields.AddProperty(#name, value); |
| 135 OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD); |
| 136 #undef PRINT_OBJECT_STORE_FIELD |
| 137 } |
| 138 } |
| 139 |
| 140 |
123 RawError* ObjectStore::PreallocateObjects() { | 141 RawError* ObjectStore::PreallocateObjects() { |
124 Thread* thread = Thread::Current(); | 142 Thread* thread = Thread::Current(); |
125 Isolate* isolate = thread->isolate(); | 143 Isolate* isolate = thread->isolate(); |
126 Zone* zone = thread->zone(); | 144 Zone* zone = thread->zone(); |
127 ASSERT(isolate != NULL && isolate->object_store() == this); | 145 ASSERT(isolate != NULL && isolate->object_store() == this); |
128 if (this->stack_overflow() != Instance::null()) { | 146 if (this->stack_overflow() != Instance::null()) { |
129 ASSERT(this->out_of_memory() != Instance::null()); | 147 ASSERT(this->out_of_memory() != Instance::null()); |
130 ASSERT(this->preallocated_stack_trace() != Stacktrace::null()); | 148 ASSERT(this->preallocated_stack_trace() != Stacktrace::null()); |
131 return Error::null(); | 149 return Error::null(); |
132 } | 150 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ASSERT(!cls.IsNull()); | 225 ASSERT(!cls.IsNull()); |
208 set_stream_iterator_class(cls); | 226 set_stream_iterator_class(cls); |
209 | 227 |
210 const Library& internal_lib = Library::Handle(internal_library()); | 228 const Library& internal_lib = Library::Handle(internal_library()); |
211 cls = internal_lib.LookupClass(Symbols::Symbol()); | 229 cls = internal_lib.LookupClass(Symbols::Symbol()); |
212 set_symbol_class(cls); | 230 set_symbol_class(cls); |
213 #endif | 231 #endif |
214 } | 232 } |
215 | 233 |
216 } // namespace dart | 234 } // namespace dart |
OLD | NEW |