hotspot/src/share/vm/interpreter/bytecodes.cpp
changeset 46620 750c6edff33b
parent 37480 291ee208fb72
child 46625 edefffab74e2
equal deleted inserted replaced
46619:a3919f5e8d2b 46620:750c6edff33b
    91     if (end != NULL && bcp + 1 >= end) {
    91     if (end != NULL && bcp + 1 >= end) {
    92       return -1; // don't read past end of code buffer
    92       return -1; // don't read past end of code buffer
    93     }
    93     }
    94     return wide_length_for(cast(*(bcp + 1)));
    94     return wide_length_for(cast(*(bcp + 1)));
    95   case _tableswitch:
    95   case _tableswitch:
    96     { address aligned_bcp = (address)round_to((intptr_t)bcp + 1, jintSize);
    96     { address aligned_bcp = align_up(bcp + 1, jintSize);
    97       if (end != NULL && aligned_bcp + 3*jintSize >= end) {
    97       if (end != NULL && aligned_bcp + 3*jintSize >= end) {
    98         return -1; // don't read past end of code buffer
    98         return -1; // don't read past end of code buffer
    99       }
    99       }
   100       jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
   100       jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
   101       jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize);
   101       jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize);
   106     }
   106     }
   107 
   107 
   108   case _lookupswitch:      // fall through
   108   case _lookupswitch:      // fall through
   109   case _fast_binaryswitch: // fall through
   109   case _fast_binaryswitch: // fall through
   110   case _fast_linearswitch:
   110   case _fast_linearswitch:
   111     { address aligned_bcp = (address)round_to((intptr_t)bcp + 1, jintSize);
   111     { address aligned_bcp = align_up(bcp + 1, jintSize);
   112       if (end != NULL && aligned_bcp + 2*jintSize >= end) {
   112       if (end != NULL && aligned_bcp + 2*jintSize >= end) {
   113         return -1; // don't read past end of code buffer
   113         return -1; // don't read past end of code buffer
   114       }
   114       }
   115       jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize);
   115       jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize);
   116       jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize;
   116       jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize;