use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class InvokeInterface method executeWithNullCheck.
@Specialization
Object executeWithNullCheck(Object[] args, @Cached NullCheck nullCheck, @Cached("create(resolutionSeed)") WithoutNullCheck invokeInterface) {
StaticObject receiver = (StaticObject) args[0];
nullCheck.execute(receiver);
return invokeInterface.execute(args);
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class EspressoReferenceArrayStoreNode method arrayStore.
public void arrayStore(EspressoContext context, StaticObject value, int index, StaticObject array) {
if (Integer.compareUnsigned(index, array.length()) >= 0) {
enterOutOfBound();
Meta meta = context.getMeta();
throw meta.throwException(meta.java_lang_ArrayIndexOutOfBoundsException);
}
if (!StaticObject.isNull(value) && !instanceOfDynamic.execute(value.getKlass(), ((ArrayKlass) array.getKlass()).getComponentType())) {
enterArrayStoreEx();
Meta meta = context.getMeta();
throw meta.throwException(meta.java_lang_ArrayStoreException);
}
(array.<StaticObject[]>unwrap())[index] = value;
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class StringConversion method produceGuestString11.
private static StaticObject produceGuestString11(Meta meta, byte[] value, int hash, byte coder) {
StaticObject guestString = meta.java_lang_String.allocateInstance();
meta.java_lang_String_coder.set(guestString, coder);
meta.java_lang_String_hash.set(guestString, hash);
meta.java_lang_String_value.setObject(guestString, StaticObject.wrap(value, meta), true);
return guestString;
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class MHInvokeGenericNode method create.
public static MHInvokeGenericNode create(Klass accessingKlass, Method method, Symbol<Symbol.Name> methodName, Symbol<Symbol.Signature> signature, Meta meta) {
Klass callerKlass = accessingKlass == null ? meta.java_lang_Object : accessingKlass;
StaticObject appendixBox = StaticObject.createArray(meta.java_lang_Object_array, new StaticObject[1]);
// Ask java code to spin an invoker for us.
StaticObject memberName = (StaticObject) meta.java_lang_invoke_MethodHandleNatives_linkMethod.invokeDirect(null, callerKlass.mirror(), (int) REF_invokeVirtual, method.getDeclaringKlass().mirror(), meta.toGuestString(methodName), meta.toGuestString(signature), appendixBox);
StaticObject appendix = appendixBox.get(0);
return new MHInvokeGenericNode(method, memberName, appendix);
}
use of com.oracle.truffle.espresso.runtime.StaticObject in project graal by oracle.
the class ArrayLengthQuickNode method execute.
@Override
public int execute(VirtualFrame frame) {
StaticObject array = nullCheck(BytecodeNode.popObject(frame, top - 1));
BytecodeNode.putInt(frame, top - 1, arrayLength.execute(array));
return stackEffectOf_ARRAYLENGTH;
}
Aggregations