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

JDK-8269023 [lworld] L/Q<type> support #453

Closed
wants to merge 24 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4de6a48
Merge lworld
May 10, 2021
adff688
First set of changes to initiate the transition to the L/Q model
fparain May 10, 2021
a6f937b
Initial runtime arrays support for L or Q type
May 12, 2021
ac1feac
8266931: [lworld] [lw3] Test InlineTypeArrays.java fails because of i…
fparain May 17, 2021
671a346
CDS support for InlineKlass::null_free_array_klasses() & corrected mo…
May 19, 2021
6841917
Rename nullfree to null_free
May 19, 2021
4aa22fb
L/Q again, step two
fparain May 19, 2021
375479e
More C1 fixes
fparain May 20, 2021
bca447b
Merge lworld
May 25, 2021
477ecf5
8267846: [lworld] JIT support for the L/Q model (step 1)
TobiHartmann May 31, 2021
d9d96e8
8267948: [lword] Core reflection and method handles support for L/Q m…
Jun 7, 2021
8807adf
8268389: [lworld] Tests must be update after core reflection changes …
fparain Jun 8, 2021
3552074
8268399: [BACKOUT] [lworld] Tests must be update after core reflectio…
fparain Jun 9, 2021
31e9967
8268418: [lworld] VM assert illegal mirror klass when calling Class::…
Jun 9, 2021
d23562e
8267597: [lworld] Withdraw all support for bifurcated class generatio…
Jun 10, 2021
64ec4ec
8268584: [lqagain] Javac tests should not needlessly hardcode toStrin…
Jun 11, 2021
569dd54
8268358: [lworld] toString for primitive class should return `ClassNa…
Jun 11, 2021
fa11596
8268656: [lqagain] A few code chunks dealing with dual class scheme s…
Jun 14, 2021
52ee195
8268908: Update test/jdk/valhalla/valuetypes tests to prepare for jtr…
Jun 16, 2021
70a2405
Merge lworld
Jun 17, 2021
3b3e4d4
8268980: [lword] Fix Class::descriptorString to return L-descriptor f…
Jun 17, 2021
521bed2
8268981: [lworld] UnifiedPrimitiveClassNestHostTest.java should test …
Jun 17, 2021
2a7e977
8218159: ValueBootstrapMethods.isSubstitutable should not filter synt…
Jun 18, 2021
9579e93
Merge branch 'lworld' of https://git.openjdk.java.net/valhalla into c…
MrSimms Jun 21, 2021
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -107,9 +107,9 @@ private static MethodHandle generateTarget(Lookup lookup, String name, MethodTyp

static MethodHandle[] getters(Class<?> type, Comparator<MethodHandle> comparator) {
Lookup lookup = new MethodHandles.Lookup(type.asPrimaryType());
// filter static fields and synthetic fields
// filter static fields
Stream<MethodHandle> s = Arrays.stream(type.getDeclaredFields())
.filter(f -> !Modifier.isStatic(f.getModifiers()) && !f.isSynthetic())
.filter(f -> !Modifier.isStatic(f.getModifiers()))
.map(f -> {
try {
return lookup.unreflectGetter(f);
@@ -0,0 +1,80 @@
/*
* Copyright (c) 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
* 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.
*/

/*
* @test
* @run main Nest
* @summary Test substitutability of inner class and anonymous class that
* has the enclosing instance and possibly other captured outer locals
*/

public interface Nest {
public static void main(String... args) {
assertEquals(Nest.of(1, null), Nest.of(1, null));
assertNotEquals(Nest.of(1, null), Nest.of(2, null));

Outer n = new Outer(1);
Outer.Inner inner = n.new Inner(10);
Outer n1 = new Outer(1);
Outer n2 = new Outer(2);
assertEquals(n1.new Inner(10), inner);
assertEquals(n2.new Inner(10), new Outer(2).new Inner(10));
}

// o1.new Inner(1) == o2.new Inner(1) iff o1 == o2
static primitive class Outer {
final int i;
Outer(int i) {
this.i = i;
}

primitive class Inner {
final int ic;
Inner(int ic) {
this.ic = ic;
}
}
}

String toString();

static Nest of(int value, Object next) {
// anonymous class capturing outer locals
return new primitive Nest() {
public String toString() {
return value + " -> " + next;
}
};
}

static void assertEquals(Object o1, Object o2) {
if (o1 != o2) {
throw new RuntimeException(o1 + " != " + o2);
}
}
static void assertNotEquals(Object o1, Object o2) {
if (o1 == o2) {
throw new RuntimeException(o1 + " == " + o2);
}
}
}
@@ -178,9 +178,9 @@ public void testHashCode(Object o, int hash) {

private static Object[] hashCodeComponents(Object o) {
Class<?> type = o.getClass();
// filter static fields and synthetic fields
// filter static fields
Stream<Object> fields = Arrays.stream(type.getDeclaredFields())
.filter(f -> !Modifier.isStatic(f.getModifiers()) && !f.isSynthetic())
.filter(f -> !Modifier.isStatic(f.getModifiers()))
.map(f -> {
try {
return f.get(o);