| 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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 os_thread->EnableThreadInterrupts(); | 1334 os_thread->EnableThreadInterrupts(); |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 | 1337 |
| 1338 DART_EXPORT void Dart_ExitIsolate() { | 1338 DART_EXPORT void Dart_ExitIsolate() { |
| 1339 CHECK_ISOLATE(Isolate::Current()); | 1339 CHECK_ISOLATE(Isolate::Current()); |
| 1340 Thread::ExitIsolate(); | 1340 Thread::ExitIsolate(); |
| 1341 } | 1341 } |
| 1342 | 1342 |
| 1343 | 1343 |
| 1344 // TODO(iposva): Remove this API and instead expose the underlying flags. | |
| 1345 DART_EXPORT Dart_Handle Dart_IsolateSetStrictCompilation(bool value) { | |
| 1346 CHECK_ISOLATE(Isolate::Current()); | |
| 1347 Isolate* isolate = Isolate::Current(); | |
| 1348 if (isolate->has_compiled_code()) { | |
| 1349 return Api::NewError( | |
| 1350 "%s expects that the isolate has not yet compiled code.", CURRENT_FUNC); | |
| 1351 } | |
| 1352 if (!value) { | |
| 1353 return Api::NewError( | |
| 1354 "%s expects that the value is set to true only.", CURRENT_FUNC); | |
| 1355 } | |
| 1356 Isolate::Current()->set_strict_compilation(); | |
| 1357 return Api::Null(); | |
| 1358 } | |
| 1359 | |
| 1360 | |
| 1361 static uint8_t* ApiReallocate(uint8_t* ptr, | 1344 static uint8_t* ApiReallocate(uint8_t* ptr, |
| 1362 intptr_t old_size, | 1345 intptr_t old_size, |
| 1363 intptr_t new_size) { | 1346 intptr_t new_size) { |
| 1364 return Api::TopScope(Thread::Current())->zone()->Realloc<uint8_t>( | 1347 return Api::TopScope(Thread::Current())->zone()->Realloc<uint8_t>( |
| 1365 ptr, old_size, new_size); | 1348 ptr, old_size, new_size); |
| 1366 } | 1349 } |
| 1367 | 1350 |
| 1368 | 1351 |
| 1369 DART_EXPORT Dart_Handle Dart_CreateSnapshot( | 1352 DART_EXPORT Dart_Handle Dart_CreateSnapshot( |
| 1370 uint8_t** vm_isolate_snapshot_buffer, | 1353 uint8_t** vm_isolate_snapshot_buffer, |
| (...skipping 4626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5997 return Api::Success(); | 5980 return Api::Success(); |
| 5998 } | 5981 } |
| 5999 #endif // DART_PRECOMPILED | 5982 #endif // DART_PRECOMPILED |
| 6000 | 5983 |
| 6001 | 5984 |
| 6002 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { | 5985 DART_EXPORT bool Dart_IsRunningPrecompiledCode() { |
| 6003 return Dart::IsRunningPrecompiledCode(); | 5986 return Dart::IsRunningPrecompiledCode(); |
| 6004 } | 5987 } |
| 6005 | 5988 |
| 6006 } // namespace dart | 5989 } // namespace dart |
| OLD | NEW |