On Thu, 24 Sep 2020 21:20:19 GMT, Albert Mingkun Yang <[email protected]> wrote:
> Thank you for the comments and diagrams; they make the code much more
> digestible. From that diagram, I get the
> impression that the watermark is associated with stack pointer, so it should
> be 1:1 relation, but `class Thread`
> contains multiple watermarks, `StackWatermarks _stack_watermarks;`. I think
> some high level description on the relation
> between the thread and a list of watermarks belong to that thread could be
> beneficial.
I added some further comments explaining this.
> > The first time it reaches past the last frame it will report true, and the
> > second time it will report false.
>
> Why so? As I see it, once a stream becomes "done", it stays in that state
> forever. Am I missing sth?
>
> ```
> inline bool StackFrameStream::is_done() {
> return (_is_done) ? true : (_is_done = _fr.is_first_frame(), false);
> }
> ```
When you step into the last frame of the iteration (first frame in the stack),
the first time you ask is_done() it will
report false, the next time it will report true, despite still being in the
same frame. Therefore, the is_done()
function is not idempotent, as I need it to be.
-------------
PR: https://git.openjdk.java.net/jdk/pull/296