Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines #3394

Closed
wants to merge 9 commits into from
@@ -309,11 +309,11 @@ class SlowSignatureHandler


JRT_ENTRY(address,
InterpreterRuntime::slow_signature_handler(JavaThread* thread,
InterpreterRuntime::slow_signature_handler(JavaThread* current,
Method* method,
intptr_t* from,
intptr_t* to))
methodHandle m(thread, (Method*)method);
methodHandle m(current, (Method*)method);
assert(m->is_native(), "sanity check");

// handle arguments
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2021, 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
@@ -364,8 +364,8 @@ class SlowSignatureHandler: public NativeSignatureIterator {
}
};

JRT_ENTRY(address, InterpreterRuntime::slow_signature_handler(JavaThread* thread, Method* method, intptr_t* from, intptr_t* to))
methodHandle m(thread, (Method*)method);
JRT_ENTRY(address, InterpreterRuntime::slow_signature_handler(JavaThread* current, Method* method, intptr_t* from, intptr_t* to))
methodHandle m(current, (Method*)method);
assert(m->is_native(), "sanity check");
SlowSignatureHandler(m, (address)from, to).iterate(UCONST64(-1));
return Interpreter::result_handler(m->result_type());
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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.
*
@@ -147,15 +147,15 @@ void SignatureHandlerLibrary::pd_set_handler(address handler) {


// Access function to get the signature.
JRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* thread, Method* method))
methodHandle m(thread, method);
JRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* current, Method* method))
methodHandle m(current, method);
assert(m->is_native(), "sanity check");
Symbol *s = m->signature();
return (address) s->base();
JRT_END

JRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* thread, Method* method))
methodHandle m(thread, method);
JRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* current, Method* method))
methodHandle m(current, method);
assert(m->is_native(), "sanity check");
return AbstractInterpreter::result_handler(m->result_type());
JRT_END
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, 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.
*
@@ -150,15 +150,15 @@ void InterpreterRuntime::SignatureHandlerGenerator::generate(uint64_t fingerprin

void SignatureHandlerLibrary::pd_set_handler(address handler) {}

JRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* thread, Method* method))
methodHandle m(thread, method);
JRT_ENTRY(address, InterpreterRuntime::get_signature(JavaThread* current, Method* method))
methodHandle m(current, method);
assert(m->is_native(), "sanity check");
Symbol *s = m->signature();
return (address) s->base();
JRT_END

JRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* thread, Method* method))
methodHandle m(thread, method);
JRT_ENTRY(address, InterpreterRuntime::get_result_handler(JavaThread* current, Method* method))
methodHandle m(current, method);
assert(m->is_native(), "sanity check");
return AbstractInterpreter::result_handler(m->result_type());
JRT_END
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, 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
@@ -146,8 +146,8 @@ class SlowSignatureHandler: public NativeSignatureIterator {
}
};

JRT_ENTRY(address, InterpreterRuntime::slow_signature_handler(JavaThread* thread, Method* method, intptr_t* from, intptr_t* to))
methodHandle m(thread, (Method*)method);
JRT_ENTRY(address, InterpreterRuntime::slow_signature_handler(JavaThread* current, Method* method, intptr_t* from, intptr_t* to))
methodHandle m(current, (Method*)method);
assert(m->is_native(), "sanity check");
// handle arguments
SlowSignatureHandler(m, (address)from, to + 1).iterate((uint64_t)CONST64(-1));
@@ -496,11 +496,11 @@ class SlowSignatureHandler


JRT_ENTRY(address,
InterpreterRuntime::slow_signature_handler(JavaThread* thread,
InterpreterRuntime::slow_signature_handler(JavaThread* current,
Method* method,
intptr_t* from,
intptr_t* to))
methodHandle m(thread, (Method*)method);
methodHandle m(current, (Method*)method);
assert(m->is_native(), "sanity check");

// handle arguments
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -153,11 +153,11 @@ void InterpreterRuntime::SignatureHandler::finalize() {
}

JRT_ENTRY(address,
InterpreterRuntime::slow_signature_handler(JavaThread* thread,
InterpreterRuntime::slow_signature_handler(JavaThread* current,
Method* method,
intptr_t* unused1,
intptr_t* unused2))
ZeroStack *stack = thread->zero_stack();
ZeroStack *stack = current->zero_stack();

int required_words =
(align_up(sizeof(ffi_cif), wordSize) >> LogBytesPerWord) +
@@ -166,7 +166,7 @@ JRT_ENTRY(address,
stack->overflow_check(required_words, CHECK_NULL);

intptr_t *buf = (intptr_t *) stack->alloc(required_words * wordSize);
SlowSignatureHandlerGenerator sshg(methodHandle(thread, method), buf);
SlowSignatureHandlerGenerator sshg(methodHandle(current, method), buf);
sshg.generate((uint64_t)CONST64(-1));

SignatureHandler *handler = sshg.handler();
Loading