Skip to content

Commit

Permalink
8311180: Remove unused unneeded definitions from globalDefinitions
Browse files Browse the repository at this point in the history
Co-authored-by: Axel Boldt-Christmas <aboldtch@openjdk.org>
Reviewed-by: dholmes, aboldtch
  • Loading branch information
coleenp and xmas92 committed Jul 5, 2023
1 parent cf82e31 commit 22e17c2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/icache_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -44,7 +44,7 @@ class ICache : public AbstractICache {
static void ppc64_flush_icache_bytes(address start, int bytes) {
// Align start address to an icache line boundary and transform
// nbytes to an icache line count.
const uint line_offset = mask_address_bits(start, line_size - 1);
const uint line_offset = (uintptr_t)start & (line_size - 1);
ppc64_flush_icache(start - line_offset, (bytes + line_offset + line_size - 1) >> log2_line_size, 0);
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/oops/markWord.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class markWord {
static const uintptr_t marked_value = 3;

static const uintptr_t no_hash = 0 ; // no hash value assigned
static const uintptr_t no_hash_in_place = (address_word)no_hash << hash_shift;
static const uintptr_t no_hash_in_place = (uintptr_t)no_hash << hash_shift;
static const uintptr_t no_lock_in_place = unlocked_value;

static const uint max_age = age_mask;
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/stackwalk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class BaseFrameStream : public StackObj {
}

jlong address_value() {
return (jlong) castable_address(this);
return (jlong) this;
}

static BaseFrameStream* from_current(JavaThread* thread, jlong magic, objArrayHandle frames_array);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/icache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void AbstractICache::invalidate_range(address start, int nbytes) {
}
// Align start address to an icache line boundary and transform
// nbytes to an icache line count.
const uint line_offset = mask_address_bits(start, ICache::line_size-1);
const uint line_offset = uintptr_t(start) & (ICache::line_size-1);
if (line_offset != 0) {
start -= line_offset;
nbytes += line_offset;
Expand Down
19 changes: 1 addition & 18 deletions src/hotspot/share/utilities/globalDefinitions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,23 +444,6 @@ typedef unsigned int uint; NEEDS_CLEANUP
typedef signed char s_char;
typedef unsigned char u_char;
typedef u_char* address;
typedef uintptr_t address_word; // unsigned integer which will hold a pointer
// except for some implementations of a C++
// linkage pointer to function. Should never
// need one of those to be placed in this
// type anyway.

// Utility functions to "portably" (?) bit twiddle pointers
// Where portable means keep ANSI C++ compilers quiet

inline address set_address_bits(address x, int m) { return address(intptr_t(x) | m); }
inline address clear_address_bits(address x, int m) { return address(intptr_t(x) & ~m); }

// Utility functions to "portably" make cast to/from function pointers.

inline address_word mask_address_bits(address x, int m) { return address_word(x) & m; }
inline address_word castable_address(address x) { return address_word(x) ; }
inline address_word castable_address(void* x) { return address_word(x) ; }

// Pointer subtraction.
// The idea here is to avoid ptrdiff_t, which is signed and so doesn't have
Expand Down Expand Up @@ -503,7 +486,7 @@ inline size_t pointer_delta(const MetaWord* left, const MetaWord* right) {
// many C++ compilers.
//
#define CAST_TO_FN_PTR(func_type, value) (reinterpret_cast<func_type>(value))
#define CAST_FROM_FN_PTR(new_type, func_ptr) ((new_type)((address_word)(func_ptr)))
#define CAST_FROM_FN_PTR(new_type, func_ptr) ((new_type)((uintptr_t)(func_ptr)))

// In many places we've added C-style casts to silence compiler
// warnings, for example when truncating a size_t to an int when we
Expand Down

1 comment on commit 22e17c2

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.