11/*
2- * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
4848import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .REGISTER_NARROW_OOP ;
4949import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .REGISTER_OOP ;
5050import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .REGISTER_PRIMITIVE ;
51+ import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .REGISTER_VECTOR ;
5152import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .SITE_CALL ;
5253import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .SITE_DATA_PATCH ;
5354import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .SITE_EXCEPTION_HANDLER ;
6162import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .STACK_SLOT_NARROW_OOP ;
6263import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .STACK_SLOT_OOP ;
6364import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .STACK_SLOT_PRIMITIVE ;
65+ import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .STACK_SLOT_VECTOR ;
6466import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .VIRTUAL_OBJECT_ID ;
6567import static jdk .vm .ci .hotspot .HotSpotCompiledCodeStream .Tag .VIRTUAL_OBJECT_ID2 ;
6668
@@ -171,9 +173,11 @@ enum Tag {
171173 REGISTER_PRIMITIVE ,
172174 REGISTER_OOP ,
173175 REGISTER_NARROW_OOP ,
176+ REGISTER_VECTOR ,
174177 STACK_SLOT_PRIMITIVE ,
175178 STACK_SLOT_OOP ,
176179 STACK_SLOT_NARROW_OOP ,
180+ STACK_SLOT_VECTOR ,
177181 VIRTUAL_OBJECT_ID ,
178182 VIRTUAL_OBJECT_ID2 ,
179183 NULL_CONSTANT ,
@@ -1029,6 +1033,10 @@ private boolean isNarrowOop(Value oopValue) {
10291033 return oopValue .getPlatformKind () != runtime .getHostJVMCIBackend ().getTarget ().arch .getWordKind ();
10301034 }
10311035
1036+ private boolean isVector (Value value ) {
1037+ return value .getPlatformKind ().getVectorLength () > 1 ;
1038+ }
1039+
10321040 private void writeJavaValue (JavaValue value , JavaKind kind ) {
10331041 if (value == Value .ILLEGAL ) {
10341042 writeTag (ILLEGAL );
@@ -1039,12 +1047,30 @@ private void writeJavaValue(JavaValue value, JavaKind kind) {
10391047 writeTag (NULL_CONSTANT );
10401048 } else if (value instanceof RegisterValue ) {
10411049 RegisterValue reg = (RegisterValue ) value ;
1042- Tag tag = kind == JavaKind .Object ? (isNarrowOop (reg ) ? REGISTER_NARROW_OOP : REGISTER_OOP ) : REGISTER_PRIMITIVE ;
1050+ Tag tag ;
1051+ if (kind == JavaKind .Object ) {
1052+ if (isVector (reg )) {
1053+ tag = REGISTER_VECTOR ;
1054+ } else {
1055+ tag = isNarrowOop (reg ) ? REGISTER_NARROW_OOP : REGISTER_OOP ;
1056+ }
1057+ } else {
1058+ tag = REGISTER_PRIMITIVE ;
1059+ }
10431060 writeTag (tag );
10441061 writeRegister (reg .getRegister ());
10451062 } else if (value instanceof StackSlot ) {
10461063 StackSlot slot = (StackSlot ) value ;
1047- Tag tag = kind == JavaKind .Object ? (isNarrowOop (slot ) ? STACK_SLOT_NARROW_OOP : STACK_SLOT_OOP ) : STACK_SLOT_PRIMITIVE ;
1064+ Tag tag ;
1065+ if (kind == JavaKind .Object ) {
1066+ if (isVector (slot )) {
1067+ tag = STACK_SLOT_VECTOR ;
1068+ } else {
1069+ tag = isNarrowOop (slot ) ? STACK_SLOT_NARROW_OOP : STACK_SLOT_OOP ;
1070+ }
1071+ } else {
1072+ tag = STACK_SLOT_PRIMITIVE ;
1073+ }
10481074 writeTag (tag );
10491075 writeS2 ("offset" , slot .getRawOffset ());
10501076 writeBoolean ("addRawFrameSize" , slot .getRawAddFrameSize ());
0 commit comments