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

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

Issue 1569833003: Adds strict compilation flags to Dart_IsolateFlags (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('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 "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
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
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
OLDNEW
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698