bytekit-core/src/main/java/com/alibaba/bytekit/asm/location/Location.java [419:454]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            super(insnNode, whenComplete);
            this.count = count;
            this.whenComplete = whenComplete;
            this.stackNeedSave = !whenComplete;
        }

        public LocationType getLocationType() {
            if (whenComplete) {
                return LocationType.SYNC_ENTER_COMPLETED;
            } else {
                return LocationType.SYNC_ENTER;
            }
        }

        @Override
        public StackSaver getStackSaver() {
            return new StackSaver() {

                @Override
                public void store(InsnList instructions, BindingContext bindingContext) {
                    LocalVariableNode variableNode = bindingContext.getMethodProcessor().initMonitorVariableNode();
                    AsmOpUtils.storeVar(instructions, AsmOpUtils.OBJECT_TYPE, variableNode.index);
                }

                @Override
                public void load(InsnList instructions, BindingContext bindingContext) {
                    LocalVariableNode variableNode = bindingContext.getMethodProcessor().initMonitorVariableNode();
                    AsmOpUtils.loadVar(instructions, AsmOpUtils.OBJECT_TYPE, variableNode.index);
                }

                @Override
                public Type getType(BindingContext bindingContext) {
                    return AsmOpUtils.OBJECT_TYPE;
                }

            };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



bytekit-core/src/main/java/com/alibaba/bytekit/asm/location/Location.java [469:504]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            super(insnNode, whenComplete);
            this.count = count;
            this.whenComplete = whenComplete;
            this.stackNeedSave = !whenComplete;
        }

        public LocationType getLocationType() {
            if (whenComplete) {
                return LocationType.SYNC_ENTER_COMPLETED;
            } else {
                return LocationType.SYNC_ENTER;
            }
        }

        @Override
        public StackSaver getStackSaver() {
            return new StackSaver() {

                @Override
                public void store(InsnList instructions, BindingContext bindingContext) {
                    LocalVariableNode variableNode = bindingContext.getMethodProcessor().initMonitorVariableNode();
                    AsmOpUtils.storeVar(instructions, AsmOpUtils.OBJECT_TYPE, variableNode.index);
                }

                @Override
                public void load(InsnList instructions, BindingContext bindingContext) {
                    LocalVariableNode variableNode = bindingContext.getMethodProcessor().initMonitorVariableNode();
                    AsmOpUtils.loadVar(instructions, AsmOpUtils.OBJECT_TYPE, variableNode.index);
                }

                @Override
                public Type getType(BindingContext bindingContext) {
                    return AsmOpUtils.OBJECT_TYPE;
                }

            };
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



