mirror of
https://github.com/openjdk/jdk.git
synced 2026-08-03 06:35:31 +00:00
8293011: riscv: Duplicated stubs to interpreter for static calls
Reviewed-by: fyang
This commit is contained in:
parent
6076128996
commit
17283cfe4c
32
src/hotspot/cpu/riscv/codeBuffer_riscv.cpp
Normal file
32
src/hotspot/cpu/riscv/codeBuffer_riscv.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright (c) 2022, Institute of Software, Chinese Academy of Sciences. 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "asm/codeBuffer.inline.hpp"
|
||||
#include "asm/macroAssembler.hpp"
|
||||
|
||||
bool CodeBuffer::pd_finalize_stubs() {
|
||||
return emit_shared_stubs_to_interp<MacroAssembler>(this, _shared_stub_to_interp_requests);
|
||||
}
|
||||
@ -29,15 +29,10 @@
|
||||
|
||||
private:
|
||||
void pd_initialize() {}
|
||||
bool pd_finalize_stubs() {
|
||||
if (_finalize_stubs) {
|
||||
Unimplemented();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool pd_finalize_stubs();
|
||||
|
||||
public:
|
||||
void flush_bundle(bool start_new_bundle) {}
|
||||
static constexpr bool supports_shared_stubs() { return false; }
|
||||
static constexpr bool supports_shared_stubs() { return true; }
|
||||
|
||||
#endif // CPU_RISCV_CODEBUFFER_RISCV_HPP
|
||||
|
||||
@ -2284,11 +2284,17 @@ encode %{
|
||||
return;
|
||||
}
|
||||
|
||||
// Emit stub for static call
|
||||
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
|
||||
if (stub == NULL) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
if (CodeBuffer::supports_shared_stubs() && _method->can_be_statically_bound()) {
|
||||
// Calls of the same statically bound method can share
|
||||
// a stub to the interpreter.
|
||||
cbuf.shared_stub_to_interp_for(_method, cbuf.insts()->mark_off());
|
||||
} else {
|
||||
// Emit stub for static call
|
||||
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf);
|
||||
if (stub == NULL) {
|
||||
ciEnv::current()->record_failure("CodeCache is full");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
* @bug 8280481
|
||||
* @library /test/lib
|
||||
*
|
||||
* @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="i386" | os.arch=="x86" | os.arch=="aarch64"
|
||||
* @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="i386" | os.arch=="x86" | os.arch=="aarch64" | os.arch=="riscv64"
|
||||
*
|
||||
* @run driver compiler.sharedstubs.SharedStubToInterpTest
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user