Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/prims/methodHandles.cpp
          +++ new/src/share/vm/prims/methodHandles.cpp
↓ open down ↓ 3172 lines elided ↑ open up ↑
3173 3173  
3174 3174    {
3175 3175      ThreadToNativeFromVM ttnfv(thread);
3176 3176      int status = env->RegisterNatives(MHN_class, methods, sizeof(methods)/sizeof(JNINativeMethod));
3177 3177      if (!env->ExceptionOccurred()) {
3178 3178        const char* L_MH_name = (JLINV "MethodHandle");
3179 3179        const char* MH_name = L_MH_name+1;
3180 3180        jclass MH_class = env->FindClass(MH_name);
3181 3181        status = env->RegisterNatives(MH_class, invoke_methods, sizeof(invoke_methods)/sizeof(JNINativeMethod));
3182 3182      }
     3183 +    if (!env->ExceptionOccurred()) {
     3184 +      status = env->RegisterNatives(MHN_class, call_site_methods, sizeof(call_site_methods)/sizeof(JNINativeMethod));
     3185 +    }
3183 3186      if (env->ExceptionOccurred()) {
3184 3187        warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
3185 3188        enable_MH = false;
3186 3189        env->ExceptionClear();
3187 3190      }
3188 3191  
3189      -    status = env->RegisterNatives(MHN_class, call_site_methods, sizeof(call_site_methods)/sizeof(JNINativeMethod));
3190      -    if (env->ExceptionOccurred()) {
3191      -      // Exception is okay until 7087357
3192      -      env->ExceptionClear();
3193      -    }
3194 3192    }
3195 3193  
3196 3194    if (enable_MH) {
3197 3195      methodOop raiseException_method = MethodHandles::resolve_raise_exception_method(CHECK);
3198 3196      if (raiseException_method != NULL) {
3199 3197        MethodHandles::set_raise_exception_method(raiseException_method);
3200 3198      } else {
3201 3199        warning("JSR 292 method handle code is mismatched to this JVM.  Disabling support.");
3202 3200        enable_MH = false;
3203 3201      }
3204 3202    }
3205 3203  
3206 3204    if (enable_MH) {
3207 3205      MethodHandles::generate_adapters();
3208 3206      MethodHandles::set_enabled(true);
3209 3207    }
3210 3208  }
3211 3209  JVM_END
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX