| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |