public Accessor optimizeObjectCreation(ParserContext pCtx, char[] property, int start, int offset, Object ctx,
                                         Object thisRef, VariableResolverFactory factory) {
    _initJIT();

    compiledInputs = new ArrayList<ExecutableStatement>();
    this.start = cursor = start;
    this.end = start + offset;
    this.length = this.end - this.start;
    this.ctx = ctx;
    this.thisRef = thisRef;
    this.variableFactory = factory;
    this.pCtx = pCtx;

    String[] cnsRes = captureContructorAndResidual(property, start, offset);
    List<char[]> constructorParms = parseMethodOrConstructor(cnsRes[0].toCharArray());

    try {
      if (constructorParms != null) {
        for (char[] constructorParm : constructorParms) {
          compiledInputs.add((ExecutableStatement) subCompileExpression(constructorParm, pCtx));
        }

        Class cls = findClass(factory, new String(subset(property, 0, findFirst('(', start, length, property))), pCtx);

        assert debug("NEW " + getInternalName(cls));
        mv.visitTypeInsn(NEW, getInternalName(cls));
        assert debug("DUP");
        mv.visitInsn(DUP);

        Object[] parms = new Object[constructorParms.size()];

        int i = 0;
        for (ExecutableStatement es : compiledInputs) {
          parms[i++] = es.getValue(ctx, factory);
        }

        Constructor cns = getBestConstructorCandidate(parms, cls, pCtx.isStrongTyping());

        if (cns == null) {
          StringBuilder error = new StringBuilder();
          for (int x = 0; x < parms.length; x++) {
            error.append(parms[x].getClass().getName());
            if (x + 1 < parms.length) error.append(", ");
          }

          throw new CompileException("unable to find constructor: " + cls.getName()
              + "(" + error.toString() + ")", expr, st);
        }

        this.returnType = cns.getDeclaringClass();

        Class tg;
        for (i = 0; i < constructorParms.size(); i++) {
          assert debug("ALOAD 0");
          mv.visitVarInsn(ALOAD, 0);
          assert debug("GETFIELD p" + i);
          mv.visitFieldInsn(GETFIELD, className, "p" + i, "L" + NAMESPACE + "compiler/ExecutableStatement;");
          assert debug("ALOAD 2");
          mv.visitVarInsn(ALOAD, 2);
          assert debug("ALOAD 3");
          mv.visitVarInsn(ALOAD, 3);
          assert debug("INVOKEINTERFACE " + NAMESPACE + "compiler/ExecutableStatement.getValue");
          mv.visitMethodInsn(INVOKEINTERFACE, "" + NAMESPACE
              + "compiler/ExecutableStatement", "getValue", "(Ljava/lang/Object;L" + NAMESPACE
              + "integration/VariableResolverFactory;)Ljava/lang/Object;");

          tg = cns.getParameterTypes()[i].isPrimitive()
              ? getWrapperClass(cns.getParameterTypes()[i]) : cns.getParameterTypes()[i];

          if (parms[i] != null && !parms[i].getClass().isAssignableFrom(cns.getParameterTypes()[i])) {
            ldcClassConstant(tg);

            assert debug("INVOKESTATIC " + NAMESPACE + "DataConversion.convert");
            mv.visitMethodInsn(INVOKESTATIC, "" + NAMESPACE + "DataConversion", "convert",
                "(Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;");

            if (cns.getParameterTypes()[i].isPrimitive()) {
              unwrapPrimitive(cns.getParameterTypes()[i]);
            }
            else {
              assert debug("CHECKCAST " + getInternalName(tg));
              mv.visitTypeInsn(CHECKCAST, getInternalName(tg));
            }

          }
          else {
            assert debug("CHECKCAST " + getInternalName(cns.getParameterTypes()[i]));
            mv.visitTypeInsn(CHECKCAST, getInternalName(cns.getParameterTypes()[i]));
          }

        }

        assert debug("INVOKESPECIAL " + getInternalName(cls) + ".<init> : " + getConstructorDescriptor(cns));
        mv.visitMethodInsn(INVOKESPECIAL, getInternalName(cls), "<init>", getConstructorDescriptor(cns));

        _finishJIT();

        Accessor acc = _initializeAccessor();

        if (cnsRes.length > 1 && cnsRes[1] != null && !cnsRes[1].trim().equals("")) {
          return new Union(pCtx, acc, cnsRes[1].toCharArray(), 0, cnsRes[1].length());
        }

        return acc;
      }
      else {
        Class cls = findClass(factory, new String(property), pCtx);

        assert debug("NEW " + getInternalName(cls));
        mv.visitTypeInsn(NEW, getInternalName(cls));
        assert debug("DUP");
        mv.visitInsn(DUP);

        Constructor cns = cls.getConstructor(EMPTYCLS);

        assert debug("INVOKESPECIAL <init>");

        mv.visitMethodInsn(INVOKESPECIAL, getInternalName(cls), "<init>", getConstructorDescriptor(cns));

        _finishJIT();
        Accessor acc = _initializeAccessor();

        if (cnsRes.length > 1 && cnsRes[1] != null && !cnsRes[1].trim().equals("")) {
          return new Union(pCtx, acc, cnsRes[1].toCharArray(), 0, cnsRes[1].length());
        }

        return acc;
      }
    }
    catch (ClassNotFoundException e) {
      throw new CompileException("class or class reference not found: "
          + new String(property), property, st);
    }
    catch (Exception e) {
      throw new OptimizationFailure("could not optimize construtor: " + new String(property), e);
    }
  }