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

Adding new IL Opcode xrdbar/xrdbari #2812

Open
cathyzhyi opened this issue Jul 30, 2018 · 3 comments
Open

Adding new IL Opcode xrdbar/xrdbari #2812

cathyzhyi opened this issue Jul 30, 2018 · 3 comments

Comments

@cathyzhyi
Copy link
Contributor

cathyzhyi commented Jul 30, 2018

We are proposing to add xrdbar/xrdbari opcodes because 2 recent development items need to monitor instance or static fields reads and writes. One is field watch in debugging mode where we need to report fields accesses to the VM. The other one is pauseless GC where every instance field accesses might need to call to the GC to fix up the pointer. In both cases, the load have side affects and we need new opcodes to represent this situation.

The xrdbar/xrdbari need to represent both the side effects of the load as well as the value of the load. They are the same as the corresponding xload/xloadi except that read barrier nodes need to be anchored under a treetop or chk at their point of first evaluation (like a call). Then they can be referenced in subsequent trees.

The children and symbol of indirect read barriers are the same as their corresponding load. It would be something like:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

The children and symbol of direct read barriers are the same as their corresponding load with one additional child which is static field class. The extra child is for simplifying code evaluation for unresolved case where the load of unresolved static field class hangs under a treetop.

resolved case:
treetop
  xrdbar <#xxx A.staticB>
     Class of A
...
  ==>xrdbar

unresolved case:
ResolveCHK
    loadaddr  Class of A (unresolved static)
ResolveCHK
    irdbar
      ==>loadaddr
...
  ==>xrdbar

#2875

@mstoodle
Copy link
Contributor

mstoodle commented Aug 1, 2018

Presumably these are typed like xload/xloadi ?

@cathyzhyi
Copy link
Contributor Author

@mstoodle yes. updated the description.

@cathyzhyi
Copy link
Contributor Author

cathyzhyi commented Aug 2, 2018

Documenting here the discussion at the architecture meeting #2817 about the rdbar opcodes

  • the opcode should be able to be commoned or moved and the optimizations applies to loads should be able to apply to rdbars as well.
  • the only difference between the rdbars and loads is that a rdbar has to hang under a treetop before the first use to represent the side effect it's gonna have on evalutor. We want to avoid the complication of dealing with a call in the middle of evaluating another treetop.
  • If there are any restrictions on optimizations coming from different modes, debugging mode etc, they should be addressed under different mode rather than property of the opcode. The optimizations like LocalCSE, PRE, loop versioner might need to special case rdbar under those different modes. The special case should be grouped into properties (or queries??) rather than adding another | to a group of other opcode values. Aliasing can be different depending on modes as well.
  • Use the load evaluators as the default evaluators for rdbars in omr.
  • Need to think about how to write test case for the rdbar opcodes.
  • Will need to fill in a new opcode template for new opcode proposal.

cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 10, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

resolved case:
treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more desgin details

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 10, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more design details

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 10, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more design details

Signed-off-by: Yi Zhang <[email protected]>
@cathyzhyi cathyzhyi changed the title Adding new IL Opcode rdbar/rdbari Adding new IL Opcode xrdbar/xrdbari Sep 10, 2018
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 11, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more design details

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 11, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more design details

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 28, 2018
This PR contains a few changes to support rdbar/wrtbar: adding field
report helpers and jit resolve fields helpers, adding enableFieldWatch
option, changing canGCandReturn to return true for readbar and wrtbar
under field watch.

issue: eclipse-omr#2812

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Sep 28, 2018
This PR contains a few changes to support rdbar/wrtbar for field watch
: adding field report helpers and jit resolve fields helpers, adding
enableFieldWatch option, changing canGCandReturn to return true for
readbar and wrtbar under field watch.

issue: eclipse-omr#2812

Signed-off-by: Yi Zhang <[email protected]>
hzongaro pushed a commit to hzongaro/omr that referenced this issue Oct 1, 2018
The xrdbar/xrdbari opcode are added to represent both the value of the
load as well as its side effects like needing to notify the GC of the
read, notify the VM of the read or other similar activities.

This PR adds the most basic supports for read barrier opcodes. By default
read barriers use load handlers and evaluators.

A treetop of indirect read barriers looks like the following:

treetop
  xrdbari <#xxx A.instanceB>
    aload <auto 3>
...
  ==>xrdbari

A treetop of direct read barriers looks like the following:

treetop
  xrdbar <#xxx A.staticB>
    J9Class of A
...
  ==>xrdbar

Refer to eclipse-omr#2812 for more design details

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Oct 4, 2018
This PR contains a few changes to support rdbar/wrtbar for field watch
: adding field report helpers and jit resolve fields helpers, adding
enableFieldWatch option, changing canGCandReturn to return true for
readbar and wrtbar under field watch.

issue: eclipse-omr#2812

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Oct 4, 2018
This PR contains a few changes to support rdbar/wrtbar for field watch
: adding field report helpers and jit resolve fields helpers, adding
enableFieldWatch option, changing canGCandReturn to return true for
readbar and wrtbar under field watch.

issue: eclipse-omr#2812

Signed-off-by: Yi Zhang <[email protected]>
cathyzhyi pushed a commit to cathyzhyi/omr that referenced this issue Oct 4, 2018
This PR contains a few changes to support rdbar/wrtbar for field watch
: adding field report helpers and jit resolve fields helpers, adding
enableFieldWatch option, changing canGCandReturn to return true for
readbar and wrtbar under field watch.

issue: eclipse-omr#2812

Signed-off-by: Yi Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants