private <T> void genCreateObject(
            MethodWriter mw,
            ObjectReadContext context,
            String classNameType
    ) {
        Constructor defaultConstructor = context.defaultConstructor;
        Supplier creator = context.objectReaderAdapter.creator;
        Class objectClass = context.objectClass;

        int objectModifiers = objectClass == null ? Modifier.PUBLIC : objectClass.getModifiers();
        boolean publicObject = Modifier.isPublic(objectModifiers) && (objectClass == null || !classLoader.isExternalClass(objectClass));

        if (defaultConstructor == null || !publicObject || !Modifier.isPublic(defaultConstructor.getModifiers())) {
            if (creator != null) {
                mw.aload(THIS);
                mw.getfield(classNameType, "creator", "Ljava/util/function/Supplier;");
                mw.invokeinterface("java/util/function/Supplier", "get", "()Ljava/lang/Object;");
            } else {
                mw.aload(THIS);
                mw.aload(JSON_READER);
                mw.lload(FEATURES);
                mw.invokevirtual(TYPE_JSON_READER, "features", "(J)J");
                mw.invokevirtual(classNameType, "createInstance", "(J)Ljava/lang/Object;");
            }
            if (publicObject) {
                mw.checkcast(context.objectType);
            }
        } else {
            newObject(mw, context.objectType, context.defaultConstructor);
        }

        if (context.hasStringField) {
            /*
             * if ((features & JSONReader.Feature.InitStringFieldAsEmpty.mask) != 0) {
             *    this.initStringFieldAsEmpty(object);
             * }
             */
            Label L0 = new Label();
            mw.lload(FEATURES);
            mw.visitLdcInsn(JSONReader.Feature.InitStringFieldAsEmpty.mask);
            mw.land();
            mw.lconst_0();
            mw.lcmp();
            mw.ifeq(L0);

            mw.dup();
            mw.aload(THIS);
            mw.swap();
            mw.invokevirtual(classNameType, "initStringFieldAsEmpty", "(Ljava/lang/Object;)V");
            mw.visitLabel(L0);
        }
    }
<blockquote><pre>
     class Bean {
         private String field1;
         private int field2;
     }

     public void readJSONBObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {
         features = jsonReader.features(features);
         if (nextIfNull()) {
             return null;
         }

         jsonReader.errorOnNoneSerializable(this.objectClass);

         if (jsonReader.isArray() && jsonReader.isSupportBeanArray()) {
             return readArrayMappingObject(jsonReader, fieldType, fieldName, features);
         }

         Bean object = new Bean();

         jsonReader.nextIfObjectStart();

         for (;;) {
             if (jsonReader.nextIfObjectEnd()) {
                 break;
             }
             switch(jsonReader.getRawInt()) {
                 case field1NameHash32:
                     if(jsonReader.nextIfName4Match2()) {
                         object.field1 = jsonReader.readString();
                         break;
                     }
                     goto hashCode64Start;
                 case field2NameHash32:
                     if(jsonReader.nextIfName4Match2()) {
                         object.field2 = jsonReader.readInt();
                         break;
                     }
                     goto hashCode64Start;
                 default:
                     goto hashCode64Start;
             }

             hashCode64Start:
             long hashCode64 = readFieldNameHashCode();

             if (this.typeKeyHashCode == hashCode64) {
                 object = this.autoType(jsonReader);
             }

             switch(jsonReader.getFieldOrdinal(hashCode64)) {
                 case 0:
                     object.field1 = jsonReader.readString();
             }
         }


     }
 </pre></blockquote>
core/src/main/java/com/alibaba/fastjson2/reader/ObjectReaderCreatorASM.java