Skip to content

Commit

Permalink
8253457: Remove unimplemented register stack functions
Browse files Browse the repository at this point in the history
Reviewed-by: iklam, dholmes, shade
  • Loading branch information
coleenp committed Sep 23, 2020
1 parent e4d0e5a commit b8ea80a
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 175 deletions.
12 changes: 1 addition & 11 deletions src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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 @@ -35,16 +35,6 @@
frame pd_last_frame();

public:
void set_base_of_stack_pointer(intptr_t* base_sp) {}
intptr_t* base_of_stack_pointer() { return NULL; }
void record_base_of_stack_pointer() {}

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);

Expand Down
18 changes: 1 addition & 17 deletions src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
Expand Down Expand Up @@ -37,19 +37,10 @@
intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); }
void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); }

void set_base_of_stack_pointer(intptr_t* base_sp) {
}

static ByteSize last_Java_fp_offset() {
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
}

intptr_t* base_of_stack_pointer() {
return NULL;
}
void record_base_of_stack_pointer() {
}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);

Expand All @@ -58,12 +49,5 @@

private:
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
public:

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_BSD_X86_THREAD_BSD_X86_HPP
17 changes: 1 addition & 16 deletions src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -60,15 +60,6 @@
return byte_offset_of(JavaThread, _top_zero_frame);
}

public:
void record_base_of_stack_pointer() {
assert(top_zero_frame() == NULL, "junk on stack prior to Java call");
}
void set_base_of_stack_pointer(intptr_t* base_sp) {
assert(base_sp == NULL, "should be");
assert(top_zero_frame() == NULL, "junk on stack after Java call");
}

public:
void set_last_Java_frame() {
set_last_Java_frame(top_zero_frame(), zero_stack()->sp());
Expand Down Expand Up @@ -110,10 +101,4 @@
return false;
}

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_BSD_ZERO_THREAD_BSD_ZERO_HPP
17 changes: 1 addition & 16 deletions src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -48,19 +48,10 @@
intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); }
void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); }

void set_base_of_stack_pointer(intptr_t* base_sp) {
}

static ByteSize last_Java_fp_offset() {
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
}

intptr_t* base_of_stack_pointer() {
return NULL;
}
void record_base_of_stack_pointer() {
}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);

Expand All @@ -71,10 +62,4 @@

static Thread *aarch64_get_thread_helper();

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_LINUX_AARCH64_THREAD_LINUX_AARCH64_HPP
20 changes: 1 addition & 19 deletions src/hotspot/os_cpu/linux_arm/thread_linux_arm.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2020, 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
Expand Down Expand Up @@ -48,18 +48,6 @@
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
}

void set_base_of_stack_pointer(intptr_t* base_sp) {
// Nothing to do
}

intptr_t* base_of_stack_pointer() {
return NULL;
}

void record_base_of_stack_pointer() {
// Nothing to do
}

static ByteSize heap_top_addr_offset() { return byte_offset_of(JavaThread, _heap_top_addr); }
static ByteSize card_table_base_offset() { return byte_offset_of(JavaThread, _card_table_base); }

Expand All @@ -78,10 +66,4 @@
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
public:

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_LINUX_ARM_THREAD_LINUX_ARM_HPP
12 changes: 1 addition & 11 deletions src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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 @@ -37,16 +37,6 @@

public:

void set_base_of_stack_pointer(intptr_t* base_sp) {}
intptr_t* base_of_stack_pointer() { return NULL; }
void record_base_of_stack_pointer() {}

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);

bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
Expand Down
12 changes: 1 addition & 11 deletions src/hotspot/os_cpu/linux_s390/thread_linux_s390.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -36,16 +36,6 @@
frame pd_last_frame();

public:
void set_base_of_stack_pointer(intptr_t* base_sp) {}
intptr_t* base_of_stack_pointer() { return NULL; }
void record_base_of_stack_pointer() {}

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);

bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
Expand Down
17 changes: 1 addition & 16 deletions src/hotspot/os_cpu/linux_x86/thread_linux_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, 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
Expand Down Expand Up @@ -37,19 +37,10 @@
intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); }
void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); }

void set_base_of_stack_pointer(intptr_t* base_sp) {
}

static ByteSize last_Java_fp_offset() {
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
}

intptr_t* base_of_stack_pointer() {
return NULL;
}
void record_base_of_stack_pointer() {
}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);

Expand All @@ -58,10 +49,4 @@
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);
public:

// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_LINUX_X86_THREAD_LINUX_X86_HPP
18 changes: 1 addition & 17 deletions src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -60,15 +60,6 @@
return byte_offset_of(JavaThread, _top_zero_frame);
}

public:
void record_base_of_stack_pointer() {
assert(top_zero_frame() == NULL, "junk on stack prior to Java call");
}
void set_base_of_stack_pointer(intptr_t* base_sp) {
assert(base_sp == NULL, "should be");
assert(top_zero_frame() == NULL, "junk on stack after Java call");
}

public:
void set_last_Java_frame() {
set_last_Java_frame(top_zero_frame(), zero_stack()->sp());
Expand Down Expand Up @@ -117,11 +108,4 @@
return false; // silence compile warning
}


// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_LINUX_ZERO_THREAD_LINUX_ZERO_HPP
15 changes: 1 addition & 14 deletions src/hotspot/os_cpu/windows_x86/thread_windows_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2020, 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
Expand Down Expand Up @@ -44,16 +44,10 @@
intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); }
void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); }

void set_base_of_stack_pointer(intptr_t* base_sp) {}


static ByteSize last_Java_fp_offset() {
return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
}

intptr_t* base_of_stack_pointer() { return NULL; }
void record_base_of_stack_pointer() {}

bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);

Expand All @@ -64,11 +58,4 @@
private:
bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava);

public:
// These routines are only used on cpu architectures that
// have separate register stacks (Itanium).
static bool register_stack_overflow() { return false; }
static void enable_register_stack_guard() {}
static void disable_register_stack_guard() {}

#endif // OS_CPU_WINDOWS_X86_THREAD_WINDOWS_X86_HPP
9 changes: 0 additions & 9 deletions src/hotspot/share/runtime/javaCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ JavaCallWrapper::JavaCallWrapper(const methodHandle& callee_method, Handle recei
if(clear_pending_exception) {
_thread->clear_pending_exception();
}

if (_anchor.last_Java_sp() == NULL) {
_thread->record_base_of_stack_pointer();
}
}


Expand All @@ -126,11 +122,6 @@ JavaCallWrapper::~JavaCallWrapper() {

debug_only(_thread->dec_java_call_counter());

if (_anchor.last_Java_sp() == NULL) {
_thread->set_base_of_stack_pointer(NULL);
}


// Old thread-local info. has been restored. We are not back in the VM.
ThreadStateTransition::transition_from_java(_thread, _thread_in_vm);

Expand Down
Loading

1 comment on commit b8ea80a

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on b8ea80a Sep 23, 2020

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.