Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }
Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
Type getRootComponent(Type type) { while (type.isArray()) type = type.getComponent(); return type; }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayLoad(Type expectedComponent, Frame frame) throws BadBytecode { Type index = frame.pop(); Type array = frame.pop(); // Special case, an array defined by aconst_null // TODO - we might need to be more inteligent about this if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); if (expectedComponent == Type.OBJECT) { simplePush(Type.UNINIT, frame); } else { simplePush(expectedComponent, frame); } return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); simplePush(component, frame); }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }
private void evalArrayStore(Type expectedComponent, Frame frame) throws BadBytecode { Type value = simplePop(frame); Type index = frame.pop(); Type array = frame.pop(); if (array == Type.UNINIT) { verifyAssignable(Type.INTEGER, index); return; } Type component = array.getComponent(); if (component == null) throw new BadBytecode("Not an array! [pos = " + lastPos + "]: " + component); component = zeroExtend(component); verifyAssignable(expectedComponent, component); verifyAssignable(Type.INTEGER, index); // This intentionally only checks for Object on aastore // downconverting of an array (no casts) // e.g. Object[] blah = new String[]; // blah[2] = (Object) "test"; // blah[3] = new Integer(); // compiler doesnt catch it (has legal bytecode), // // but will throw arraystoreexception if (expectedComponent == Type.OBJECT) { verifyAssignable(expectedComponent, value); } else { verifyAssignable(component, value); } }