Package org.jruby
Class RubyClass.ConcreteJavaReifier
java.lang.Object
org.jruby.RubyClass.ConcreteJavaReifier
- Enclosing class:
RubyClass
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.objectweb.asm.ClassWriterprotected final Stringfinal Stringprotected final JavaClassConfigurationfinal Class<?> static final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringfinal Stringfinal String -
Method Summary
Modifier and TypeMethodDescriptionprotected voidallocAndInitialize(SkinnyMethodAdapter m, boolean initIfAllowed) voidprotected StringdefineInstanceMethod(ThreadContext context, String id, String callid, Signature sig, PositionAware position, Class<?>[] methodSignature) protected voiddefineInstanceMethods(ThreadContext context, Set<String> instanceMethods) protected voidOverride to save more values from the array inreifyClinit(SkinnyMethodAdapter)protected voidGenerates an init barrier.protected voidgenerateSuperBridges(String javaMethodName, Class<?>[] methodSignature) protected Object[]protected booleanClass[]protected voidLoads self (if local) or the rubyObject (if a java proxy) cast to a RubyBasicObject, as everything is a RBO and it has a nicer interfacebyte[]reify()voidThis method generates <clinit> by marshaling the Ruby, RubyClass, etc variables through a static map identified by integer in JavaProxyClass.protected voidvoidrubycall(SkinnyMethodAdapter m, String signature) protected Collection<Class<?>[]> protected Collection<Class<?>[]> searchInheritedSignatures(String id, Signature arity)
-
Field Details
-
RUBY_OBJECT_FIELD
- See Also:
-
RUBY_PROXY_CLASS_FIELD
- See Also:
-
RUBY_CTOR_CACHE_FIELD
- See Also:
-
reifiedParent
-
javaName
-
javaPath
-
rubyName
-
rubyPath
-
jcc
-
cw
protected final org.objectweb.asm.ClassWriter cw -
RUBY_FIELD
- See Also:
-
RUBY_CLASS_FIELD
- See Also:
-
-
Method Details
-
customReify
public void customReify() -
loadRubyObject
Loads self (if local) or the rubyObject (if a java proxy) cast to a RubyBasicObject, as everything is a RBO and it has a nicer interface -
reify
public byte[] reify() -
isRubyObject
protected boolean isRubyObject() -
getExtraClinitInfo
-
extraClinitLookup
Override to save more values from the array inreifyClinit(SkinnyMethodAdapter) -
generateSuperBridges
-
searchInheritedSignatures
-
reifyConstructors
protected void reifyConstructors() -
generateObjectBarrier
Generates an init barrier. NOT Thread-safe, but hopefully nobody has threads in their constructor? This is used to ensure that self.to_java is valid if the super ctor calls an abstract method that is re-implemented by ruby -
defineInstanceMethods
-
defineInstanceMethod
protected String defineInstanceMethod(ThreadContext context, String id, String callid, Signature sig, PositionAware position, Class<?>[] methodSignature) -
reifyClinit
This method generates <clinit> by marshaling the Ruby, RubyClass, etc variables through a static map identified by integer in JavaProxyClass. Integers are serializable through bytecode generation so we can share arbitrary objects with the generated class by saving them ingetExtraClinitInfo()viaJavaProxyClass.addStaticInitLookup(Object...)andJavaProxyClass.getStaticInitLookup(int) -
searchClassMethods
-
rubycall
-
allocAndInitialize
-
join
-