src/hotspot/share/runtime/sharedRuntime.cpp
changeset 54752 3fbaea4b1f1c
parent 54623 1126f0607c70
child 55105 9ad765641e8f
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54751:5600f5c38b0b 54752:3fbaea4b1f1c
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1374     tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT,
  1374     tty->print_cr(" at pc: " INTPTR_FORMAT " to code: " INTPTR_FORMAT,
  1375                   p2i(caller_frame.pc()), p2i(callee_method->code()));
  1375                   p2i(caller_frame.pc()), p2i(callee_method->code()));
  1376   }
  1376   }
  1377 #endif
  1377 #endif
  1378 
  1378 
  1379   // Do not patch call site for static call to another class
  1379   // Do not patch call site for static call when the class is not
  1380   // when the class is not fully initialized.
  1380   // fully initialized.
  1381   if (invoke_code == Bytecodes::_invokestatic) {
  1381   if (invoke_code == Bytecodes::_invokestatic &&
  1382     if (!callee_method->method_holder()->is_initialized() &&
  1382       !callee_method->method_holder()->is_initialized()) {
  1383         callee_method->method_holder() != caller_nm->method()->method_holder()) {
  1383     assert(callee_method->method_holder()->is_linked(), "must be");
  1384       assert(callee_method->method_holder()->is_linked(), "must be");
  1384     return callee_method;
  1385       return callee_method;
       
  1386     } else {
       
  1387       assert(callee_method->method_holder()->is_initialized() ||
       
  1388              callee_method->method_holder()->is_reentrant_initialization(thread),
       
  1389              "invalid class initialization state for invoke_static");
       
  1390     }
       
  1391   }
  1385   }
  1392 
  1386 
  1393   // JSR 292 key invariant:
  1387   // JSR 292 key invariant:
  1394   // If the resolved method is a MethodHandle invoke target, the call
  1388   // If the resolved method is a MethodHandle invoke target, the call
  1395   // site must be a MethodHandle call site, because the lambda form might tail-call
  1389   // site must be a MethodHandle call site, because the lambda form might tail-call