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

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: Fix for issue #28606. Removed loop which iterated over all threads in the thread registry to check … 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/thread_registry.h » ('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 "lib/stacktrace.h" 10 #include "lib/stacktrace.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 ASSERT(isolate != NULL); 529 ASSERT(isolate != NULL);
530 ApiState* state = isolate->api_state(); 530 ApiState* state = isolate->api_state();
531 ASSERT(state != NULL); 531 ASSERT(state != NULL);
532 PersistentHandle* acquired_error_handle = state->AcquiredError(); 532 PersistentHandle* acquired_error_handle = state->AcquiredError();
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 Thread* thread = Thread::Current();
540 ASSERT(thread->IsMutatorThread());
539 CHECK_ISOLATE(isolate); 541 CHECK_ISOLATE(isolate);
540 542
541 // Check against all of the handles in the current isolate as well as the 543 // Check against all of the handles in the current isolate as well as the
542 // read-only handles. 544 // read-only handles.
543 return isolate->thread_registry()->IsValidHandle(handle) || 545 return thread->IsValidHandle(handle) ||
544 isolate->api_state()->IsActivePersistentHandle( 546 isolate->api_state()->IsActivePersistentHandle(
545 reinterpret_cast<Dart_PersistentHandle>(handle)) || 547 reinterpret_cast<Dart_PersistentHandle>(handle)) ||
546 isolate->api_state()->IsActiveWeakPersistentHandle( 548 isolate->api_state()->IsActiveWeakPersistentHandle(
547 reinterpret_cast<Dart_WeakPersistentHandle>(handle)) || 549 reinterpret_cast<Dart_WeakPersistentHandle>(handle)) ||
548 Dart::IsReadOnlyApiHandle(handle) || 550 Dart::IsReadOnlyApiHandle(handle) ||
549 Dart::IsReadOnlyHandle(reinterpret_cast<uword>(handle)); 551 Dart::IsReadOnlyHandle(reinterpret_cast<uword>(handle));
550 } 552 }
551 553
552 554
553 ApiLocalScope* Api::TopScope(Thread* thread) { 555 ApiLocalScope* Api::TopScope(Thread* thread) {
(...skipping 6265 matching lines...) Expand 10 before | Expand all | Expand 10 after
6819 } 6821 }
6820 6822
6821 6823
6822 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) { 6824 DART_EXPORT void Dart_DumpNativeStackTrace(void* context) {
6823 #ifndef PRODUCT 6825 #ifndef PRODUCT
6824 Profiler::DumpStackTrace(context); 6826 Profiler::DumpStackTrace(context);
6825 #endif 6827 #endif
6826 } 6828 }
6827 6829
6828 } // namespace dart 6830 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/thread_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698