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, bool ref) { |
| 124 if (!FLAG_support_service) { |
| 125 return; |
| 126 } |
| 127 jsobj->AddProperty("type", (ref ? "@_ObjectStore" : "_ObjectStore")); |
| 128 jsobj->AddFixedServiceId("object_store"); |
| 129 |
| 130 { |
| 131 JSONObject fields(jsobj, "fields"); |
| 132 Object& value = Object::Handle(); |
| 133 #define PRINT_OBJECT_STORE_FIELD(type, name) \ |
| 134 value = name; \ |
| 135 fields.AddProperty(#name, value); |
| 136 OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD); |
| 137 #undef PRINT_OBJECT_STORE_FIELD |
| 138 } |
| 139 } |
| 140 |
| 141 |
123 RawError* ObjectStore::PreallocateObjects() { | 142 RawError* ObjectStore::PreallocateObjects() { |
124 Thread* thread = Thread::Current(); | 143 Thread* thread = Thread::Current(); |
125 Isolate* isolate = thread->isolate(); | 144 Isolate* isolate = thread->isolate(); |
126 Zone* zone = thread->zone(); | 145 Zone* zone = thread->zone(); |
127 ASSERT(isolate != NULL && isolate->object_store() == this); | 146 ASSERT(isolate != NULL && isolate->object_store() == this); |
128 if (this->stack_overflow() != Instance::null()) { | 147 if (this->stack_overflow() != Instance::null()) { |
129 ASSERT(this->out_of_memory() != Instance::null()); | 148 ASSERT(this->out_of_memory() != Instance::null()); |
130 ASSERT(this->preallocated_stack_trace() != Stacktrace::null()); | 149 ASSERT(this->preallocated_stack_trace() != Stacktrace::null()); |
131 return Error::null(); | 150 return Error::null(); |
132 } | 151 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 ASSERT(!cls.IsNull()); | 226 ASSERT(!cls.IsNull()); |
208 set_stream_iterator_class(cls); | 227 set_stream_iterator_class(cls); |
209 | 228 |
210 const Library& internal_lib = Library::Handle(internal_library()); | 229 const Library& internal_lib = Library::Handle(internal_library()); |
211 cls = internal_lib.LookupClass(Symbols::Symbol()); | 230 cls = internal_lib.LookupClass(Symbols::Symbol()); |
212 set_symbol_class(cls); | 231 set_symbol_class(cls); |
213 #endif | 232 #endif |
214 } | 233 } |
215 | 234 |
216 } // namespace dart | 235 } // namespace dart |
OLD | NEW |