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

Side by Side Diff: vm/dart_api_impl.cc

Issue 10196003: Dart_IsSame -> Dart_IdentityEquals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 | « include/dart_api.h ('k') | vm/dart_api_impl_test.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 Instance& receiver = Instance::Handle(isolate); 389 Instance& receiver = Instance::Handle(isolate);
390 receiver ^= obj.raw(); 390 receiver ^= obj.raw();
391 return Api::NewHandle(isolate, DartLibraryCalls::ToString(receiver)); 391 return Api::NewHandle(isolate, DartLibraryCalls::ToString(receiver));
392 } else { 392 } else {
393 // This is a VM internal object. Call the C++ method of printing. 393 // This is a VM internal object. Call the C++ method of printing.
394 return Api::NewHandle(isolate, String::New(obj.ToCString())); 394 return Api::NewHandle(isolate, String::New(obj.ToCString()));
395 } 395 }
396 } 396 }
397 397
398 398
399 DART_EXPORT Dart_Handle Dart_IsSame(Dart_Handle obj1, Dart_Handle obj2, 399 DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2) {
400 bool* value) {
401 Isolate* isolate = Isolate::Current(); 400 Isolate* isolate = Isolate::Current();
402 DARTSCOPE(isolate); 401 CHECK_ISOLATE(isolate);
403 const Object& expected = Object::Handle(isolate, Api::UnwrapHandle(obj1)); 402 NoGCScope ngc;
404 const Object& actual = Object::Handle(isolate, Api::UnwrapHandle(obj2)); 403 return Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2);
405 *value = (expected.raw() == actual.raw());
406 return Api::Success(isolate);
407 } 404 }
408 405
409 406
410 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object) { 407 DART_EXPORT Dart_Handle Dart_NewPersistentHandle(Dart_Handle object) {
411 Isolate* isolate = Isolate::Current(); 408 Isolate* isolate = Isolate::Current();
412 CHECK_ISOLATE(isolate); 409 CHECK_ISOLATE(isolate);
413 DARTSCOPE_NOCHECKS(isolate); 410 DARTSCOPE_NOCHECKS(isolate);
414 ApiState* state = isolate->api_state(); 411 ApiState* state = isolate->api_state();
415 ASSERT(state != NULL); 412 ASSERT(state != NULL);
416 const Object& old_ref = Object::Handle(isolate, Api::UnwrapHandle(object)); 413 const Object& old_ref = Object::Handle(isolate, Api::UnwrapHandle(object));
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after
3286 *buffer = NULL; 3283 *buffer = NULL;
3287 } 3284 }
3288 delete debug_region; 3285 delete debug_region;
3289 } else { 3286 } else {
3290 *buffer = NULL; 3287 *buffer = NULL;
3291 *buffer_size = 0; 3288 *buffer_size = 0;
3292 } 3289 }
3293 } 3290 }
3294 3291
3295 } // namespace dart 3292 } // namespace dart
OLDNEW
« no previous file with comments | « include/dart_api.h ('k') | vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698