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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 DARTSCOPE(isolate); | 1435 DARTSCOPE(isolate); |
1436 return Api::NewHandle(isolate, String::New(isolate->name())); | 1436 return Api::NewHandle(isolate, String::New(isolate->name())); |
1437 } | 1437 } |
1438 | 1438 |
1439 | 1439 |
1440 | 1440 |
1441 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) { | 1441 DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) { |
1442 CHECK_NO_ISOLATE(Isolate::Current()); | 1442 CHECK_NO_ISOLATE(Isolate::Current()); |
1443 // TODO(16615): Validate isolate parameter. | 1443 // TODO(16615): Validate isolate parameter. |
1444 Isolate* iso = reinterpret_cast<Isolate*>(isolate); | 1444 Isolate* iso = reinterpret_cast<Isolate*>(isolate); |
1445 if (iso->mutator_thread() != NULL) { | 1445 if (iso->HasMutatorThread()) { |
1446 FATAL("Multiple mutators within one isolate is not supported."); | 1446 FATAL("Multiple mutators within one isolate is not supported."); |
1447 } | 1447 } |
1448 Thread::EnsureInit(); | 1448 Thread::EnsureInit(); |
1449 Thread::EnterIsolate(iso); | 1449 Thread::EnterIsolate(iso); |
1450 } | 1450 } |
1451 | 1451 |
1452 | 1452 |
1453 DART_EXPORT void Dart_IsolateBlocked() { | 1453 DART_EXPORT void Dart_IsolateBlocked() { |
1454 Isolate* isolate = Isolate::Current(); | 1454 Isolate* isolate = Isolate::Current(); |
1455 CHECK_ISOLATE(isolate); | 1455 CHECK_ISOLATE(isolate); |
(...skipping 4404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5860 ASSERT(stream != NULL); | 5860 ASSERT(stream != NULL); |
5861 TimelineEvent* event = stream->StartEvent(); | 5861 TimelineEvent* event = stream->StartEvent(); |
5862 if (event != NULL) { | 5862 if (event != NULL) { |
5863 event->AsyncEnd(label, async_id); | 5863 event->AsyncEnd(label, async_id); |
5864 event->Complete(); | 5864 event->Complete(); |
5865 } | 5865 } |
5866 return Api::Success(); | 5866 return Api::Success(); |
5867 } | 5867 } |
5868 | 5868 |
5869 } // namespace dart | 5869 } // namespace dart |
OLD | NEW |