public class RubyClass extends RubyModule
| Modifier and Type | Class and Description |
|---|---|
private static class |
RubyClass.MarshalTuple
A tuple representing the mechanism by which objects should be marshaled.
|
private static class |
RubyClass.MarshalType
An enum defining the type of marshaling a given class's objects employ.
|
RubyModule.CacheEntryFactory, RubyModule.ConstantEntry, RubyModule.JavaClassKindOf, RubyModule.KindOf, RubyModule.MethodClumper, RubyModule.ModuleKernelMethods, RubyModule.ProfilingCacheEntryFactory, RubyModule.RespondToMissingMethod, RubyModule.SynchronizedCacheEntryFactory, RubyModule.WrapperCacheEntryFactoryRubyObject.DataRubyBasicObject.Finalizer| Modifier and Type | Field and Description |
|---|---|
private ObjectAllocator |
allocator |
private CallSite[] |
baseCallSites |
private RubyClass.MarshalTuple |
cachedDumpMarshal
A cached tuple of method, type, and generation for dumping
|
private CacheEntry |
cachedLoad
A cached tuple of method and generation for marshal loading
|
static ObjectAllocator |
CLASS_ALLOCATOR |
private java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> |
classAnnotations |
static int |
CS_IDX_INITIALIZE |
static java.lang.String[] |
CS_NAMES |
private static boolean |
DEBUG_REIFY |
protected static ObjectMarshal |
DEFAULT_OBJECT_MARSHAL |
private CallSite[] |
extraCallSites |
private java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
fieldAnnotations |
private java.util.Map<java.lang.String,java.lang.Class> |
fieldSignatures |
private static Logger |
LOG |
protected ObjectMarshal |
marshal |
private java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
methodAnnotations |
private java.util.Map<java.lang.String,java.lang.Class[]> |
methodSignatures |
private java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> |
parameterAnnotations |
private RubyClass |
realClass
The "real" class, used by includes and singletons to locate the actual type of the object
|
private java.lang.Class |
reifiedClass |
protected Ruby |
runtime |
private java.util.Set<RubyClass> |
subclasses |
private VariableTableManager |
variableTableManager
Variable table manager for this class
|
baseName, cachedMethods, ERR_FROZEN_CONST_TYPE, ERR_FROZEN_CVAR_TYPE, ERR_INSECURE_SET_CLASS_VAR, ERR_INSECURE_SET_CONSTANT, generation, generationObject, id, includingHierarchies, index, kindOf, methodInvalidator, MODULE_ALLOCATOR, NormalCacheEntryFactory, parent, SCOPE_CAPTURING_METHODS, superClassFIELD_ALLOCATED_CLASSES, FIELD_ALLOCATORS, IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, OBJECT_VAR0_ALLOCATOR, OBJECT_VAR1_ALLOCATOR, OBJECT_VAR2_ALLOCATOR, OBJECT_VAR3_ALLOCATOR, OBJECT_VAR4_ALLOCATOR, OBJECT_VAR5_ALLOCATOR, OBJECT_VAR6_ALLOCATOR, OBJECT_VAR7_ALLOCATOR, OBJECT_VAR8_ALLOCATOR, OBJECT_VAR9_ALLOCATOR, REIFYING_OBJECT_ALLOCATORALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, STAMP_OFFSET, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, VAR_TABLE_OFFSET, varTable, varTableStampNULL_ARRAY| Modifier | Constructor and Description |
|---|---|
protected |
RubyClass(Ruby runtime)
used by CLASS_ALLOCATOR (any Class' class will be a Class!)
also used to bootstrap Object class
|
protected |
RubyClass(Ruby runtime,
RubyClass superClazz)
rb_class_boot (for plain Classes)
also used to bootstrap Module and Class classes
|
protected |
RubyClass(Ruby runtime,
RubyClass superClass,
boolean objectSpace)
separate path for MetaClass and IncludedModuleWrapper construction
(rb_class_boot version for MetaClasses)
no marshal, allocator initialization and addSubclass(this) here!
|
protected |
RubyClass(Ruby runtime,
RubyClass superClazz,
CallSite[] extraCallSites)
A constructor which allows passing in an array of supplementary call sites.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addClassAnnotation(java.lang.Class annotation,
java.util.Map fields) |
void |
addFieldAnnotation(java.lang.String fieldName,
java.lang.Class annotation,
java.util.Map fields) |
void |
addFieldSignature(java.lang.String fieldName,
java.lang.Class type) |
void |
addInvalidatorsAndFlush(java.util.List<Invalidator> invalidators) |
void |
addMethodAnnotation(java.lang.String methodName,
java.lang.Class annotation,
java.util.Map fields) |
void |
addMethodSignature(java.lang.String methodName,
java.lang.Class[] types) |
void |
addParameterAnnotation(java.lang.String method,
int i,
java.lang.Class annoClass,
java.util.Map<java.lang.String,java.lang.Object> value) |
void |
addSubclass(RubyClass subclass)
Add a new subclass to the weak set of subclasses.
|
IRubyObject |
allocate() |
void |
becomeSynchronized() |
static boolean |
checkFuncallCallable(ThreadContext context,
DynamicMethod method,
CallType callType,
IRubyObject self) |
private static IRubyObject |
checkFuncallExec(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject... args) |
private static IRubyObject |
checkFuncallFailed(ThreadContext context,
IRubyObject self,
java.lang.String name,
RubyClass expClass,
IRubyObject... args) |
private static IRubyObject |
checkFuncallMissing(ThreadContext context,
RubyClass klass,
IRubyObject self,
java.lang.String method,
IRubyObject... args) |
private static boolean |
checkFuncallRespondTo(ThreadContext context,
RubyClass klass,
IRubyObject recv,
java.lang.String mid) |
static void |
checkInheritable(IRubyObject superClass)
rb_check_inheritable
|
private void |
checkNotInitialized() |
static RubyClass |
createBootstrapClass(Ruby runtime,
java.lang.String name,
RubyClass superClass,
ObjectAllocator allocator)
boot_defclass
Create an initial Object meta class before Module and Kernel dependencies have
squirreled themselves together.
|
static void |
createClassClass(Ruby runtime,
RubyClass classClass) |
private void |
dumpReifiedClass(java.lang.String dumpDir,
java.lang.String javaPath,
byte[] classBytes) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2) |
IRubyObject |
finvoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block) |
IRubyObject |
finvokeChecked(ThreadContext context,
IRubyObject self,
java.lang.String name) |
private void |
generateMethodAnnotations(java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> methodAnnos,
SkinnyMethodAdapter m,
java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> parameterAnnos) |
ObjectAllocator |
getAllocator() |
CallSite |
getBaseCallSite(int idx) |
CallSite[] |
getBaseCallSites() |
java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> |
getClassAnnotations() |
Ruby |
getClassRuntime() |
CallSite[] |
getExtraCallSites() |
VariableAccessorField |
getFFIHandleAccessorField() |
VariableAccessor |
getFFIHandleAccessorForRead() |
VariableAccessor |
getFFIHandleAccessorForWrite() |
java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
getFieldAnnotations() |
java.util.Map<java.lang.String,java.lang.Class> |
getFieldSignatures() |
ObjectMarshal |
getMarshal() |
java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> |
getMethodAnnotations() |
java.util.Map<java.lang.String,java.lang.Class[]> |
getMethodSignatures() |
VariableAccessorField |
getNativeHandleAccessorField() |
VariableAccessor |
getNativeHandleAccessorForWrite() |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
|
VariableAccessorField |
getObjectGroupAccessorField() |
VariableAccessor |
getObjectGroupAccessorForRead() |
VariableAccessor |
getObjectGroupAccessorForWrite() |
VariableAccessorField |
getObjectIdAccessorField() |
java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> |
getParameterAnnotations() |
RubyClass |
getRealClass() |
java.lang.Class |
getReifiedClass() |
VariableAccessor |
getVariableAccessorForRead(java.lang.String name) |
VariableAccessor |
getVariableAccessorForWrite(java.lang.String name) |
java.util.Map<java.lang.String,VariableAccessor> |
getVariableAccessorsForRead() |
java.lang.String[] |
getVariableNames()
Get an array of all the known instance variable names.
|
java.util.Map<java.lang.String,VariableAccessor> |
getVariableTableCopy() |
VariableTableManager |
getVariableTableManager() |
int |
getVariableTableSize() |
int |
getVariableTableSizeWithExtras() |
boolean |
hasObjectID() |
void |
inherit(RubyClass superClazz)
rb_class_inherited (reversed semantics!)
|
IRubyObject |
inherited(ThreadContext context,
IRubyObject arg) |
IRubyObject |
initialize_copy(IRubyObject original)
rb_class_init_copy
|
IRubyObject |
initialize(ThreadContext context,
Block block)
rb_class_initialize
|
IRubyObject |
initialize(ThreadContext context,
IRubyObject superObject,
Block block) |
IRubyObject |
initialize19(ThreadContext context,
Block block) |
IRubyObject |
initialize19(ThreadContext context,
IRubyObject superObject,
Block block) |
private IRubyObject |
initializeCommon(ThreadContext context,
RubyClass superClazz,
Block block,
boolean ruby1_9) |
void |
invalidateCacheDescendants()
Invalidate all subclasses of this class by walking the set of all
subclasses and asking them to invalidate themselves.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
Deprecated.
|
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
CallType callType,
Block block) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType) |
IRubyObject |
invoke(ThreadContext context,
IRubyObject self,
java.lang.String name,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
CallType callType,
Block block) |
IRubyObject |
invokeInherited(ThreadContext context,
IRubyObject self,
IRubyObject subclass) |
boolean |
isClass()
Specifically polymorphic method that are meant to be overridden
by classes to specify that they are classes in an easy way.
|
boolean |
isModule()
Specifically polymorphic method that are meant to be overridden
by modules to specify that they are modules in an easy way.
|
boolean |
isReifiable()
Whether this class can be reified into a Java class.
|
boolean |
isSingleton() |
RubyClass |
makeMetaClass(RubyClass superClass)
rb_make_metaclass
|
void |
marshal(java.lang.Object obj,
MarshalStream marshalStream) |
static void |
marshalTo(RubyClass clazz,
MarshalStream output) |
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass)
Construct a new class with the given name scoped under Object (global)
and with Object as its immediate superclass.
|
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
CallSite[] extraCallSites)
A variation on newClass that allow passing in an array of supplementary
call sites to improve dynamic invocation.
|
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
java.lang.String name,
ObjectAllocator allocator,
RubyModule parent,
boolean setParent)
Construct a new class with the given name, allocator, parent class,
and containing class.
|
static RubyClass |
newClass(Ruby runtime,
RubyClass superClass,
java.lang.String name,
ObjectAllocator allocator,
RubyModule parent,
boolean setParent,
CallSite[] extraCallSites)
A variation on newClass that allows passing in an array of supplementary
call sites to improve dynamic invocation performance.
|
IRubyObject |
newInstance(ThreadContext context,
Block block)
rb_class_new_instance
|
IRubyObject |
newInstance(ThreadContext context,
IRubyObject[] args,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block) |
IRubyObject |
newInstance(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2,
Block block) |
boolean |
notVisibleAndNotMethodMissing(DynamicMethod method,
java.lang.String name,
IRubyObject caller,
CallType callType) |
static boolean |
rbMethodCallStatus(ThreadContext context,
DynamicMethod method,
CallType callType,
IRubyObject self) |
void |
reify() |
void |
reify(boolean useChildLoader) |
void |
reify(java.lang.String classDumpDir) |
void |
reify(java.lang.String classDumpDir,
boolean useChildLoader)
Stand up a real Java class for the backing store of this object
|
void |
reifyWithAncestors() |
void |
reifyWithAncestors(boolean useChildLoader) |
void |
reifyWithAncestors(java.lang.String classDumpDir) |
void |
reifyWithAncestors(java.lang.String classDumpDir,
boolean useChildLoader)
Reify this class, first reifying all its ancestors.
|
void |
removeSubclass(RubyClass subclass)
Remove a subclass from the weak set of subclasses.
|
void |
replaceSubclass(RubyClass subclass,
RubyClass newSubclass)
Replace an existing subclass with a new one.
|
void |
setAllocator(ObjectAllocator allocator) |
void |
setClassAllocator(java.lang.Class cls)
Set a reflective allocator that calls a no-arg constructor on the given
class.
|
void |
setMarshal(ObjectMarshal marshal) |
protected void |
setModuleSuperClass(RubyClass superClass) |
void |
setReifiedClass(java.lang.Class newReifiedClass) |
void |
setRubyClassAllocator(java.lang.Class cls)
Set a reflective allocator that calls the "standard" Ruby object
constructor (Ruby, RubyClass) on the given class.
|
void |
setRubyStaticAllocator(java.lang.Class cls)
Set a reflective allocator that calls the "standard" Ruby object
constructor (Ruby, RubyClass) on the given class via a static
__allocate__ method intermediate.
|
private boolean |
shouldCallMethodMissing(DynamicMethod method) |
private boolean |
shouldCallMethodMissing(DynamicMethod method,
java.lang.String name,
IRubyObject caller,
CallType callType) |
void |
smartDump(MarshalStream stream,
IRubyObject target)
Marshal the given object to the marshaling stream, being "smart" and
caching how to do that marshaling.
|
IRubyObject |
smartLoadNewUser(IRubyObject target,
IRubyObject data)
Load marshaled data into a blank target object using marshal_load, being
"smart" and caching the mechanism for invoking marshal_load.
|
IRubyObject |
smartLoadOldUser(IRubyObject data)
Load marshaled data into a blank target object using _load, being
"smart" and caching the mechanism for invoking _load.
|
java.util.Collection<RubyClass> |
subclasses(boolean includeDescendants) |
IRubyObject |
superclass(ThreadContext context)
Return the real super class of this class.
|
java.lang.Object |
toJava(java.lang.Class klass)
Convert the object to the specified Java class, if possible.
|
java.lang.Object |
unmarshal(UnmarshalStream unmarshalStream) |
static RubyClass |
unmarshalFrom(UnmarshalStream input) |
addClassProvider, addIncludingHierarchy, addMethod, addMethodAtBootTimeOnly, addMethodInternal, addModuleFunction, addReadAttribute, addReadWriteAttribute, addWriteAttribute, alias_method, ancestors, ancestors, append_features, attr_accessor, attr_accessor, attr_reader, attr_reader, attr_writer, attr, attr19, checkMethodBound, checkValidBindTargetFrom, class_variable_defined_p, class_variable_get, class_variable_get19, class_variable_set, class_variable_set19, class_variables, class_variables19, cloneMethods, const_defined_p, const_defined_p19, const_get_1_9, const_get_2_0, const_get, const_missing, const_set, constantEntryFetch, constants, constants19, constants19, constantsCommon, constantsCommon, constantsCommon19, constantTableContains, constantTableFetch, constantTableRemove, constantTableStore, createModuleClass, define_method, define_method, define_method, defineAlias, defineAliases, defineAnnotatedConstant, defineAnnotatedConstants, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethod, defineAnnotatedMethods, defineAnnotatedMethodsIndividually, defineAutoload, defineClassUnder, defineConstant, defineFastMethod, defineFastMethod, defineFastModuleFunction, defineFastPrivateMethod, defineFastProtectedMethod, defineFastPublicModuleFunction, defineMethod, defineModuleFunction, defineModuleUnder, defineOrGetClassUnder, defineOrGetModuleUnder, definePrivateMethod, definePublicModuleFunction, deleteClassVariable, deleteConstant, discoverInstanceVariables, ensureClassVariablesSettable, ensureConstantsSettable, equals, executeUnder, exportMethod, extend_object, extended, fastFetchClassVariable, fastFetchConstant, fastGetClass, fastGetClassVar, fastGetConstant, fastGetConstant, fastGetConstantAt, fastGetConstantFrom, fastGetConstantFromConstMissing, fastGetConstantFromNoConstMissing, fastHasClassVariable, fastHasConstant, fastIsClassVarDefined, fastIsConstantDefined, fastIsConstantDefined19, fastIsConstantDefined19, fastSetClassVar, fastSetConstant, fastStoreClassVariable, fastStoreConstant, fetchClassVariable, fetchConstant, fetchConstant, findImplementer, finishAutoload, freeze, getAncestorList, getAutoloadConstant, getAutoloadFile, getBaseName, getCacheProxy, getCacheToken, getClass, getClassVar, getClassVariableNameList, getClassVariables, getClassVariablesForRead, getConstant, getConstant, getConstant, getConstantAt, getConstantAt, getConstantAtSpecial, getConstantFrom, getConstantFromConstMissing, getConstantFromNoConstMissing, getConstantFromNoConstMissing, getConstantMap, getConstantMapForWrite, getConstantNames, getConstantNames, getConstantNoConstMissing, getConstantNoConstMissing, getConstantNoConstMissing, getGeneration, getGenerationObject, getInvalidator, getJavaProxy, getMethods, getMethodsForWrite, getName, getNonIncludedClass, getParent, getSimpleName, getStoredConstantList, getStoredConstantNameList, getSuperClass, hasClassVariable, hasConstant, hash, hashCode, hasInternalModuleVariable, hasModuleInHierarchy, include_p, include, included_modules, included, includeModule, initialize, instance_method, instance_methods, instance_methods19, invalidateCacheDescendantsInner, invalidateConstantCache, invalidateCoreClasses, isClassVarDefined, isConstantDefined, isIncluded, isInstance, isKindOfModule, isMethodBound, isMethodBound, isMethodBuiltin, isSame, isSynchronized, marshalTo, method_added, method_defined_p, method_removed, method_undefined, mix, mix, module_eval, module_eval, module_eval, module_eval, module_eval, module_exec, module_exec, module_function, name, name19, needsImplementer, nesting, newIncludeClass, newMethod, newMethod, newMethod, newModule, newModule, op_cmp, op_eqq, op_equal, op_ge, op_gt, op_le, op_lt, populateInstanceMethodNames, private_class_method, private_constant, private_constant, private_instance_methods, private_instance_methods19, private_method_defined, protected_instance_methods, protected_instance_methods19, protected_method_defined, public_class_method, public_constant, public_constant, public_instance_methods, public_instance_methods19, public_method_defined, rbPrivate, rbProtected, rbPublic, remove_class_variable, remove_class_variable19, remove_const, remove_method, removeClassProvider, removeClassVariable, removeCvar, removeMethod, resolveUndefConstant, retrieveMethod, searchInternalModuleVariable, searchMethod, searchMethodInner, searchWithCache, setBaseName, setCacheProxy, setClassVar, setConstant, setConstantQuiet, setInternalModuleVariable, setJavaProxy, setMethodVisibility, setParent, setSuperClass, storeClassVariable, storeConstant, syncClassVariables, syncConstants, to_s, undef_method, undef, undefineMethod, updateGeneration, validateClassVariable, validateConstant, visitInterpretedMethodsattachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, initialize, initialize, inspect, puts, specificEval, toStringaddFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getNativeHandle, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, infectBy, infectBy, initialize19, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isFalse, isFrozen, isImmediate, isNil, isTaint, isTrue, isUntrusted, kind_of_p, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderprivate static final Logger LOG
public static final ObjectAllocator CLASS_ALLOCATOR
protected static final ObjectMarshal DEFAULT_OBJECT_MARSHAL
private static final boolean DEBUG_REIFY
protected final Ruby runtime
private ObjectAllocator allocator
protected ObjectMarshal marshal
private java.util.Set<RubyClass> subclasses
public static final int CS_IDX_INITIALIZE
public static final java.lang.String[] CS_NAMES
private final CallSite[] baseCallSites
private CallSite[] extraCallSites
private java.lang.Class reifiedClass
private java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> parameterAnnotations
private java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> methodAnnotations
private java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> fieldAnnotations
private java.util.Map<java.lang.String,java.lang.Class[]> methodSignatures
private java.util.Map<java.lang.String,java.lang.Class> fieldSignatures
private java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> classAnnotations
private RubyClass.MarshalTuple cachedDumpMarshal
private CacheEntry cachedLoad
private final RubyClass realClass
private final VariableTableManager variableTableManager
protected RubyClass(Ruby runtime, RubyClass superClass, boolean objectSpace)
protected RubyClass(Ruby runtime)
protected RubyClass(Ruby runtime, RubyClass superClazz)
public ObjectAllocator getAllocator()
public void setAllocator(ObjectAllocator allocator)
public void setClassAllocator(java.lang.Class cls)
cls - The class on which to call the default constructor to allocatepublic void setRubyClassAllocator(java.lang.Class cls)
cls - The class from which to grab a standard Ruby constructorpublic void setRubyStaticAllocator(java.lang.Class cls)
cls - The class from which to grab a standard Ruby __allocate__
method.public IRubyObject allocate()
public CallSite getBaseCallSite(int idx)
public CallSite[] getBaseCallSites()
public CallSite[] getExtraCallSites()
public VariableTableManager getVariableTableManager()
public boolean hasObjectID()
public java.util.Map<java.lang.String,VariableAccessor> getVariableAccessorsForRead()
public VariableAccessor getVariableAccessorForWrite(java.lang.String name)
public VariableAccessor getVariableAccessorForRead(java.lang.String name)
public VariableAccessorField getObjectIdAccessorField()
public VariableAccessorField getNativeHandleAccessorField()
public VariableAccessor getNativeHandleAccessorForWrite()
public VariableAccessorField getFFIHandleAccessorField()
public VariableAccessor getFFIHandleAccessorForRead()
public VariableAccessor getFFIHandleAccessorForWrite()
public VariableAccessorField getObjectGroupAccessorField()
public VariableAccessor getObjectGroupAccessorForRead()
public VariableAccessor getObjectGroupAccessorForWrite()
public int getVariableTableSize()
public int getVariableTableSizeWithExtras()
public java.lang.String[] getVariableNames()
public java.util.Map<java.lang.String,VariableAccessor> getVariableTableCopy()
public int getNativeTypeIndex()
RubyObjectgetNativeTypeIndex in interface CoreObjectTypegetNativeTypeIndex in class RubyModuleClassIndexpublic boolean isModule()
RubyBasicObjectisModule in interface IRubyObjectisModule in class RubyModule(someObject instanceof RubyModule) instead.public boolean isClass()
RubyBasicObjectisClass in interface IRubyObjectisClass in class RubyModule(someObject instanceof RubyClass/MetaClass) instead.public boolean isSingleton()
isSingleton in class RubyModulepublic static RubyClass createBootstrapClass(Ruby runtime, java.lang.String name, RubyClass superClass, ObjectAllocator allocator)
runtime - we need itpublic static RubyClass newClass(Ruby runtime, RubyClass superClass)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, CallSite[] extraCallSites)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent)
public static RubyClass newClass(Ruby runtime, RubyClass superClass, java.lang.String name, ObjectAllocator allocator, RubyModule parent, boolean setParent, CallSite[] extraCallSites)
public RubyClass makeMetaClass(RubyClass superClass)
makeMetaClass in class RubyBasicObject@Deprecated public IRubyObject invoke(ThreadContext context, IRubyObject self, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public boolean notVisibleAndNotMethodMissing(DynamicMethod method, java.lang.String name, IRubyObject caller, CallType callType)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType, Block block)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name)
public IRubyObject finvokeChecked(ThreadContext context, IRubyObject self, java.lang.String name)
private static IRubyObject checkFuncallExec(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject... args)
private static IRubyObject checkFuncallFailed(ThreadContext context, IRubyObject self, java.lang.String name, RubyClass expClass, IRubyObject... args)
private static boolean checkFuncallRespondTo(ThreadContext context, RubyClass klass, IRubyObject recv, java.lang.String mid)
public static boolean checkFuncallCallable(ThreadContext context, DynamicMethod method, CallType callType, IRubyObject self)
public static boolean rbMethodCallStatus(ThreadContext context, DynamicMethod method, CallType callType, IRubyObject self)
private static IRubyObject checkFuncallMissing(ThreadContext context, RubyClass klass, IRubyObject self, java.lang.String method, IRubyObject... args)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject[] args)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1)
public IRubyObject invoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, CallType callType)
public IRubyObject finvoke(ThreadContext context, IRubyObject self, java.lang.String name, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
private void dumpReifiedClass(java.lang.String dumpDir,
java.lang.String javaPath,
byte[] classBytes)
private void generateMethodAnnotations(java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> methodAnnos,
SkinnyMethodAdapter m,
java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> parameterAnnos)
private boolean shouldCallMethodMissing(DynamicMethod method)
private boolean shouldCallMethodMissing(DynamicMethod method, java.lang.String name, IRubyObject caller, CallType callType)
public IRubyObject invokeInherited(ThreadContext context, IRubyObject self, IRubyObject subclass)
public IRubyObject newInstance(ThreadContext context, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
public IRubyObject newInstance(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject initialize(ThreadContext context, Block block)
initialize in class RubyModulepublic IRubyObject initialize(ThreadContext context, IRubyObject superObject, Block block)
public IRubyObject initialize19(ThreadContext context, Block block)
public IRubyObject initialize19(ThreadContext context, IRubyObject superObject, Block block)
private IRubyObject initializeCommon(ThreadContext context, RubyClass superClazz, Block block, boolean ruby1_9)
public IRubyObject initialize_copy(IRubyObject original)
initialize_copy in class RubyModuleprotected void setModuleSuperClass(RubyClass superClass)
public java.util.Collection<RubyClass> subclasses(boolean includeDescendants)
public void addSubclass(RubyClass subclass)
subclass - The subclass to addpublic void removeSubclass(RubyClass subclass)
subclass - The subclass to removepublic void replaceSubclass(RubyClass subclass, RubyClass newSubclass)
subclass - The subclass to removenewSubclass - The subclass to replace it withpublic void becomeSynchronized()
becomeSynchronized in class RubyModulepublic void invalidateCacheDescendants()
invalidateCacheDescendants in class RubyModulepublic void addInvalidatorsAndFlush(java.util.List<Invalidator> invalidators)
public Ruby getClassRuntime()
public final RubyClass getRealClass()
public IRubyObject inherited(ThreadContext context, IRubyObject arg)
public void inherit(RubyClass superClazz)
public IRubyObject superclass(ThreadContext context)
private void checkNotInitialized()
public static void checkInheritable(IRubyObject superClass)
public final ObjectMarshal getMarshal()
public final void setMarshal(ObjectMarshal marshal)
public final void marshal(java.lang.Object obj,
MarshalStream marshalStream)
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.Object unmarshal(UnmarshalStream unmarshalStream) throws java.io.IOException
java.io.IOExceptionpublic static void marshalTo(RubyClass clazz, MarshalStream output) throws java.io.IOException
java.io.IOExceptionpublic static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOExceptionpublic boolean isReifiable()
public void reifyWithAncestors()
public void reifyWithAncestors(java.lang.String classDumpDir)
public void reifyWithAncestors(boolean useChildLoader)
public void reifyWithAncestors(java.lang.String classDumpDir,
boolean useChildLoader)
classDumpDir - the path in which to dump reified class bytesuseChildLoader - whether to load the class into its own child classloaderpublic void reify()
public void reify(java.lang.String classDumpDir)
public void reify(boolean useChildLoader)
public void reify(java.lang.String classDumpDir,
boolean useChildLoader)
classDumpDir - Directory to save reified java classpublic void setReifiedClass(java.lang.Class newReifiedClass)
public java.lang.Class getReifiedClass()
public java.util.Map<java.lang.String,java.util.List<java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>>> getParameterAnnotations()
public void addParameterAnnotation(java.lang.String method,
int i,
java.lang.Class annoClass,
java.util.Map<java.lang.String,java.lang.Object> value)
public java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> getMethodAnnotations()
public java.util.Map<java.lang.String,java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>>> getFieldAnnotations()
public void addMethodAnnotation(java.lang.String methodName,
java.lang.Class annotation,
java.util.Map fields)
public void addFieldAnnotation(java.lang.String fieldName,
java.lang.Class annotation,
java.util.Map fields)
public java.util.Map<java.lang.String,java.lang.Class[]> getMethodSignatures()
public java.util.Map<java.lang.String,java.lang.Class> getFieldSignatures()
public void addMethodSignature(java.lang.String methodName,
java.lang.Class[] types)
public void addFieldSignature(java.lang.String fieldName,
java.lang.Class type)
public java.util.Map<java.lang.Class,java.util.Map<java.lang.String,java.lang.Object>> getClassAnnotations()
public void addClassAnnotation(java.lang.Class annotation,
java.util.Map fields)
public java.lang.Object toJava(java.lang.Class klass)
IRubyObjecttoJava in interface IRubyObjecttoJava in class RubyModuleklass - The target type to which the object should be converted.IRubyObject.toJava(java.lang.Class)public void smartDump(MarshalStream stream, IRubyObject target) throws java.io.IOException
stream - The stream to which to marshal the datatarget - The object whose data should be marshaledjava.io.IOException - If there is an IO exception while writing to the
stream.public IRubyObject smartLoadNewUser(IRubyObject target, IRubyObject data)
target - The blank target object into which marshal_load will
deserialize the given datadata - The marshaled datapublic IRubyObject smartLoadOldUser(IRubyObject data)
data - The marshaled data, to be reconstituted into an object by
_load