Chromium Code Reviews| 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 "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 return reinterpret_cast<Dart_Handle>(acquired_error_handle); | 533 return reinterpret_cast<Dart_Handle>(acquired_error_handle); |
| 534 } | 534 } |
| 535 | 535 |
| 536 | 536 |
| 537 bool Api::IsValid(Dart_Handle handle) { | 537 bool Api::IsValid(Dart_Handle handle) { |
| 538 Isolate* isolate = Isolate::Current(); | 538 Isolate* isolate = Isolate::Current(); |
| 539 CHECK_ISOLATE(isolate); | 539 CHECK_ISOLATE(isolate); |
| 540 | 540 |
| 541 // Check against all of the handles in the current isolate as well as the | 541 // Check against all of the handles in the current isolate as well as the |
| 542 // read-only handles. | 542 // read-only handles. |
| 543 return isolate->thread_registry()->IsValidHandle(handle) || | 543 return Thread::Current()->IsValidHandle(handle) || |
|
siva
2017/02/02 22:51:13
Maybe you should add an assert here
Thread* thread
bkonyi
2017/02/02 23:08:49
Done.
| |
| 544 isolate->api_state()->IsActivePersistentHandle( | 544 isolate->api_state()->IsActivePersistentHandle( |
| 545 reinterpret_cast<Dart_PersistentHandle>(handle)) || | 545 reinterpret_cast<Dart_PersistentHandle>(handle)) || |
| 546 isolate->api_state()->IsActiveWeakPersistentHandle( | 546 isolate->api_state()->IsActiveWeakPersistentHandle( |
| 547 reinterpret_cast<Dart_WeakPersistentHandle>(handle)) || | 547 reinterpret_cast<Dart_WeakPersistentHandle>(handle)) || |
| 548 Dart::IsReadOnlyApiHandle(handle) || | 548 Dart::IsReadOnlyApiHandle(handle) || |
| 549 Dart::IsReadOnlyHandle(reinterpret_cast<uword>(handle)); | 549 Dart::IsReadOnlyHandle(reinterpret_cast<uword>(handle)); |
| 550 } | 550 } |
| 551 | 551 |
| 552 | 552 |
| 553 ApiLocalScope* Api::TopScope(Thread* thread) { | 553 ApiLocalScope* Api::TopScope(Thread* thread) { |
| (...skipping 6265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6819 } | 6819 } |
| 6820 | 6820 |
| 6821 | 6821 |
| 6822 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { | 6822 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { |
| 6823 #ifndef PRODUCT | 6823 #ifndef PRODUCT |
| 6824 Profiler::DumpStackTrace(context); | 6824 Profiler::DumpStackTrace(context); |
| 6825 #endif | 6825 #endif |
| 6826 } | 6826 } |
| 6827 | 6827 |
| 6828 } // namespace dart | 6828 } // namespace dart |
| OLD | NEW |