Skip to content

Commit f26f83f

Browse files
author
Fei Yang
committed
Merge branch 'master' into riscv-port
2 parents 80f64ff + fef8f2d commit f26f83f

File tree

102 files changed

+1131
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1131
-511
lines changed

doc/ide.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ <h5 id="alternative-indexers">Alternative indexers</h5>
4141
<pre class="shell"><code>make vscode-project-clangd</code></pre>
4242
<p>Additional instructions for configuring the given indexer will be displayed after the workspace has been generated.</p>
4343
<h4 id="visual-studio">Visual Studio</h4>
44-
<p>This section is a work in progress.</p>
45-
<pre class="shell"><code>make ide-project</code></pre>
44+
<p>The make system can generate a Visual Studio project for the Hotspot native source. After configuring, the project is generated using:</p>
45+
<pre class="shell"><code>make hotspot-ide-project</code></pre>
46+
<p>This creates a file named <code>jvm.vcxproj</code> in <code>ide\hotspot-visualstudio</code> subfolder of the build output folder. The file can be opened in Visual Studio via <code>File -&gt; Open -&gt; Project/Solution</code>.</p>
4647
<h4 id="compilation-database">Compilation Database</h4>
4748
<p>The make system can generate generic native code indexing support in the form of a <a href="https://clang.llvm.org/docs/JSONCompilationDatabase.html">Compilation Database</a> that can be used by many different IDEs and source code indexers.</p>
4849
<pre class="shell"><code>make compile-commands</code></pre>
4950
<p>It's also possible to generate the Compilation Database for the HotSpot source code only, which is a bit faster as it includes less information.</p>
5051
<pre class="shell"><code>make compile-commands-hotspot</code></pre>
5152
<h3 id="ide-support-for-java-code">IDE support for Java code</h3>
52-
<p>This section is a work in progress.</p>
53+
<h4 id="intellij-idea">IntelliJ IDEA</h4>
54+
<p>The JDK project has a script that can be used for indexing the project with IntelliJ. After configuring and building the JDK, an IntelliJ workspace can be generated by running the following command in the top-level folder of the cloned repository:</p>
55+
<pre class="shell"><code>bash bin/idea.sh</code></pre>
56+
<p>To use it, choose <code>File -&gt; Open...</code> in IntelliJ and select the folder where you ran the above script.</p>
57+
<p>Next, configure the project SDK in IntelliJ. Open <code>File -&gt; Project Structure -&gt; Project</code> and select <code>build/&lt;config&gt;/images/jdk</code> as the SDK to use.</p>
58+
<p>In order to run the tests from the IDE, you can use the JTReg plugin. Instructions for building and using the plugin can be found <a href="https://github.com/openjdk/jtreg/tree/master/plugins/idea">here</a>.</p>
5359
</body>
5460
</html>

doc/ide.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ after the workspace has been generated.
4545

4646
#### Visual Studio
4747

48-
This section is a work in progress.
48+
The make system can generate a Visual Studio project for the Hotspot
49+
native source. After configuring, the project is generated using:
4950

5051
```shell
51-
make ide-project
52+
make hotspot-ide-project
5253
```
5354

55+
This creates a file named `jvm.vcxproj` in `ide\hotspot-visualstudio`
56+
subfolder of the build output folder. The file can be opened in Visual Studio
57+
via `File -> Open -> Project/Solution`.
58+
5459
#### Compilation Database
5560

5661
The make system can generate generic native code indexing support in the form of
@@ -70,4 +75,24 @@ make compile-commands-hotspot
7075

7176
### IDE support for Java code
7277

73-
This section is a work in progress.
78+
#### IntelliJ IDEA
79+
80+
The JDK project has a script that can be used for indexing the project
81+
with IntelliJ. After configuring and building the JDK, an IntelliJ workspace
82+
can be generated by running the following command in the top-level folder
83+
of the cloned repository:
84+
85+
```shell
86+
bash bin/idea.sh
87+
```
88+
89+
To use it, choose `File -> Open...` in IntelliJ and select the folder where
90+
you ran the above script.
91+
92+
Next, configure the project SDK in IntelliJ. Open
93+
`File -> Project Structure -> Project` and select `build/<config>/images/jdk`
94+
as the SDK to use.
95+
96+
In order to run the tests from the IDE, you can use the JTReg plugin.
97+
Instructions for building and using the plugin can be found
98+
[here](https://github.com/openjdk/jtreg/tree/master/plugins/idea).

src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2021 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -3216,8 +3216,9 @@ void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints
32163216
// Make very sure we don't use so much space that the stack might
32173217
// overflow. 512 jints corresponds to an 16384-bit integer and
32183218
// will use here a total of 8k bytes of stack space.
3219+
int divisor = sizeof(unsigned long) * 4;
3220+
guarantee(longwords <= 8192 / divisor, "must be");
32193221
int total_allocation = longwords * sizeof (unsigned long) * 4;
3220-
guarantee(total_allocation <= 8192, "must be");
32213222
unsigned long *scratch = (unsigned long *)alloca(total_allocation);
32223223

32233224
// Local scratch arrays
@@ -3246,8 +3247,9 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints,
32463247
// Make very sure we don't use so much space that the stack might
32473248
// overflow. 512 jints corresponds to an 16384-bit integer and
32483249
// will use here a total of 6k bytes of stack space.
3250+
int divisor = sizeof(unsigned long) * 3;
3251+
guarantee(longwords <= (8192 / divisor), "must be");
32493252
int total_allocation = longwords * sizeof (unsigned long) * 3;
3250-
guarantee(total_allocation <= 8192, "must be");
32513253
unsigned long *scratch = (unsigned long *)alloca(total_allocation);
32523254

32533255
// Local scratch arrays

src/hotspot/cpu/riscv/macroAssembler_riscv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,14 @@ void MacroAssembler::emit_static_call_stub() {
554554
// exact layout of this stub.
555555

556556
ifence();
557-
558557
mov_metadata(xmethod, (Metadata*)NULL);
559558

560559
// Jump to the entry point of the i2c stub.
561560
int32_t offset = 0;
562561
movptr_with_offset(t0, 0, offset);
563562
jalr(x0, t0, offset);
564563
}
564+
565565
void MacroAssembler::call_VM_leaf_base(address entry_point,
566566
int number_of_arguments,
567567
Label *retaddr) {

src/hotspot/cpu/s390/sharedRuntime_s390.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016, 2019 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -3219,8 +3219,9 @@ void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints
32193219
// Make very sure we don't use so much space that the stack might
32203220
// overflow. 512 jints corresponds to an 16384-bit integer and
32213221
// will use here a total of 8k bytes of stack space.
3222+
int divisor = sizeof(unsigned long) * 4;
3223+
guarantee(longwords <= 8192 / divisor, "must be");
32223224
int total_allocation = longwords * sizeof (unsigned long) * 4;
3223-
guarantee(total_allocation <= 8192, "must be");
32243225
unsigned long *scratch = (unsigned long *)alloca(total_allocation);
32253226

32263227
// Local scratch arrays
@@ -3249,8 +3250,9 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints,
32493250
// Make very sure we don't use so much space that the stack might
32503251
// overflow. 512 jints corresponds to an 16384-bit integer and
32513252
// will use here a total of 6k bytes of stack space.
3253+
int divisor = sizeof(unsigned long) * 3;
3254+
guarantee(longwords <= (8192 / divisor), "must be");
32523255
int total_allocation = longwords * sizeof (unsigned long) * 3;
3253-
guarantee(total_allocation <= 8192, "must be");
32543256
unsigned long *scratch = (unsigned long *)alloca(total_allocation);
32553257

32563258
// Local scratch arrays

src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -3542,8 +3542,9 @@ void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints
35423542
// Make very sure we don't use so much space that the stack might
35433543
// overflow. 512 jints corresponds to an 16384-bit integer and
35443544
// will use here a total of 8k bytes of stack space.
3545+
int divisor = sizeof(julong) * 4;
3546+
guarantee(longwords <= 8192 / divisor, "must be");
35453547
int total_allocation = longwords * sizeof (julong) * 4;
3546-
guarantee(total_allocation <= 8192, "must be");
35473548
julong *scratch = (julong *)alloca(total_allocation);
35483549

35493550
// Local scratch arrays
@@ -3571,8 +3572,9 @@ void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints,
35713572
// Make very sure we don't use so much space that the stack might
35723573
// overflow. 512 jints corresponds to an 16384-bit integer and
35733574
// will use here a total of 6k bytes of stack space.
3575+
int divisor = sizeof(julong) * 3;
3576+
guarantee(longwords <= (8192 / divisor), "must be");
35743577
int total_allocation = longwords * sizeof (julong) * 3;
3575-
guarantee(total_allocation <= 8192, "must be");
35763578
julong *scratch = (julong *)alloca(total_allocation);
35773579

35783580
// Local scratch arrays

src/hotspot/os/linux/cgroupSubsystem_linux.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,10 @@ PRAGMA_DIAG_POP
157157
NULL, \
158158
scan_fmt, \
159159
&variable); \
160-
if (err != 0) \
160+
if (err != 0) { \
161+
log_trace(os, container)(logstring, (return_type) OSCONTAINER_ERROR); \
161162
return (return_type) OSCONTAINER_ERROR; \
163+
} \
162164
\
163165
log_trace(os, container)(logstring, variable); \
164166
}

src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021, Red Hat Inc.
2+
* Copyright (c) 2020, 2022, Red Hat Inc.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -36,7 +36,7 @@
3636
*/
3737
int CgroupV2Subsystem::cpu_shares() {
3838
GET_CONTAINER_INFO(int, _unified, "/cpu.weight",
39-
"Raw value for CPU shares is: %d", "%d", shares);
39+
"Raw value for CPU Shares is: %d", "%d", shares);
4040
// Convert default value of 100 to no shares setup
4141
if (shares == 100) {
4242
log_debug(os, container)("CPU Shares is: %d", -1);

src/hotspot/share/gc/shared/cardTable.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,6 @@ int CardTable::find_covering_region_by_base(HeapWord* base) {
162162
return res;
163163
}
164164

165-
int CardTable::find_covering_region_containing(HeapWord* addr) {
166-
for (int i = 0; i < _cur_covered_regions; i++) {
167-
if (_covered[i].contains(addr)) {
168-
return i;
169-
}
170-
}
171-
assert(0, "address outside of heap?");
172-
return -1;
173-
}
174-
175165
HeapWord* CardTable::largest_prev_committed_end(int ind) const {
176166
HeapWord* max_end = NULL;
177167
for (int j = 0; j < ind; j++) {

src/hotspot/share/gc/shared/cardTable.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ class CardTable: public CHeapObj<mtGC> {
7878
// covered regions defined in the constructor are ever in use.
7979
int find_covering_region_by_base(HeapWord* base);
8080

81-
// Same as above, but finds the region containing the given address
82-
// instead of starting at a given base address.
83-
int find_covering_region_containing(HeapWord* addr);
84-
8581
// Returns the leftmost end of a committed region corresponding to a
8682
// covered region before covered region "ind", or else "NULL" if "ind" is
8783
// the first covered region.

0 commit comments

Comments
 (0)