8376703: Some coding in libjimage seems to be not called at all or not called from PRODUCT code

Reviewed-by: alanb, rriggs
This commit is contained in:
Matthias Baesken 2026-02-02 18:49:45 +00:00
parent b60249882c
commit 8023c41690
5 changed files with 4 additions and 73 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -104,6 +104,3 @@ void Endian::set_java(u1* p, u2 x) {
p[1] = x & 0xff;
}
Endian* Endian::get_native_handler() {
return NativeEndian::get_native();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -74,9 +74,6 @@ public:
// Select an appropriate endian handler.
static Endian* get_handler(bool big_endian);
// Return the native endian handler.
static Endian* get_native_handler();
// get platform u2 from Java Big endian
static u2 get_java(u1* x);
// set platform u2 to Java Big endian

View File

@ -111,7 +111,6 @@ protected:
public:
static void image_decompressor_init();
static void image_decompressor_close();
static ImageDecompressor* get_decompressor(const char * decompressor_name) ;
static void decompress_resource(u1* compressed, u1* uncompressed,
u8 uncompressed_size, const ImageStrings* strings, Endian* _endian);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -180,16 +180,6 @@ void ImageFileReaderTable::remove(ImageFileReader* image) {
}
}
// Determine if image entry is in table.
bool ImageFileReaderTable::contains(ImageFileReader* image) {
for (u4 i = 0; i < _count; i++) {
if (_table[i] == image) {
return true;
}
}
return false;
}
// Table to manage multiple opens of an image file.
ImageFileReaderTable ImageFileReader::_reader_table;
@ -261,25 +251,6 @@ void ImageFileReader::close(ImageFileReader *reader) {
}
}
// Return an id for the specified ImageFileReader.
u8 ImageFileReader::reader_to_ID(ImageFileReader *reader) {
// ID is just the cloaked reader address.
return (u8)reader;
}
// Validate the image id.
bool ImageFileReader::id_check(u8 id) {
// Make sure the ID is a managed (_reader_table) reader.
SimpleCriticalSectionLock cs(&_reader_table_lock);
return _reader_table.contains((ImageFileReader*)id);
}
// Return an id for the specified ImageFileReader.
ImageFileReader* ImageFileReader::id_to_reader(u8 id) {
assert(id_check(id) && "invalid image id");
return (ImageFileReader*)id;
}
// Constructor initializes to a closed state.
ImageFileReader::ImageFileReader(const char* name, bool big_endian) {
// Copy the image file name.
@ -372,23 +343,6 @@ bool ImageFileReader::read_at(u1* data, u8 size, u8 offset) const {
return (u8)osSupport::read(_fd, (char*)data, size, offset) == size;
}
// Find the location attributes associated with the path. Returns true if
// the location is found, false otherwise.
bool ImageFileReader::find_location(const char* path, ImageLocation& location) const {
// Locate the entry in the index perfect hash table.
s4 index = ImageStrings::find(_endian, path, _redirect_table, table_length());
// If is found.
if (index != ImageStrings::NOT_FOUND) {
// Get address of first byte of location attribute stream.
u1* data = get_location_data(index);
// Expand location attributes.
location.set_data(data);
// Make sure result is not a false positive.
return verify_location(location, path);
}
return false;
}
// Find the location index and size associated with the path.
// Returns the location index and size if the location is found, 0 otherwise.
u4 ImageFileReader::find_location_index(const char* path, u8 *size) const {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2026, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -375,9 +375,6 @@ public:
// Remove an image entry from the table.
void remove(ImageFileReader* image);
// Determine if image entry is in table.
bool contains(ImageFileReader* image);
};
// Manage the image file.
@ -445,15 +442,6 @@ public:
// Close an image file if the file is not in use elsewhere.
static void close(ImageFileReader *reader);
// Return an id for the specified ImageFileReader.
static u8 reader_to_ID(ImageFileReader *reader);
// Validate the image id.
static bool id_check(u8 id);
// Return an id for the specified ImageFileReader.
static ImageFileReader* id_to_reader(u8 id);
// Open image file for read access.
bool open();
@ -545,10 +533,6 @@ public:
return _endian->get(_offsets_table[index]);
}
// Find the location attributes associated with the path. Returns true if
// the location is found, false otherwise.
bool find_location(const char* path, ImageLocation& location) const;
// Find the location index and size associated with the path.
// Returns the location index and size if the location is found,
// ImageFileReader::NOT_FOUND otherwise.