jitcraft/Code.h
changeset 44 c920f9328716
parent 34 9aafaf3797e6
child 47 050939c6181e
     1.1 --- a/jitcraft/Code.h	Tue Jul 03 01:25:23 2012 -0700
     1.2 +++ b/jitcraft/Code.h	Tue Jul 03 08:30:09 2012 -0700
     1.3 @@ -69,6 +69,21 @@
     1.4          return objects_->at(index);
     1.5      }
     1.6  
     1.7 +    // GC Descriptor.
     1.8 +    static inline size_t offsetOfModule() {
     1.9 +        return offsetof(Code, module_);
    1.10 +    }
    1.11 +    static inline size_t offsetOfBytecode() {
    1.12 +        return offsetof(Code, bytecode_);
    1.13 +    }
    1.14 +    static inline size_t offsetOfLocals() {
    1.15 +        return offsetof(Code, locals_);
    1.16 +    }
    1.17 +    static inline size_t offsetOfObjects() {
    1.18 +        return offsetof(Code, objects_);
    1.19 +    }
    1.20 +    // End GC Descriptor.
    1.21 +
    1.22      static Code *cast(Object *obj) {
    1.23          assert(!obj || obj->is(MapKind_Code));
    1.24          return reinterpret_cast<Code *>(obj);