Sha256: ceb5fae46f0ea9fdca1b7fd5fb3b07b8da8f823de100410ad7277f2f2e05e166

Contents?: true

Size: 1.92 KB

Versions: 119

Compression:

Stored size: 1.92 KB

Contents

package com.xruby.runtime.lang.util;

/*
import java.lang.annotation.Annotation;

import org.objectweb.asm.Type;
import org.objectweb.asm.commons.GeneratorAdapter;
import org.objectweb.asm.commons.Method;

import com.xruby.compiler.codegen.CgUtil;
import com.xruby.compiler.codegen.Types;
import com.xruby.runtime.lang.annotation.RubyLevelObject;

class RubyObjectFactory extends RubyTypeFactory {
	private static final Method RubyObjectBuilderCreateRubyObjectMethod = 
		CgUtil.getMethod("createRubyObject", Types.RUBY_OBJECT_TYPE);
	private static final Method RubyObjectConstructor = 
		CgUtil.getMethod("<init>", Type.VOID_TYPE, Types.RUBY_CLASS_TYPE);
	private static final Type BuilderInterface = Type.getType(RubyObjectBuilder.class);
	
	RubyObjectFactory(Class klass) {
		super(klass);
	}
	
	protected boolean isModule() {
		return false;
	}

	protected Class getTypeAnnotationClass() {
		return RubyLevelObject.class;
	}
	
	protected String getBuilderName(Class klass) {
		return CgUtil.getInternalName(klass.getName() + "$ObjectBuilder");
	}
	
	protected Type getInterface() {
		return BuilderInterface;
	}
	
	protected Method getBuilderMethod() {
		return RubyObjectBuilderCreateRubyObjectMethod;
	}

	protected int createRubyType(GeneratorAdapter mg, Annotation annotation) {
		RubyLevelObject objectAnnotation = (RubyLevelObject)annotation;
		
		mg.newInstance(Types.RUBY_OBJECT_TYPE);
		mg.dup();
		loadRubyClass(mg, objectAnnotation.objectClass());
		
		mg.invokeConstructor(Types.RUBY_OBJECT_TYPE, 
				RubyObjectConstructor);
		
		int rubyTypeIdx = mg.newLocal(Types.RUBY_OBJECT_TYPE);
		mg.storeLocal(rubyTypeIdx);
		
		String name = objectAnnotation.name();
		if (name != null && name.length() != 0) {
			mg.loadLocal(rubyTypeIdx);
			mg.push(name);
			mg.invokeStatic(Types.RUBY_API_TYPE, 
					CgUtil.getMethod("setTopLevelConstant", Types.RUBY_VALUE_TYPE, Types.RUBY_VALUE_TYPE, Type.getType(String.class)));
		}
		
		return rubyTypeIdx;
	}
}*/

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
rhodes-3.3.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.3.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.3 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.2.beta platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.9 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.8 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.7 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.6 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.2 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.2.0.beta.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.1.1 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.1.1.beta platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.1.0 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.1.0.beta.5 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java
rhodes-3.1.0.beta.4 platform/bb/RubyVM/src/com/xruby/runtime/lang/util/RubyObjectFactory.java