dupX2(); dupX2(); pop(); break;
private void genDiscardResponse(CodeBuilder b, TypeDesc type) { if (type != null) { if (type.isDoubleWord()) { b.pop2(); } else { b.pop(); } } }
builder.pop(); if (nextLabel == null) { builder.loadConstant(0);
b.pop2(); } else { b.pop();
dupX2(); dupX2(); pop(); break;
b.pop2(); } else { b.pop();
builder.pop(); if (nextLabel == null) { builder.loadConstant(0);
/** * Generated code checks if chained properties resolve to null, and if * so, branches to the current scope's fail or success location. */ private void loadChainedProperty(CodeBuilder b, ChainedProperty<?> chained) { b.loadLocal(mStorableVar); loadProperty(b, chained.getPrimeProperty()); for (int i=0; i<chained.getChainCount(); i++) { // Check if last loaded property was null. Fail for inner join, // success for outer join. b.dup(); Label notNull = b.createLabel(); b.ifNullBranch(notNull, false); b.pop(); if (chained.isOuterJoin(i)) { getScope().success(b); } else { getScope().fail(b); } notNull.setLocation(); // Now load next property in chain. loadProperty(b, chained.getChainedProperty(i)); } }
/** * Generated code checks if chained properties resolve to null, and if * so, branches to the current scope's fail or success location. */ private void loadChainedProperty(CodeBuilder b, ChainedProperty<?> chained) { b.loadLocal(mStorableVar); loadProperty(b, chained.getPrimeProperty()); for (int i=0; i<chained.getChainCount(); i++) { // Check if last loaded property was null. Fail for inner join, // success for outer join. b.dup(); Label notNull = b.createLabel(); b.ifNullBranch(notNull, false); b.pop(); if (chained.isOuterJoin(i)) { getScope().success(b); } else { getScope().fail(b); } notNull.setLocation(); // Now load next property in chain. loadProperty(b, chained.getChainedProperty(i)); } }
private void addWriteToMethod() { TypeDesc streamType = TypeDesc.forClass(OutputStream.class); MethodInfo mi = addMethodIfNotFinal(Modifiers.PUBLIC.toSynchronized(true), WRITE_TO, null, new TypeDesc[] {streamType}); if (mi == null) { return; } GenericEncodingStrategy<S> encoder = new GenericEncodingStrategy<S>(mStorableType, null); CodeBuilder b = new CodeBuilder(mi); LocalVariable encodedVar; try { encodedVar = encoder.buildSerialEncoding(b, null); } catch (SupportException e) { // Wipe out any code generated so far. b = new CodeBuilder(mi); CodeBuilderUtil.throwException(b, SupportException.class, e.getMessage()); return; } b.loadLocal(encodedVar); b.arrayLength(); b.loadLocal(b.getParameter(0)); b.invokeStatic(TypeDesc.forClass(DataEncoder.class), "writeLength", TypeDesc.INT, new TypeDesc[] {TypeDesc.INT, streamType}); b.pop(); b.loadLocal(b.getParameter(0)); b.loadLocal(encodedVar); b.invokeVirtual(streamType, "write", null, new TypeDesc[] {encodedVar.getType()}); b.returnVoid(); }
private void addWriteToMethod() { TypeDesc streamType = TypeDesc.forClass(OutputStream.class); MethodInfo mi = addMethodIfNotFinal(Modifiers.PUBLIC.toSynchronized(true), WRITE_TO, null, new TypeDesc[] {streamType}); if (mi == null) { return; } GenericEncodingStrategy<S> encoder = new GenericEncodingStrategy<S>(mStorableType, null); CodeBuilder b = new CodeBuilder(mi); LocalVariable encodedVar; try { encodedVar = encoder.buildSerialEncoding(b, null); } catch (SupportException e) { // Wipe out any code generated so far. b = new CodeBuilder(mi); CodeBuilderUtil.throwException(b, SupportException.class, e.getMessage()); return; } b.loadLocal(encodedVar); b.arrayLength(); b.loadLocal(b.getParameter(0)); b.invokeStatic(TypeDesc.forClass(DataEncoder.class), "writeLength", TypeDesc.INT, new TypeDesc[] {TypeDesc.INT, streamType}); b.pop(); b.loadLocal(b.getParameter(0)); b.loadLocal(encodedVar); b.invokeVirtual(streamType, "write", null, new TypeDesc[] {encodedVar.getType()}); b.returnVoid(); }
Label versionNotNull = b.createLabel(); b.ifNullBranch(versionNotNull, false); b.pop(); if (primitiveType == TypeDesc.LONG) { b.loadConstant(1L);
Label versionNotNull = b.createLabel(); b.ifNullBranch(versionNotNull, false); b.pop(); if (primitiveType == TypeDesc.LONG) { b.loadConstant(1L);
b.ifNullBranch(notNull, false); b.pop(); b.loadNull(); b.branch(done);
b.ifNullBranch(notNull, false); b.pop(); b.loadNull(); b.branch(done);
b.invokeVirtual(INV_IN_TYPE, "readThrowable", THROWABLE_TYPE, null); b.pop();