Skip to content
Permalink
Browse files
8263709: Cleanup THREAD/TRAPS/CHECK usage in JRT_ENTRY routines
Reviewed-by: coleenp, hseigel, iklam, kvn
  • Loading branch information
David Holmes committed Apr 15, 2021
1 parent f4c3efd commit 79bff21b439df19f0144f7b2d65884de662e58b9
@@ -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();

1 comment on commit 79bff21

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 79bff21 Apr 15, 2021

Please sign in to comment.