RFR: 8200113: Make Access load proxys smarter (original) (raw)
Erik Österlund erik.osterlund at oracle.com
Fri Mar 23 08:29:17 UTC 2018
- Previous message: RFR: 8200113: Make Access load proxys smarter
- Next message: RFR: 8200105: Remove cyclic dependency between oop.inline.hpp and collectedHeap.inline.hpp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Per,
Thanks for the review.
/Erik
On 2018-03-23 09:05, Per Liden wrote:
Looks good!
/Per On 03/22/2018 05:03 PM, Erik Österlund wrote: Looping in hotspot-dev.
/Erik On 2018-03-22 15:19, Erik Österlund wrote: Hi,
Access returns the result of loads through load proxy objects that implicity convert themselves to a template inferred type. This is a metaprogramming technique used to infer return types in C++. However, I have heard requests that it would be great if it could be a bit smarter and do more than just be assigned to a type. Example use cases that do not work today without workarounds: oop val = ...; narrowOop narrow = 0u; oop *oopval = &val; narrowOop *narrowval = &narrow; HeapWord *heapwordval = reinterpretcast<HeapWord*>(oopval); if (val == HeapAccess<>::ooploadat(val, 16)) {} if (HeapAccess<>::ooploadat(val, 16) == val) {} if (val != HeapAccess<>::ooploadat(val, 16)) {} if (HeapAccess<>::ooploadat(val, 16) != val) {} if (HeapAccess<>::oopload(oopval) != val) {} if (HeapAccess<>::oopload(heapwordval) != val) {} if (RawAccess<>::oopload(narrowval) != narrow) {} if (HeapAccess<>::oopload(oopval) == val) {} if (HeapAccess<>::oopload(heapwordval) == val) {} if (RawAccess<>::oopload(narrowval) == narrow) {} if (val != HeapAccess<>::oopload(oopval)) {} if (val != HeapAccess<>::oopload(heapwordval)) {} if (narrow != RawAccess<>::oopload(narrowval)) {} if (val == HeapAccess<>::oopload(oopval)) {} if (val == HeapAccess<>::oopload(heapwordval)) {} if (narrow == RawAccess<>::oopload(narrowval)) {} if ((oop)HeapAccess<>::oopload(oopval) == NULL) {} oop tmp = true ? HeapAccess<>::oopload(oopval) : val; Here is a patch that solves this: http://cr.openjdk.java.net/~eosterlund/8200113/webrev.00/ ...and here is the bug ID: https://bugs.openjdk.java.net/browse/JDK-8200113 Thanks, /Erik
- Previous message: RFR: 8200113: Make Access load proxys smarter
- Next message: RFR: 8200105: Remove cyclic dependency between oop.inline.hpp and collectedHeap.inline.hpp
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]