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

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

Issue 17066009: Preallocate objects in Dart::InitializeIsolate not in Api::CheckIsolateState (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | 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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "include/dart_mirrors_api.h" 6 #include "include/dart_mirrors_api.h"
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 8
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 object)); 130 object));
131 return reinterpret_cast<FinalizablePersistentHandle*>(object); 131 return reinterpret_cast<FinalizablePersistentHandle*>(object);
132 } 132 }
133 133
134 134
135 Dart_Handle Api::CheckIsolateState(Isolate* isolate) { 135 Dart_Handle Api::CheckIsolateState(Isolate* isolate) {
136 if (!isolate->AllowClassFinalization()) { 136 if (!isolate->AllowClassFinalization()) {
137 // Class finalization is blocked for the isolate. Do nothing. 137 // Class finalization is blocked for the isolate. Do nothing.
138 return Api::Success(); 138 return Api::Success();
139 } 139 }
140 if (ClassFinalizer::FinalizePendingClasses() && 140 if (ClassFinalizer::FinalizePendingClasses()) {
141 isolate->object_store()->PreallocateObjects()) {
142 return Api::Success(); 141 return Api::Success();
143 } 142 }
144 ASSERT(isolate->object_store()->sticky_error() != Object::null()); 143 ASSERT(isolate->object_store()->sticky_error() != Object::null());
145 return Api::NewHandle(isolate, isolate->object_store()->sticky_error()); 144 return Api::NewHandle(isolate, isolate->object_store()->sticky_error());
146 } 145 }
147 146
148 147
149 Dart_Isolate Api::CastIsolate(Isolate* isolate) { 148 Dart_Isolate Api::CastIsolate(Isolate* isolate) {
150 return reinterpret_cast<Dart_Isolate>(isolate); 149 return reinterpret_cast<Dart_Isolate>(isolate);
151 } 150 }
(...skipping 3834 matching lines...) Expand 10 before | Expand all | Expand 10 after
3986 } 3985 }
3987 { 3986 {
3988 NoGCScope no_gc; 3987 NoGCScope no_gc;
3989 RawObject* raw_obj = obj.raw(); 3988 RawObject* raw_obj = obj.raw();
3990 isolate->heap()->SetPeer(raw_obj, peer); 3989 isolate->heap()->SetPeer(raw_obj, peer);
3991 } 3990 }
3992 return Api::Success(); 3991 return Api::Success();
3993 } 3992 }
3994 3993
3995 } // namespace dart 3994 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698