Skip to content

Commit

Permalink
Merge branch 'master' into generation_type
Browse files Browse the repository at this point in the history
  • Loading branch information
ysramakrishna committed Feb 14, 2024
2 parents 7167d6e + b823fa4 commit bce39e4
Show file tree
Hide file tree
Showing 426 changed files with 7,349 additions and 10,179 deletions.
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ version=0
domain=openjdk.org

[checks "whitespace"]
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.gmk|.*\.m4|.*\.ac|Makefile
files=.*\.cpp|.*\.hpp|.*\.c|.*\.h|.*\.java|.*\.cc|.*\.hh|.*\.m|.*\.mm|.*\.md|.*\.properties|.*\.gmk|.*\.m4|.*\.ac|Makefile
ignore-tabs=.*\.gmk|Makefile

[checks "merge"]
Expand Down
31 changes: 21 additions & 10 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ <h3 id="linux">Linux</h3>
<p>The basic tooling is provided as part of the core operating system,
but you will most likely need to install developer packages.</p>
<p>For apt-based distributions (Debian, Ubuntu, etc), try this:</p>
<pre><code>sudo apt-get install build-essential</code></pre>
<pre><code>sudo apt-get install build-essential autoconf</code></pre>
<p>For rpm-based distributions (Fedora, Red Hat, etc), try this:</p>
<pre><code>sudo yum groupinstall &quot;Development Tools&quot;</code></pre>
<p>For Alpine Linux, aside from basic tooling, install the GNU versions
Expand Down Expand Up @@ -2166,15 +2166,26 @@ <h3 id="using-multiple-configurations">Using Multiple
<code>configure</code> from there, e.g.
<code>mkdir build/&lt;name&gt; &amp;&amp; cd build/&lt;name&gt; &amp;&amp; bash ../../configure</code>.</p>
<p>Then you can build that configuration using
<code>make CONF_NAME=&lt;name&gt;</code> or
<code>make CONF=&lt;pattern&gt;</code>, where
<code>&lt;pattern&gt;</code> is a substring matching one or several
configurations, e.g. <code>CONF=debug</code>. The special empty pattern
(<code>CONF=</code>) will match <em>all</em> available configuration, so
<code>make CONF= hotspot</code> will build the <code>hotspot</code>
target for all configurations. Alternatively, you can execute
<code>make</code> in the configuration directory, e.g.
<code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
<code>make CONF=&lt;selector&gt;</code>, where
<code>&lt;selector&gt;</code> is interpreted as follows:</p>
<ul>
<li>If <code>&lt;selector&gt;</code> exacly matches the name of a
configuration, this and only this configuration will be selected.</li>
<li>If <code>&lt;selector&gt;</code> matches (i.e. is a substring of)
the names of several configurations, then all these configurations will
be selected.</li>
<li>If <code>&lt;selector&gt;</code> is empty (i.e. <code>CONF=</code>),
then all configurations will be selected.</li>
<li>If <code>&lt;selector&gt;</code> begins with <code>!</code>, then
all configurations <strong>not</strong> matching the string following
<code>!</code> will be selected.</li>
</ul>
<p>A more specialized version, <code>CONF_NAME=&lt;name&gt;</code> also
exists, which will only match if the given <code>&lt;name&gt;</code>
exactly matches a single configuration.</p>
<p>Alternatively, you can execute <code>make</code> in the configuration
directory, e.g. <code>cd build/&lt;name&gt; &amp;&amp; make</code>.</p>
<p><code>make CONF_NAME=&lt;name&gt;</code> or</p>
<h3 id="handling-reconfigurations">Handling Reconfigurations</h3>
<p>If you update the repository and part of the configure script has
changed, the build system will force you to re-run
Expand Down
27 changes: 20 additions & 7 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ will most likely need to install developer packages.
For apt-based distributions (Debian, Ubuntu, etc), try this:

```
sudo apt-get install build-essential
sudo apt-get install build-essential autoconf
```

For rpm-based distributions (Fedora, Red Hat, etc), try this:
Expand Down Expand Up @@ -1952,12 +1952,25 @@ configuration with the name `<name>`. Alternatively, you can create a directory
under `build` and run `configure` from there, e.g. `mkdir build/<name> && cd
build/<name> && bash ../../configure`.
Then you can build that configuration using `make CONF_NAME=<name>` or `make
CONF=<pattern>`, where `<pattern>` is a substring matching one or several
configurations, e.g. `CONF=debug`. The special empty pattern (`CONF=`) will
match *all* available configuration, so `make CONF= hotspot` will build the
`hotspot` target for all configurations. Alternatively, you can execute `make`
in the configuration directory, e.g. `cd build/<name> && make`.
Then you can build that configuration using `make CONF=<selector>`, where
`<selector>` is interpreted as follows:
* If `<selector>` exacly matches the name of a configuration, this and only
this configuration will be selected.
* If `<selector>` matches (i.e. is a substring of) the names of several
configurations, then all these configurations will be selected.
* If `<selector>` is empty (i.e. `CONF=`), then all configurations will be
selected.
* If `<selector>` begins with `!`, then all configurations **not** matching the
string following `!` will be selected.
A more specialized version, `CONF_NAME=<name>` also exists, which will only
match if the given `<name>` exactly matches a single configuration.
Alternatively, you can execute `make` in the configuration directory, e.g. `cd
build/<name> && make`.
`make CONF_NAME=<name>` or
### Handling Reconfigurations
Expand Down
7 changes: 3 additions & 4 deletions make/Global.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ help:
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
$(info )
$(info Make control variables)
$(info $(_) CONF= # Build all configurations (note, assignment is empty))
$(info $(_) CONF=<substring> # Build the configuration(s) with a name matching)
$(info $(_) # <substring>)
$(info $(_) CONF_NAME=<string> # Build the configuration with exactly the <string>)
$(info $(_) CONF=<selector> # Select which configuration(s) to build)
$(info $(_) CONF= # Select all configurations (note, assignment is empty))
$(info $(_) CONF_NAME=<string> # Select the configuration with the name <string>)
$(info $(_) SPEC=<spec file> # Build the configuration given by the spec file)
$(info $(_) LOG=<loglevel> # Change the log level from warn to <loglevel>)
$(info $(_) # Available log levels are:)
Expand Down
10 changes: 8 additions & 2 deletions make/InitSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,14 @@ ifeq ($(HAS_SPEC),)
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
ifeq ($$(patsubst !%,,$$(CONF)),)
# A CONF starting with ! means we should negate the search term
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
else
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
endif
ifneq ($$(filter $$(CONF), $$(matching_confs)), )
# If we found an exact match, use that
matching_confs := $$(CONF)
Expand Down
8 changes: 1 addition & 7 deletions make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2024, 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 @@ -1181,12 +1181,6 @@ var getJibProfilesDependencies = function (input, common) {
revision: (input.build_cpu == "x64" ? "Xcode11.3.1-MacOSX10.15+1.2" : devkit_platform_revisions[devkit_platform])
},

cups: {
organization: common.organization,
ext: "tar.gz",
revision: "1.0118+1.0"
},

jtreg: {
server: "jpg",
product: "jtreg",
Expand Down
34 changes: 13 additions & 21 deletions src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2205,14 +2205,14 @@ void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
{
st->print_cr("# MachUEPNode");
if (UseCompressedClassPointers) {
st->print_cr("\tldrw rscratch1, j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
if (CompressedKlassPointers::shift() != 0) {
st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
}
st->print_cr("\tldrw rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
st->print_cr("\tldrw r10, [rscratch2 + CompiledICData::speculated_klass_offset()]\t# compressed klass");
st->print_cr("\tcmpw rscratch1, r10");
} else {
st->print_cr("\tldr rscratch1, j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
st->print_cr("\tldr rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
st->print_cr("\tldr r10, [rscratch2 + CompiledICData::speculated_klass_offset()]\t# compressed klass");
st->print_cr("\tcmp rscratch1, r10");
}
st->print_cr("\tcmp r0, rscratch1\t # Inline cache check");
st->print_cr("\tbne, SharedRuntime::_ic_miss_stub");
}
#endif
Expand All @@ -2221,14 +2221,7 @@ void MachUEPNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
{
// This is the unverified entry point.
C2_MacroAssembler _masm(&cbuf);

__ cmp_klass(j_rarg0, rscratch2, rscratch1);
Label skip;
// TODO
// can we avoid this skip and still use a reloc?
__ br(Assembler::EQ, skip);
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
__ bind(skip);
__ ic_check(InteriorEntryAlignment);
}

uint MachUEPNode::size(PhaseRegAlloc* ra_) const
Expand Down Expand Up @@ -2582,7 +2575,7 @@ Assembler::Condition to_assembler_cond(BoolTest::mask cond) {
}

// Binary src (Replicate con)
bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
static bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
if (n == nullptr || m == nullptr) {
return false;
}
Expand Down Expand Up @@ -2623,7 +2616,7 @@ bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {

// (XorV src (Replicate m1))
// (XorVMask src (MaskAll m1))
bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
static bool is_vector_bitwise_not_pattern(Node* n, Node* m) {
if (n != nullptr && m != nullptr) {
return (n->Opcode() == Op_XorV || n->Opcode() == Op_XorVMask) &&
VectorNode::is_all_ones_vector(m);
Expand Down Expand Up @@ -3715,7 +3708,7 @@ encode %{
cbuf.shared_stub_to_interp_for(_method, call - cbuf.insts_begin());
} else {
// Emit stub for static call
address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, call);
address stub = CompiledDirectCall::emit_to_interp_stub(cbuf, call);
if (stub == nullptr) {
ciEnv::current()->record_failure("CodeCache is full");
return;
Expand Down Expand Up @@ -8289,7 +8282,7 @@ instruct membar_acquire() %{
ins_cost(VOLATILE_REF_COST);

format %{ "membar_acquire\n\t"
"dmb ishld" %}
"dmb ish" %}

ins_encode %{
__ block_comment("membar_acquire");
Expand Down Expand Up @@ -8343,12 +8336,11 @@ instruct membar_release() %{
ins_cost(VOLATILE_REF_COST);

format %{ "membar_release\n\t"
"dmb ishst\n\tdmb ishld" %}
"dmb ish" %}

ins_encode %{
__ block_comment("membar_release");
__ membar(Assembler::StoreStore);
__ membar(Assembler::LoadStore);
__ membar(Assembler::LoadStore|Assembler::StoreStore);
%}
ins_pipe(pipe_serial);
%}
Expand Down
25 changes: 2 additions & 23 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#endif

NEEDS_CLEANUP // remove this definitions ?
const Register IC_Klass = rscratch2; // where the IC klass is cached
const Register SYNC_header = r0; // synchronization header
const Register SHIFT_count = r0; // where count for shift operations must be

Expand Down Expand Up @@ -293,27 +292,7 @@ void LIR_Assembler::osr_entry() {

// inline cache check; done before the frame is built.
int LIR_Assembler::check_icache() {
Register receiver = FrameMap::receiver_opr->as_register();
Register ic_klass = IC_Klass;
int start_offset = __ offset();
__ inline_cache_check(receiver, ic_klass);

// if icache check fails, then jump to runtime routine
// Note: RECEIVER must still contain the receiver!
Label dont;
__ br(Assembler::EQ, dont);
__ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));

// We align the verified entry point unless the method body
// (including its inline cache check) will fit in a single 64-byte
// icache line.
if (! method()->is_accessor() || __ offset() - start_offset > 4 * 4) {
// force alignment after the cache check.
__ align(CodeEntryAlignment);
}

__ bind(dont);
return start_offset;
return __ ic_check(CodeEntryAlignment);
}

void LIR_Assembler::clinit_barrier(ciMethod* method) {
Expand Down Expand Up @@ -2042,7 +2021,7 @@ void LIR_Assembler::emit_static_call_stub() {
__ relocate(static_stub_Relocation::spec(call_pc));
__ emit_static_call_stub();

assert(__ offset() - start + CompiledStaticCall::to_trampoline_stub_size()
assert(__ offset() - start + CompiledDirectCall::to_trampoline_stub_size()
<= call_stub_size(), "stub too big");
__ end_a_stub();
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ friend class ArrayCopyStub;
void deoptimize_trap(CodeEmitInfo *info);

enum {
// call stub: CompiledStaticCall::to_interp_stub_size() +
// CompiledStaticCall::to_trampoline_stub_size()
// call stub: CompiledDirectCall::to_interp_stub_size() +
// CompiledDirectCall::to_trampoline_stub_size()
_call_stub_size = 13 * NativeInstruction::instruction_size,
_exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175),
_deopt_handler_size = 7 * NativeInstruction::instruction_size
Expand Down
11 changes: 0 additions & 11 deletions src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,17 +308,6 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len, Register t1,
verify_oop(obj);
}


void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
verify_oop(receiver);
// explicit null check not needed since load from [klass_offset] causes a trap
// check against inline cache
assert(!MacroAssembler::needs_explicit_null_check(oopDesc::klass_offset_in_bytes()), "must add explicit null check");

cmp_klass(receiver, iCache, rscratch1);
}


void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
// Make sure there is enough stack space for this method's activation.
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include "interpreter/interpreter.hpp"
#include "memory/universe.hpp"
#include "nativeInst_aarch64.hpp"
#include "oops/compiledICHolder.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "register_aarch64.hpp"
Expand Down
22 changes: 7 additions & 15 deletions src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/compiledIC.hpp"
#include "code/icBuffer.hpp"
#include "code/nmethod.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
Expand All @@ -36,7 +35,7 @@
// ----------------------------------------------------------------------------

#define __ _masm.
address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
address CompiledDirectCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) {
precond(cbuf.stubs()->start() != badAddress);
precond(cbuf.stubs()->end() != badAddress);

Expand Down Expand Up @@ -71,33 +70,26 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark)
}
#undef __

int CompiledStaticCall::to_interp_stub_size() {
int CompiledDirectCall::to_interp_stub_size() {
return MacroAssembler::static_call_stub_size();
}

int CompiledStaticCall::to_trampoline_stub_size() {
int CompiledDirectCall::to_trampoline_stub_size() {
// Somewhat pessimistically, we count 3 instructions here (although
// there are only two) because we sometimes emit an alignment nop.
// Trampoline stubs are always word aligned.
return MacroAssembler::max_trampoline_stub_size();
}

// Relocation entries for call stub, compiled java to interpreter.
int CompiledStaticCall::reloc_to_interp_stub() {
int CompiledDirectCall::reloc_to_interp_stub() {
return 4; // 3 in emit_to_interp_stub + 1 in emit_call
}

void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) {
void CompiledDirectCall::set_to_interpreted(const methodHandle& callee, address entry) {
address stub = find_stub();
guarantee(stub != nullptr, "stub not found");

{
ResourceMark rm;
log_trace(inlinecache)("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s",
p2i(instruction_address()),
callee->name_and_sig_as_C_string());
}

// Creation also verifies the object.
NativeMovConstReg* method_holder
= nativeMovConstReg_at(stub + NativeInstruction::instruction_size);
Expand All @@ -115,7 +107,7 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad
set_destination_mt_safe(stub);
}

void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
void CompiledDirectCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
// Reset stub.
address stub = static_stub->addr();
assert(stub != nullptr, "stub not found");
Expand All @@ -132,7 +124,7 @@ void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_
// Non-product mode code
#ifndef PRODUCT

void CompiledDirectStaticCall::verify() {
void CompiledDirectCall::verify() {
// Verify call.
_call->verify();
_call->verify_alignment();
Expand Down
Loading

0 comments on commit bce39e4

Please sign in to comment.