/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Set the FFI handle for the given object. * * @param self the object * @param self the object's FFI handle */ public final void setFFIHandle(RubyBasicObject self, Object value) { int index = getFFIHandleAccessorForWrite().getIndex(); setVariableInternal(realClass, self, index, value); }
/** * Set the C ext handle for the given object. * * @param self the object * @param value the object's C ext handle */ public final void setNativeHandle(RubyBasicObject self, Object value) { int index = getNativeHandleAccessorForRead().getIndex(); if(index == -1) { return; } setVariableInternal(realClass, self, index, value); }
/** * Set the C ext handle for the given object. * * @param self the object * @param value the object's C ext handle */ public final void setNativeHandle(RubyBasicObject self, Object value) { int index = getNativeHandleAccessorForRead().getIndex(); if(index == -1) { return; } setVariableInternal(realClass, self, index, value); }
/** * We lazily stand up the object ID since it forces us to stand up * per-object state for a given object. We also check for ObjectSpace here, * and normally we do not register a given object ID into ObjectSpace due * to the high cost associated with constructing the related weakref. Most * uses of id/object_id will only ever need it to be a unique identifier, * and the id2ref behavior provided by ObjectSpace is considered internal * and not generally supported. * * @param objectIdAccessor The variable accessor to use for storing the * generated object ID * @return The generated object ID */ protected synchronized long initObjectId(RubyBasicObject self, VariableAccessor objectIdAccessor) { Ruby runtime = self.getRuntime(); long id; if (runtime.isObjectSpaceEnabled()) { id = runtime.getObjectSpace().createAndRegisterObjectId(self); } else { id = ObjectSpace.calculateObjectId(self); } // we use a direct path here to avoid frozen checks setObjectId(realClass, self, objectIdAccessor.getIndex(), id); return id; }
setObjectId(realClass, self, objectIdAccessor.getIndex(), id);
setObjectId(realClass, self, objectIdAccessor.getIndex(), id);
setObjectId(realClass, self, objectIdAccessor.getIndex(), id);
setValue = insertArguments(setValue, 1, accessor.getIndex());
setValue = insertArguments(setValue, 1, accessor.getIndex());
getValue = insertArguments(getValue, 1, accessor.getIndex()); getValue = filterReturnValue(getValue, nullToNil);
getValue = insertArguments(getValue, 1, accessor.getIndex()); getValue = filterReturnValue(getValue, nullToNil);
.permute(2, 3) .filterReturn(filter) .insert(1, cls.getRealClass(), accessor.getIndex()) .cast(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class) .invokeStaticQuiet(lookup(), accessor.getClass(), "setVariableChecked");
.permute(2, 3) .filterReturn(filter) .insert(1, cls.getRealClass(), accessor.getIndex()) .cast(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class) .invokeStaticQuiet(lookup(), accessor.getClass(), "setVariableChecked");
.permute(2) .filterReturn(filter) .insert(1, accessor.getIndex()) .cast(Object.class, RubyBasicObject.class, int.class) .invokeStaticQuiet(lookup(), VariableAccessor.class, "getVariable");
.permute(2) .filterReturn(filter) .insert(1, accessor.getIndex()) .cast(Object.class, RubyBasicObject.class, int.class) .invokeStaticQuiet(lookup(), VariableAccessor.class, "getVariable");
setValue = findStatic(accessor.getClass(), "setVariableChecked", methodType(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class)); setValue = explicitCastArguments(setValue, methodType(void.class, IRubyObject.class, RubyClass.class, int.class, IRubyObject.class)); setValue = insertArguments(setValue, 1, realClass, accessor.getIndex());
setValue = findStatic(accessor.getClass(), "setVariableChecked", methodType(void.class, RubyBasicObject.class, RubyClass.class, int.class, Object.class)); setValue = explicitCastArguments(setValue, methodType(void.class, IRubyObject.class, RubyClass.class, int.class, IRubyObject.class)); setValue = insertArguments(setValue, 1, realClass, accessor.getIndex());