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

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

Issue 2672833003: Fix for issue #28606. Removed loop which iterated over all threads in the thread registry to check … (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | runtime/vm/dart_api_state.h » ('j') | runtime/vm/dart_api_state.h » ('J')
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 "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) ||
bkonyi 2017/02/02 22:22:34 I wasn't able to reproduce the issue described in
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
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
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_state.h » ('j') | runtime/vm/dart_api_state.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698