< prev index next >

src/hotspot/share/runtime/signature.cpp

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1997, 2024, 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) 1997, 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.

*** 457,11 ***
    return true;
  }
  #endif //ASSERT
  
  // returns a symbol; the caller is responsible for decrementing it
! Symbol* SignatureStream::find_symbol() {
    // Create a symbol from for string _begin _end
    int begin = raw_symbol_begin();
    int end   = raw_symbol_end();
  
    const char* symbol_chars = (const char*)_signature->base() + begin;
--- 457,11 ---
    return true;
  }
  #endif //ASSERT
  
  // returns a symbol; the caller is responsible for decrementing it
! Symbol* SignatureStream::find_symbol(bool probe_only) {
    // Create a symbol from for string _begin _end
    int begin = raw_symbol_begin();
    int end   = raw_symbol_end();
  
    const char* symbol_chars = (const char*)_signature->base() + begin;

*** 481,13 ***
    Symbol* name = _previous_name;
    if (name->equals(symbol_chars, len)) {
      return name;
    }
  
    // Save names for cleaning up reference count at the end of
    // SignatureStream scope.
-   name = SymbolTable::new_symbol(symbol_chars, len);
  
    // Only allocate the GrowableArray for the _names buffer if more than
    // one name is being processed in the signature.
    if (!_previous_name->is_permanent()) {
      if (_names == nullptr) {
--- 481,20 ---
    Symbol* name = _previous_name;
    if (name->equals(symbol_chars, len)) {
      return name;
    }
  
+   if (probe_only) {
+     name = SymbolTable::probe(symbol_chars, len);
+     if (name == nullptr) {
+       return nullptr;
+     }
+   } else {
+     name = SymbolTable::new_symbol(symbol_chars, len);
+   }
    // Save names for cleaning up reference count at the end of
    // SignatureStream scope.
  
    // Only allocate the GrowableArray for the _names buffer if more than
    // one name is being processed in the signature.
    if (!_previous_name->is_permanent()) {
      if (_names == nullptr) {
< prev index next >