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

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

Issue 2146713004: More changes to use #ifndef PRODUCT ... #endif explicitly instead of relying on compiler magic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/scavenger.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) 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 112 }
113 113
114 114
115 void ObjectStore::Init(Isolate* isolate) { 115 void ObjectStore::Init(Isolate* isolate) {
116 ASSERT(isolate->object_store() == NULL); 116 ASSERT(isolate->object_store() == NULL);
117 ObjectStore* store = new ObjectStore(); 117 ObjectStore* store = new ObjectStore();
118 isolate->set_object_store(store); 118 isolate->set_object_store(store);
119 } 119 }
120 120
121 121
122 #ifndef PRODUCT
122 void ObjectStore::PrintToJSONObject(JSONObject* jsobj) { 123 void ObjectStore::PrintToJSONObject(JSONObject* jsobj) {
123 if (!FLAG_support_service) { 124 if (!FLAG_support_service) {
124 return; 125 return;
125 } 126 }
126 jsobj->AddProperty("type", "_ObjectStore"); 127 jsobj->AddProperty("type", "_ObjectStore");
127 128
128 { 129 {
129 JSONObject fields(jsobj, "fields"); 130 JSONObject fields(jsobj, "fields");
130 Object& value = Object::Handle(); 131 Object& value = Object::Handle();
131 #define PRINT_OBJECT_STORE_FIELD(type, name) \ 132 #define PRINT_OBJECT_STORE_FIELD(type, name) \
132 value = name; \ 133 value = name; \
133 fields.AddProperty(#name, value); 134 fields.AddProperty(#name, value);
134 OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD); 135 OBJECT_STORE_FIELD_LIST(PRINT_OBJECT_STORE_FIELD);
135 #undef PRINT_OBJECT_STORE_FIELD 136 #undef PRINT_OBJECT_STORE_FIELD
136 } 137 }
137 } 138 }
139 #endif // !PRODUCT
138 140
139 141
140 RawError* ObjectStore::PreallocateObjects() { 142 RawError* ObjectStore::PreallocateObjects() {
141 Thread* thread = Thread::Current(); 143 Thread* thread = Thread::Current();
142 Isolate* isolate = thread->isolate(); 144 Isolate* isolate = thread->isolate();
143 Zone* zone = thread->zone(); 145 Zone* zone = thread->zone();
144 ASSERT(isolate != NULL && isolate->object_store() == this); 146 ASSERT(isolate != NULL && isolate->object_store() == this);
145 if (this->stack_overflow() != Instance::null()) { 147 if (this->stack_overflow() != Instance::null()) {
146 ASSERT(this->out_of_memory() != Instance::null()); 148 ASSERT(this->out_of_memory() != Instance::null());
147 ASSERT(this->preallocated_stack_trace() != Stacktrace::null()); 149 ASSERT(this->preallocated_stack_trace() != Stacktrace::null());
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 ASSERT(!cls.IsNull()); 226 ASSERT(!cls.IsNull());
225 set_stream_iterator_class(cls); 227 set_stream_iterator_class(cls);
226 228
227 const Library& internal_lib = Library::Handle(internal_library()); 229 const Library& internal_lib = Library::Handle(internal_library());
228 cls = internal_lib.LookupClass(Symbols::Symbol()); 230 cls = internal_lib.LookupClass(Symbols::Symbol());
229 set_symbol_class(cls); 231 set_symbol_class(cls);
230 #endif 232 #endif
231 } 233 }
232 234
233 } // namespace dart 235 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object_store.h ('k') | runtime/vm/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698