< prev index next >

src/hotspot/share/oops/cpCache.cpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1998, 2025, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.
--- 1,7 ---
  /*
!  * Copyright (c) 1998, 2026, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 209,10 ***
--- 209,11 ---
        // case, the method gets reresolved with caller for each interface call
        // because the actual selected method may not be public.
        //
        // We set bytecode_2() to _invokevirtual.
        // See also interpreterRuntime.cpp. (8/25/2000)
+       invoke_code = Bytecodes::_invokevirtual;
      } else {
        assert(invoke_code == Bytecodes::_invokevirtual ||
               (invoke_code == Bytecodes::_invokeinterface &&
                ((method->is_private() ||
                  (method->is_final() && method->method_holder() == vmClasses::Object_klass())))),

*** 224,11 ***
          // We set bytecode_2() to _invokevirtual.
          method_entry->set_bytecode1(invoke_code);
        }
      }
      // set up for invokevirtual, even if linking for invokeinterface also:
!     method_entry->set_bytecode2(Bytecodes::_invokevirtual);
    } else {
      ShouldNotReachHere();
    }
  }
  
--- 225,11 ---
          // We set bytecode_2() to _invokevirtual.
          method_entry->set_bytecode1(invoke_code);
        }
      }
      // set up for invokevirtual, even if linking for invokeinterface also:
!     method_entry->set_bytecode2(invoke_code);
    } else {
      ShouldNotReachHere();
    }
  }
  

*** 274,11 ***
  
    // Lock fields to write
    Bytecodes::Code invoke_code = Bytecodes::_invokehandle;
  
    JavaThread* current = JavaThread::current();
!   objArrayHandle resolved_references(current, constant_pool()->resolved_references());
    // Use the resolved_references() lock for this cpCache entry.
    // resolved_references are created for all classes with Invokedynamic, MethodHandle
    // or MethodType constant pool cache entries.
    assert(resolved_references() != nullptr,
           "a resolved_references array should have been created for this class");
--- 275,11 ---
  
    // Lock fields to write
    Bytecodes::Code invoke_code = Bytecodes::_invokehandle;
  
    JavaThread* current = JavaThread::current();
!   refArrayHandle resolved_references(current, constant_pool()->resolved_references());
    // Use the resolved_references() lock for this cpCache entry.
    // resolved_references are created for all classes with Invokedynamic, MethodHandle
    // or MethodType constant pool cache entries.
    assert(resolved_references() != nullptr,
           "a resolved_references array should have been created for this class");

*** 755,11 ***
    // resolved_references are created for all classes with Invokedynamic, MethodHandle
    // or MethodType constant pool cache entries.
    JavaThread* current = JavaThread::current();
    constantPoolHandle cp(current, constant_pool());
  
!   objArrayHandle resolved_references(current, cp->resolved_references());
    assert(resolved_references() != nullptr,
           "a resolved_references array should have been created for this class");
    ObjectLocker ol(resolved_references, current);
    assert(index >= 0, "Indy index must be positive at this point");
  
--- 756,11 ---
    // resolved_references are created for all classes with Invokedynamic, MethodHandle
    // or MethodType constant pool cache entries.
    JavaThread* current = JavaThread::current();
    constantPoolHandle cp(current, constant_pool());
  
!   refArrayHandle resolved_references(current, cp->resolved_references());
    assert(resolved_references() != nullptr,
           "a resolved_references array should have been created for this class");
    ObjectLocker ol(resolved_references, current);
    assert(index >= 0, "Indy index must be positive at this point");
  
< prev index next >