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

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

Issue 1173293007: Fix --verify_handles mode by properly checking for the static API handles. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/vm/dart.cc ('k') | no next file » | 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 370
371 RawObject* Api::UnwrapHandle(Dart_Handle object) { 371 RawObject* Api::UnwrapHandle(Dart_Handle object) {
372 #if defined(DEBUG) 372 #if defined(DEBUG)
373 Isolate* isolate = Isolate::Current(); 373 Isolate* isolate = Isolate::Current();
374 ASSERT(isolate != NULL); 374 ASSERT(isolate != NULL);
375 ApiState* state = isolate->api_state(); 375 ApiState* state = isolate->api_state();
376 ASSERT(state != NULL); 376 ASSERT(state != NULL);
377 ASSERT(!FLAG_verify_handles || 377 ASSERT(!FLAG_verify_handles ||
378 state->IsValidLocalHandle(object) || 378 state->IsValidLocalHandle(object) ||
379 Dart::vm_isolate()->api_state()->IsValidLocalHandle(object)); 379 Dart::IsReadOnlyApiHandle(object));
380 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 && 380 ASSERT(FinalizablePersistentHandle::raw_offset() == 0 &&
381 PersistentHandle::raw_offset() == 0 && 381 PersistentHandle::raw_offset() == 0 &&
382 LocalHandle::raw_offset() == 0); 382 LocalHandle::raw_offset() == 0);
383 #endif 383 #endif
384 return (reinterpret_cast<LocalHandle*>(object))->raw(); 384 return (reinterpret_cast<LocalHandle*>(object))->raw();
385 } 385 }
386 386
387 387
388 #define DEFINE_UNWRAP(type) \ 388 #define DEFINE_UNWRAP(type) \
389 const type& Api::Unwrap##type##Handle(Isolate* iso, \ 389 const type& Api::Unwrap##type##Handle(Isolate* iso, \
(...skipping 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after
5781 ASSERT(stream != NULL); 5781 ASSERT(stream != NULL);
5782 TimelineEvent* event = stream->StartEvent(); 5782 TimelineEvent* event = stream->StartEvent();
5783 if (event != NULL) { 5783 if (event != NULL) {
5784 event->AsyncEnd(label, async_id); 5784 event->AsyncEnd(label, async_id);
5785 event->Complete(); 5785 event->Complete();
5786 } 5786 }
5787 return Api::Success(); 5787 return Api::Success();
5788 } 5788 }
5789 5789
5790 } // namespace dart 5790 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698