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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 177093010: Use a tag bit for indicating prologue weak persistent handles, this avoids (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
===================================================================
--- runtime/vm/dart_api_impl_test.cc (revision 33249)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -1842,22 +1842,22 @@
HANDLESCOPE(isolate);
for (int i = 0; i < 500; i++) {
String& str = String::Handle();
- str ^= Api::UnwrapAsPersistentHandle(handles[i])->raw();
+ str ^= PersistentHandle::Cast(handles[i])->raw();
EXPECT(str.Equals(kTestString1));
}
for (int i = 500; i < 1000; i++) {
String& str = String::Handle();
- str ^= Api::UnwrapAsPersistentHandle(handles[i])->raw();
+ str ^= PersistentHandle::Cast(handles[i])->raw();
EXPECT(str.Equals(kTestString2));
}
for (int i = 1000; i < 1500; i++) {
String& str = String::Handle();
- str ^= Api::UnwrapAsPersistentHandle(handles[i])->raw();
+ str ^= PersistentHandle::Cast(handles[i])->raw();
EXPECT(str.Equals(kTestString1));
}
for (int i = 1500; i < 2000; i++) {
String& str = String::Handle();
- str ^= Api::UnwrapAsPersistentHandle(handles[i])->raw();
+ str ^= PersistentHandle::Cast(handles[i])->raw();
EXPECT(str.Equals(kTestString2));
}
}
@@ -1914,13 +1914,13 @@
Dart_Handle ref1 = Api::NewHandle(isolate, String::New(kTestString1));
Dart_PersistentHandle obj = Dart_NewPersistentHandle(ref1);
EXPECT(state->IsValidPersistentHandle(obj));
- str ^= Api::UnwrapAsPersistentHandle(obj)->raw();
+ str ^= PersistentHandle::Cast(obj)->raw();
EXPECT(str.Equals(kTestString1));
// Now create another local handle and assign it to the persistent handle.
Dart_Handle ref2 = Api::NewHandle(isolate, String::New(kTestString2));
Dart_SetPersistentHandle(obj, ref2);
- str ^= Api::UnwrapAsPersistentHandle(obj)->raw();
+ str ^= PersistentHandle::Cast(obj)->raw();
EXPECT(str.Equals(kTestString2));
// Now assign Null to the persistent handle and check.
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/dart_api_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698