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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 11312183: - Do not mix scalar values and object fields in RawInstance to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/object.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 14777)
+++ runtime/vm/dart_api_impl_test.cc (working copy)
@@ -2909,15 +2909,16 @@
obj ^= Api::UnwrapHandle(result);
const Class& cls = Class::Handle(obj.clazz());
// We expect the newly created "NativeFields" object to have
- // 2 dart instance fields (fld1, fld2) and kNumNativeFields native fields.
+ // 2 dart instance fields (fld1, fld2) and a reference to the native fields.
// Hence the size of an instance of "NativeFields" should be
- // (kNumNativeFields + 2) * kWordSize + size of object header.
+ // (1 + 2) * kWordSize + size of object header.
// We check to make sure the instance size computed by the VM matches
// our expectations.
intptr_t header_size = sizeof(RawObject);
- EXPECT_EQ(Utils::RoundUp(((kNumNativeFields + 2) * kWordSize) + header_size,
+ EXPECT_EQ(Utils::RoundUp(((1 + 2) * kWordSize) + header_size,
kObjectAlignment),
cls.instance_size());
+ EXPECT_EQ(kNumNativeFields, cls.num_native_fields());
}
@@ -2977,15 +2978,16 @@
obj ^= Api::UnwrapHandle(result);
const Class& cls = Class::Handle(obj.clazz());
// We expect the newly created "NativeFields" object to have
- // 2 dart instance fields (fld1, fld2) and kNumNativeFields native fields.
+ // 2 dart instance fields (fld1, fld2) and a reference to the native fields.
// Hence the size of an instance of "NativeFields" should be
- // (kNumNativeFields + 2) * kWordSize + size of object header.
+ // (1 + 2) * kWordSize + size of object header.
// We check to make sure the instance size computed by the VM matches
// our expectations.
intptr_t header_size = sizeof(RawObject);
- EXPECT_EQ(Utils::RoundUp(((kNumNativeFields + 2) * kWordSize) + header_size,
+ EXPECT_EQ(Utils::RoundUp(((1 + 2) * kWordSize) + header_size,
kObjectAlignment),
cls.instance_size());
+ EXPECT_EQ(kNumNativeFields, cls.num_native_fields());
}
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698