关于switch

源码:

boolean fCompressable;
		com.tangosol.io.WriteBuffer.BufferOutput out;
		if (dfl != 0.0D || !isSkippable()) {
			fCompressable = isCompressable();
			encodePosition(iPos);
			out = m_out;
 
			if (isTypeIdEncoded(-6)) {
				try {
					long nBits = Double.doubleToLongBits(dfl);
					if ((nBits & 0xffffffffffffL) == 0L && fCompressable) {
						switch ((int) (nBits >>> 48)) {
						case 65520:
							out.writePackedInt(-39);
							break;
						case 32752:
							out.writePackedInt(-38);
							break;
						case 32760:
							out.writePackedInt(-40);
							break;
						case 49136:
						case 16438:
						case 16437:
						case 16436:
						case 16435:
						case 16434:
						case 16433:
						case 16432:
						case 16430:
						case 16428:
						case 16426:
						case 16424:
						case 16422:
						case 16420:
						case 16418:
						case 16416:
						case 16412:
						case 16408:
						case 16404:
						case 16400:
						case 16392:
						case 16384:
						case 16368:
						case 0:
							out.writePackedInt(-42 - (int) dfl);
							break;
						}
						out.writePackedInt(-6);
						out.writeLong(nBits);
					}
					out.writeDouble(dfl);
				} catch (IOException e) {
					throw ensureRuntimeException(e);
				}
			}
		}

反编译后:

 boolean fCompressable;
        com.tangosol.io.WriteBuffer.BufferOutput out;
        if(dfl == 0.0D && isSkippable())
            break MISSING_BLOCK_LABEL_383;
        fCompressable = isCompressable();
        encodePosition(iPos);
        out = m_out;
        if(!isTypeIdEncoded(-6)) goto _L2; else goto _L1
_L1:
        long nBits;
        nBits = Double.doubleToLongBits(dfl);
        if((nBits & 0xffffffffffffL) != 0L || !fCompressable)
            break MISSING_BLOCK_LABEL_343;
        (int)(nBits >>> 48);
        JVM INSTR lookupswitch 27: default 343
    //                   0: 328
    //                   16368: 328
    //                   16384: 328
    //                   16392: 328
    //                   16400: 328
    //                   16404: 328
    //                   16408: 328
    //                   16412: 328
    //                   16416: 328
    //                   16418: 328
    //                   16420: 328
    //                   16422: 328
    //                   16424: 328
    //                   16426: 328
    //                   16428: 328
    //                   16430: 328
    //                   16432: 328
    //                   16433: 328
    //                   16434: 328
    //                   16435: 328
    //                   16436: 328
    //                   16437: 328
    //                   16438: 328
    //                   32752: 304
    //                   32760: 316
    //                   49136: 328
    //                   65520: 292;
           goto _L3 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L5 _L6 _L4 _L7
_L3:
        break MISSING_BLOCK_LABEL_343;
_L7:
        out.writePackedInt(-39);
        break MISSING_BLOCK_LABEL_383;
_L5:
        try
        {
            out.writePackedInt(-38);
        }
        catch(IOException e)
        {
            throw ensureRuntimeException(e);
        }
        break MISSING_BLOCK_LABEL_383;
_L6:
        out.writePackedInt(-40);
        break MISSING_BLOCK_LABEL_383;
_L4:
        out.writePackedInt(-42 - (int)dfl);
        break MISSING_BLOCK_LABEL_383;
        out.writePackedInt(-6);
        out.writeLong(nBits);
        break MISSING_BLOCK_LABEL_383;
_L2:
        out.writeDouble(dfl);
 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值