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

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

Issue 23537051: Use CHECK_ISOLATE instead of the more heavy DARTSCOPE for (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 Isolate* isolate = Isolate::Current(); 498 Isolate* isolate = Isolate::Current();
499 CHECK_ISOLATE(isolate); 499 CHECK_ISOLATE(isolate);
500 NoGCScope ngc; 500 NoGCScope ngc;
501 return Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2); 501 return Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2);
502 } 502 }
503 503
504 504
505 DART_EXPORT Dart_Handle Dart_HandleFromPersistent( 505 DART_EXPORT Dart_Handle Dart_HandleFromPersistent(
506 Dart_PersistentHandle object) { 506 Dart_PersistentHandle object) {
507 Isolate* isolate = Isolate::Current(); 507 Isolate* isolate = Isolate::Current();
508 DARTSCOPE(isolate); 508 CHECK_ISOLATE(isolate);
509 ApiState* state = isolate->api_state(); 509 ApiState* state = isolate->api_state();
510 ASSERT(state != NULL); 510 ASSERT(state != NULL);
511 ASSERT(state->IsValidPersistentHandle(object)); 511 ASSERT(state->IsValidPersistentHandle(object));
512 return Api::NewHandle(isolate, 512 return Api::NewHandle(isolate,
513 reinterpret_cast<PersistentHandle*>(object)->raw()); 513 reinterpret_cast<PersistentHandle*>(object)->raw());
514 } 514 }
515 515
516 516
517 DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent( 517 DART_EXPORT Dart_Handle Dart_HandleFromWeakPersistent(
518 Dart_WeakPersistentHandle object) { 518 Dart_WeakPersistentHandle object) {
519 Isolate* isolate = Isolate::Current(); 519 Isolate* isolate = Isolate::Current();
520 DARTSCOPE(isolate); 520 CHECK_ISOLATE(isolate);
521 ApiState* state = isolate->api_state(); 521 ApiState* state = isolate->api_state();
522 ASSERT(state != NULL); 522 ASSERT(state != NULL);
523 ASSERT(state->IsValidWeakPersistentHandle(object) || 523 ASSERT(state->IsValidWeakPersistentHandle(object) ||
524 state->IsValidPrologueWeakPersistentHandle(object)); 524 state->IsValidPrologueWeakPersistentHandle(object));
525 return Api::NewHandle( 525 return Api::NewHandle(
526 isolate, reinterpret_cast<FinalizablePersistentHandle*>(object)->raw()); 526 isolate, reinterpret_cast<FinalizablePersistentHandle*>(object)->raw());
527 } 527 }
528 528
529 529
530 DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object) { 530 DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object) {
(...skipping 3806 matching lines...) Expand 10 before | Expand all | Expand 10 after
4337 } 4337 }
4338 { 4338 {
4339 NoGCScope no_gc; 4339 NoGCScope no_gc;
4340 RawObject* raw_obj = obj.raw(); 4340 RawObject* raw_obj = obj.raw();
4341 isolate->heap()->SetPeer(raw_obj, peer); 4341 isolate->heap()->SetPeer(raw_obj, peer);
4342 } 4342 }
4343 return Api::Success(); 4343 return Api::Success();
4344 } 4344 }
4345 4345
4346 } // namespace dart 4346 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698