-
Notifications
You must be signed in to change notification settings - Fork 6.4k
8317279: Standard library implementation of value classes and objects #31123
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
base: master
Are you sure you want to change the base?
Changes from 250 commits
a9dfc23
5814c9d
5131e8a
d886298
d14b4dd
2bc2fe3
8d84aee
0eef773
555fbde
58efbec
6391715
7f562b3
46aac16
7558cd7
46dafa3
4b95be2
31ee5a8
beec164
cadae12
1c746e9
5ad1577
cbb23bb
e946a61
be1bc9a
1dedf05
737cf51
ce13625
800190d
ef03842
260fe04
7ec5a18
0432d28
632b1bd
9a8e822
873f02d
f39fa97
e51da80
2585704
96a8b4b
4990f91
7c2d2cd
2d330b1
de6aff4
6b9eb7d
cc40808
4824ac0
37504c6
50ed255
687c91c
b5347d2
5758540
530e74c
8477926
b13d505
15e9bb6
7f751ee
381cedf
1f15e5a
af9a023
0cee7f0
e08d163
f87d6d1
473248e
5bd51e2
2060561
809e1cd
67240cc
c5fafa9
a63fc22
679d759
d07da49
cbb983c
47f6119
0fd28c1
0dc5f67
b4abeb6
4a8ca20
20105ed
71f4b08
d7bb464
884d529
b3b4a2c
36acdd6
53268eb
0da436e
4c23f0e
0f58277
5ccd489
931493b
10ca1d3
19cf14f
8a869ae
703ac96
601e48e
804858f
dad467a
193b6a8
3086665
6a7073f
18449ec
b9b9eef
100e344
66dddaf
059baea
9e80425
194c6e8
071157b
4c1a52b
a974e5e
39e74d0
5c8673b
ed3bfbc
afbab0d
69d84f3
879523a
ce940c6
2af456d
8e9d0a5
5f1405f
ea6ec3d
03a2847
702e092
0639bc3
74f27eb
a7567f2
2cbfd78
022f70b
2ad1916
a3a6dda
2eae815
8ba03de
993c879
168f56b
3246309
246ffbf
fe2308a
2c4528c
ef794af
da99de9
fb95aaa
30d67a2
418ecb7
b466279
72a74ed
af33332
6d95a41
95bef16
042a35d
1ca1c8d
26c8f2e
4d6d288
abebcaa
c2f67c7
b3a718e
2fe010c
7ab2d1e
d15e8b7
28a9f6e
642ef0a
6eb965b
1badaaa
8e1cb51
43640ba
6663aa3
347b36f
a339024
9cd13e6
57b668a
821c522
892d502
7974808
ed61dc2
426cc06
2523a4f
6931557
246c6b3
fce1837
ce9ae18
d4a3b6b
28e1ab5
dd93655
1eb4aaa
d09a203
f234daf
38e9595
4c1c438
d0b6c69
a8cc7b3
d85e818
5e57521
3923e0c
8d02455
8f8b311
5e32888
d4fc4b2
84422ff
af3e804
39190ed
441b428
c93431c
e614970
4542f1d
42fc9c9
59019cf
b77db44
6f7797c
f0a7ef2
5ee106a
cdbe55a
b508893
9c7f8e5
a0dc49c
d53dc6e
7229f09
2752ad8
ed0d2e9
e07832f
483feca
3a3ac5c
28b617e
05767f0
2ae8e47
fa0f4a6
71eb703
50d7001
285c9fc
43153f5
dc8b7c5
a5bfc3e
08ebba3
6479f1d
0c737f0
046c69b
166b653
650d7b4
3a7e2e0
9a30ca8
6adeca9
e890579
638a7d1
f32cd1a
73d93a2
01a466d
4cb6401
294b5e7
3e63327
e16732c
13e40e4
e51b762
8a7fdc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # | ||
| # Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved. | ||
| # Copyright (c) 2014, 2026, 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 | ||
|
|
@@ -30,6 +30,8 @@ include MakeFileStart.gmk | |
| include JavaCompilation.gmk | ||
| include Modules.gmk | ||
|
|
||
| include CopyFiles.gmk | ||
|
|
||
| ################################################################################ | ||
| # If this is an imported module that has prebuilt classes, only compile | ||
| # module-info.java. | ||
|
|
@@ -98,13 +100,15 @@ endif | |
| ################################################################################ | ||
| # Setup the main compilation | ||
|
|
||
| COMPILATION_OUTPUTDIR := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules) | ||
|
|
||
| $(eval $(call SetupJavaCompilation, $(MODULE), \ | ||
| SMALL_JAVA := false, \ | ||
| MODULE := $(MODULE), \ | ||
| SRC := $(wildcard $(MODULE_SRC_DIRS)), \ | ||
| INCLUDES := $(JDK_USER_DEFINED_FILTER), \ | ||
| FAIL_NO_SRC := $(FAIL_NO_SRC), \ | ||
| BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \ | ||
| BIN := $(COMPILATION_OUTPUTDIR), \ | ||
| HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ | ||
| CREATE_API_DIGEST := true, \ | ||
| CLEAN := $(CLEAN), \ | ||
|
|
@@ -126,6 +130,67 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \ | |
|
|
||
| TARGETS += $($(MODULE)) | ||
|
|
||
| ################################################################################ | ||
| # Setup compilation for preview classes in the module | ||
| # TBD: When $(DOCLINT) was included there was an NPE in JavacTypes.getOverriddenMethods | ||
|
|
||
| # Directory and file name suffix for jar file containing preview classes/resources. | ||
| PREVIEW_CLASSES_LABEL := preview | ||
| # Module relative path in which preview classes/resources are placed. | ||
| PREVIEW_PATH := META-INF/preview | ||
|
|
||
| MODULE_PREVIEW_SRC_DIRS := $(call FindModulePreviewSrcDirs, $(MODULE)) | ||
| MODULE_PREVIEW_SOURCEPATH := $(call GetModulePreviewSrcPath) | ||
| ifneq ($(MODULE_PREVIEW_SRC_DIRS),) | ||
| # Compile preview classes into a separate directory, and then copy into the | ||
| # correct output path location. We cannot compile directly into the desired | ||
| # directory because it's the compiler which creates the original | ||
| # '<module>/<classpath>/...' hierarchy. | ||
| PREVIEW_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/$(PREVIEW_CLASSES_LABEL) | ||
| PATCH_COMMAND := $(MODULE)=$(call strip, $(COMPILATION_OUTPUTDIR)/$(MODULE)) | ||
|
|
||
| $(eval $(call SetupJavaCompilation, $(MODULE)-$(PREVIEW_CLASSES_LABEL), \ | ||
| SMALL_JAVA := false, \ | ||
| MODULE := $(MODULE), \ | ||
| SRC := $(wildcard $(MODULE_PREVIEW_SRC_DIRS)), \ | ||
| INCLUDES := $(JDK_USER_DEFINED_FILTER), \ | ||
| FAIL_NO_SRC := $(FAIL_NO_SRC), \ | ||
| BIN := $(PREVIEW_OUTPUTDIR)/, \ | ||
| HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As noted in https://bugs.openjdk.org/browse/JDK-8386458, just remove this line and we are good.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing this work with: |
||
| DISABLED_WARNINGS := $(DISABLED_WARNINGS_java) preview, \ | ||
| EXCLUDES := $(EXCLUDES), \ | ||
| EXCLUDE_FILES := $(EXCLUDE_FILES), \ | ||
| KEEP_ALL_TRANSLATIONS := $(KEEP_ALL_TRANSLATIONS), \ | ||
| DEPENDS := $($(MODULE)), \ | ||
| JAVAC_FLAGS := \ | ||
| $(JAVAC_FLAGS) \ | ||
| --module-source-path $(MODULE_PREVIEW_SOURCEPATH) \ | ||
| --module-path $(MODULEPATH) \ | ||
| --patch-module $(PATCH_COMMAND) \ | ||
| --system none \ | ||
| --enable-preview -source $(JDK_SOURCE_TARGET_VERSION), \ | ||
| )) | ||
|
|
||
| # Don't add '$($(MODULE)-$(PREVIEW_CLASSES_LABEL))' to TARGETS (it's transient). | ||
| # The 'preview' target below depends on it, and that's the non-transient | ||
| # result we care about. | ||
|
|
||
| # Copy compiled output from "$(PREVIEW_OUTPUTDIR)/$(MODULE)/<classpath>/..." | ||
| # to "$(COMPILATION_OUTPUTDIR)/$(MODULE)/$(PREVIEW_PATH)/<classpath>/...". | ||
| MOD_SRC := $(PREVIEW_OUTPUTDIR)/$(MODULE) | ||
| MOD_DST := $(COMPILATION_OUTPUTDIR)/$(MODULE) | ||
|
|
||
| # NOTE: We cannot use '$(CP) -R $(MOD_SRC)/*/ ...' to select sub-directories (it | ||
| # does not work on MacOS/BSD). Use 'filter-out' to explicitly exclude marker files. | ||
| $(MOD_DST)/_the.$(MODULE).preview: $($(MODULE)-$(PREVIEW_CLASSES_LABEL)) | ||
| $(RM) -r $(@D)/$(PREVIEW_PATH) | ||
| $(MKDIR) -p $(@D)/$(PREVIEW_PATH) | ||
| $(CP) -R $(filter-out $(MOD_SRC)/_%, $(wildcard $(MOD_SRC)/*)) $(@D)/$(PREVIEW_PATH) | ||
| $(TOUCH) $@ | ||
|
|
||
| TARGETS += $(MOD_DST)/_the.$(MODULE).preview | ||
| endif | ||
|
|
||
| # Declare dependencies between java compilations of different modules. | ||
| # Since the other modules are declared in different invocations of this file, | ||
| # use the macro to find the correct target file to depend on. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -794,6 +794,20 @@ ifeq ($(BUILD_JTREG_TEST_THREAD_FACTORY), true) | |
| )) | ||
| endif | ||
|
|
||
| # Builds the value class plugin jtreg extension (JEP 401) | ||
| $(eval $(call SetupTarget, build-test-value-class-plugin, \ | ||
| MAKEFILE := test/BuildJtregValueClassPlugin, \ | ||
| TARGET := build, \ | ||
| DEPS := interim-langtools exploded-image, \ | ||
| )) | ||
|
|
||
| # Copies the value class plugin into the test image | ||
| $(eval $(call SetupTarget, test-image-value-class-plugin, \ | ||
| MAKEFILE := test/BuildJtregValueClassPlugin, \ | ||
| TARGET := images, \ | ||
| DEPS := build-test-value-class-plugin, \ | ||
| )) | ||
|
|
||
| $(eval $(call SetupTarget, build-microbenchmark, \ | ||
| MAKEFILE := test/BuildMicrobenchmark, \ | ||
| DEPS := interim-langtools exploded-image build-test-lib, \ | ||
|
|
@@ -1310,6 +1324,8 @@ ifeq ($(BUILD_JTREG_TEST_THREAD_FACTORY), true) | |
| test-image: test-image-test-thread-factory | ||
| endif | ||
|
|
||
| test-image: test-image-value-class-plugin | ||
|
|
||
|
Comment on lines
+1327
to
+1328
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be moved to line 1303-1306 where all the other non conditional prereqs for test-image are declared. |
||
| ifneq ($(JMH_CORE_JAR), ) | ||
| test-image: build-microbenchmark | ||
| endif | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like left over project specific logic that should probably be removed before integration into the jdk repo.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the following bug comment for my analysis:
https://bugs.openjdk.org/browse/JDK-8385743?focusedId=14884160&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14884160
This is the summary from that analysis:
@lfoltan - What is the plan for the 'lworld' branch after JEP-401 integrates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed today, we'll likely freeze
lworldat the point of integration, and do later development in other branches of thevalhallarepository. (Not sure the implications for this file, but hope that helps.)