RFR: 8265126: unified handling for VectorMask object re-materialization during de-optimization (re-submit) [v2]

Vladimir Ivanov vlivanov at openjdk.java.net
Fri Apr 30 19:16:55 UTC 2021

On Fri, 30 Apr 2021 13:09:16 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Following flow describes object reconstruction for de-optimization:-
>> 1. PhaseVector::scalarize_vbox_node() creates SafePointScalarObjectNode to captures the box type information, also it connects to node holding the boxed value.
>> 2. During code emit phase (PhaseOutput) C2 process above information to dumps ObjectValue holding the box information and LocationValue to holding the value information into ScopeDescriptor corresponding to Safepoint PC.
>> 3. De-optimization blobs dump the value held in registers to the stack locations using RegisterSave::save_live_registers() and a mapping b/w register and its stack location is added to RegisterMap.
>> 4. During de-optimization, compiled frame objects are re-allocated using identity information held in ObjectValue and their fields are initialized using values held in the stack locations accessed through register-stack mappings.
>> By inserting a VectorStoreMaskNode before stitching the mask holding node to Safepoint we make sure that value held in opmask/vector register is transferred to a byte vector. Thus rest of the flow works as it is, stack location will hold the value in the form of a byte array irrespective of the box shape.
>> tier1-tier3 regressions are clean with UseAVX=2/3.
> Jatin Bhateja has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>  - Merge http://github.com/openjdk/jdk into JDK-8265126
>  - 8265126:[REDO] unified handling for VectorMask object re-materialization during de-optimization

Submitted the patch for testing (hs-tier1 - hs-tier4).

src/hotspot/share/opto/vector.cpp line 244:

> 242:     SafePointNode* sfpt = safepoints.pop()->as_SafePoint();
> 243: 
> 244:     ciInstanceKlass* iklass = vec_box->box_type()->klass()->as_instance_klass();

Why do you remove that code? It was added to avoid a crash with -XX:+PrintAssembly.

src/hotspot/share/prims/vectorSupport.cpp line 100:

> 98: void VectorSupport::init_payload_element(typeArrayOop arr, BasicType elem_bt, int index, address addr) {
> 99:   switch (elem_bt) {
> 100:     case T_BOOLEAN: arr->  byte_at_put(index,   *(jboolean*)addr); break;

Please, use `bool_at_put` and fix formatting.


PR: https://git.openjdk.java.net/jdk/pull/3721

More information about the hotspot-compiler-dev mailing list