-
Notifications
You must be signed in to change notification settings - Fork 35
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
8345836: stable annotation documentation is incomplete #26
base: premain
Are you sure you want to change the base?
Conversation
👋 Welcome back jrose! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
To avoid this situation, create a new branch for your changes and reset the
Then proceed to create a new pull request with |
Webrevs
|
Mailing list message from Alex Buckley on leyden-dev: Hi John, a few comments.
Saying "at most once" suggests that changing the value zero times is A+
(The phrase "stables values" should be "stable variables"; later, the I got a sense here that stable variables are the fundamental construct,
It's a little hard to figure out if "behavior" refers to the constant Alex On 12/9/2024 3:58 PM, John R Rose wrote: |
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
It might be worth mentioning that primitive types could be held in a wrapper class (rather than as a primitive value) if the default values are important to capture and constant-fold. Another thing that we could talk about when it comes to stable variables initialized outside |
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
* (the second value of the field) is used as the value of the field even after | ||
* the field value has changed (to a third value). | ||
* After constant folding, the compiler can make use of may aspects of | ||
* the object: Its dynamic type, its length (if it is an array), and |
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.
"Its" -> "its". (no capital I needed)
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/vm/annotation/Stable.java
Outdated
Show resolved
Hide resolved
Mailing list message from Alex Buckley on leyden-dev: Re: "A stable variable may be assigned its final value inside a class or "For example, declaring two stable fields of type {@code int} and {@code Before "As an extended behavior," please insert a heading "Array-typed Before "As very simple example", please insert a heading "Constant Before "Fields which are declared {@code final}", please insert a Please consider adding further headings. Alex On 12/11/2024 1:36 PM, John R Rose wrote: |
@rose00 Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
For easier review, here is a rendered version of the most recent changes. |
Mailing list message from Alex Buckley on leyden-dev: First paragraph: Both "initial default value" and "default initial value" appear, and I "its initial default (null or zero) value" "When the first value is stored into the field (assuming it is not a "Or is the user waiting until later to assign another value to the "The VM does not systematically record stores of a default null (or In the Example section: - The phrase "stable value" has crept in. - Is a _value_ constant-foldable? Or a _variable_? I think the latter. - The "As a very simple example ..." paragraph is weird, coming after so - The final paragraph about "mutually exclusive" and "never be part of Alex On 12/12/2024 1:03 AM, John R Rose wrote: |
The javadoc for jdk.internal.vm.annotation.Stable is incomplete.
The existing documentation gives an over-simple user model,
and does not explain how it is implemented.
Proposed new documentation will detail how the annotation
is implemented, and how it may be used correctly.
The improved documentation will makes it easier for JDK programmers
to use the annotation more aggressively, and more confidently.
This is a first cut. Please comment…
Progress
Warning
8345836: stable annotation documentation is incomplete
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/leyden.git pull/26/head:pull/26
$ git checkout pull/26
Update a local copy of the PR:
$ git checkout pull/26
$ git pull https://git.openjdk.org/leyden.git pull/26/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26
View PR using the GUI difftool:
$ git pr show -t 26
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/leyden/pull/26.diff
Using Webrev
Link to Webrev Comment