src/hotspot/share/runtime/sharedRuntime.cpp
changeset 53965 86ee52ca11e3
parent 53315 3d4e47348142
child 53971 1019c97e1bde
equal deleted inserted replaced
53964:393348e562c1 53965:86ee52ca11e3
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, 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 when the class is not
  1379   // Do not patch call site for static call to another class
  1380   // fully initialized.
  1380   // when the class is not fully initialized.
  1381   if (invoke_code == Bytecodes::_invokestatic &&
  1381   if (invoke_code == Bytecodes::_invokestatic &&
  1382       !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;
  1385   }
  1386   }
       
  1387   assert(callee_method->method_holder()->is_initialized() ||
       
  1388          callee_method->method_holder()->is_reentrant_initialization(thread),
       
  1389          "invalid class initalization state");
  1386 
  1390 
  1387   // JSR 292 key invariant:
  1391   // JSR 292 key invariant:
  1388   // If the resolved method is a MethodHandle invoke target, the call
  1392   // If the resolved method is a MethodHandle invoke target, the call
  1389   // site must be a MethodHandle call site, because the lambda form might tail-call
  1393   // site must be a MethodHandle call site, because the lambda form might tail-call
  1390   // leaving the stack in a state unknown to either caller or callee
  1394   // leaving the stack in a state unknown to either caller or callee