| Index: runtime/vm/object.h
|
| ===================================================================
|
| --- runtime/vm/object.h (revision 38347)
|
| +++ runtime/vm/object.h (working copy)
|
| @@ -4344,6 +4344,7 @@
|
|
|
| // TODO(iposva): Determine if this gets in the way of Smi.
|
| HEAP_OBJECT_IMPLEMENTATION(Instance, Object);
|
| + friend class ByteBuffer;
|
| friend class Class;
|
| friend class Closure;
|
| friend class DeferredObject;
|
| @@ -6720,6 +6721,28 @@
|
| };
|
|
|
|
|
| +class ByteBuffer : public AllStatic {
|
| + public:
|
| + static RawInstance* Data(const Instance& view_obj) {
|
| + ASSERT(!view_obj.IsNull());
|
| + return *reinterpret_cast<RawInstance**>(view_obj.raw_ptr() + kDataOffset);
|
| + }
|
| +
|
| + static intptr_t NumberOfFields() {
|
| + return kDataOffset;
|
| + }
|
| +
|
| + static intptr_t data_offset() {
|
| + return kWordSize * kDataOffset;
|
| + }
|
| +
|
| + private:
|
| + enum {
|
| + kDataOffset = 1,
|
| + };
|
| +};
|
| +
|
| +
|
| class Closure : public AllStatic {
|
| public:
|
| static RawFunction* function(const Instance& closure) {
|
|
|