Skip to content

Commit 5069796

Browse files
committed
8263164: assert(_base >= VectorA && _base <= VectorZ) failed: Not a Vector while calling StoreVectorNode::memory_size()
Reviewed-by: kvn, vlivanov
1 parent 996079b commit 5069796

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/hotspot/share/opto/vectornode.hpp

+15-5
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,27 @@ class AddVDNode : public VectorNode {
161161
//------------------------------ReductionNode------------------------------------
162162
// Perform reduction of a vector
163163
class ReductionNode : public Node {
164+
private:
165+
const Type* _bottom_type;
164166
public:
165-
ReductionNode(Node *ctrl, Node* in1, Node* in2) : Node(ctrl, in1, in2) {}
167+
ReductionNode(Node *ctrl, Node* in1, Node* in2) : Node(ctrl, in1, in2),
168+
_bottom_type(Type::get_const_basic_type(in1->bottom_type()->basic_type())) {}
166169

167170
static ReductionNode* make(int opc, Node *ctrl, Node* in1, Node* in2, BasicType bt);
168171
static int opcode(int opc, BasicType bt);
169172
static bool implemented(int opc, uint vlen, BasicType bt);
170173
static Node* make_reduction_input(PhaseGVN& gvn, int opc, BasicType bt);
171174

172175
virtual const Type* bottom_type() const {
173-
BasicType vbt = in(1)->bottom_type()->basic_type();
174-
return Type::get_const_basic_type(vbt);
176+
return _bottom_type;
175177
}
176178

177179
virtual uint ideal_reg() const {
178180
return bottom_type()->ideal_reg();
179181
}
182+
183+
// Needed for proper cloning.
184+
virtual uint size_of() const { return sizeof(*this); }
180185
};
181186

182187
//------------------------------AddReductionVINode--------------------------------------
@@ -739,14 +744,16 @@ class LoadVectorGatherNode : public LoadVectorNode {
739744
//------------------------------StoreVectorNode--------------------------------
740745
// Store Vector to memory
741746
class StoreVectorNode : public StoreNode {
747+
private:
748+
const TypeVect* _vect_type;
742749
public:
743750
StoreVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
744-
: StoreNode(c, mem, adr, at, val, MemNode::unordered) {
751+
: StoreNode(c, mem, adr, at, val, MemNode::unordered), _vect_type(val->bottom_type()->is_vect()) {
745752
init_class_id(Class_StoreVector);
746753
set_mismatched_access();
747754
}
748755

749-
const TypeVect* vect_type() const { return in(MemNode::ValueIn)->bottom_type()->is_vect(); }
756+
const TypeVect* vect_type() const { return _vect_type; }
750757
uint length() const { return vect_type()->length(); } // Vector length
751758

752759
virtual int Opcode() const;
@@ -760,6 +767,9 @@ class StoreVectorNode : public StoreNode {
760767
uint vlen);
761768

762769
uint element_size(void) { return type2aelembytes(vect_type()->element_basic_type()); }
770+
771+
// Needed for proper cloning.
772+
virtual uint size_of() const { return sizeof(*this); }
763773
};
764774

765775
//------------------------------StoreVectorScatterNode------------------------------

0 commit comments

Comments
 (0)