Skip to content

8356328: Some C2 IR nodes miss size_of() function #1814

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/hotspot/share/opto/intrinsicnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ class VectorizedHashCodeNode: public Node {
//------------------------------EncodeISOArray--------------------------------
// encode char[] to byte[] in ISO_8859_1 or ASCII
class EncodeISOArrayNode: public Node {
bool ascii;
bool _ascii;
public:
EncodeISOArrayNode(Node* control, Node* arymem, Node* s1, Node* s2, Node* c, bool ascii)
: Node(control, arymem, s1, s2, c), ascii(ascii) {}
: Node(control, arymem, s1, s2, c), _ascii(ascii) {}

bool is_ascii() { return ascii; }
bool is_ascii() { return _ascii; }
virtual int Opcode() const;
virtual bool depends_only_on_test() const { return false; }
virtual const Type* bottom_type() const { return TypeInt::INT; }
Expand All @@ -198,6 +198,11 @@ class EncodeISOArrayNode: public Node {
virtual uint ideal_reg() const { return Op_RegI; }
virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
virtual const Type* Value(PhaseGVN* phase) const;
virtual uint size_of() const { return sizeof(EncodeISOArrayNode); }
virtual uint hash() const { return Node::hash() + _ascii; }
virtual bool cmp(const Node& n) const {
return Node::cmp(n) && _ascii == ((EncodeISOArrayNode&)n).is_ascii();
}
};

//-------------------------------DigitNode----------------------------------------
Expand Down
14 changes: 9 additions & 5 deletions src/hotspot/share/opto/machnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ class MachConstantNode : public MachTypeNode {
int constant_offset() const { return ((MachConstantNode*) this)->constant_offset(); }
// Unchecked version to avoid assertions in debug output.
int constant_offset_unchecked() const;
virtual uint size_of() const { return sizeof(MachConstantNode); }
};

//------------------------------MachUEPNode-----------------------------------
Expand Down Expand Up @@ -526,17 +527,15 @@ class MachPrologNode : public MachIdealNode {
//------------------------------MachEpilogNode--------------------------------
// Machine function Epilog Node
class MachEpilogNode : public MachIdealNode {
private:
bool _do_polling;
public:
MachEpilogNode(bool do_poll = false) : _do_polling(do_poll) {}
virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const;
virtual uint size(PhaseRegAlloc *ra_) const;
virtual int reloc() const;
virtual const Pipeline *pipeline() const;

private:
bool _do_polling;

public:
virtual uint size_of() const { return sizeof(MachEpilogNode); }
bool do_polling() const { return _do_polling; }

#ifndef PRODUCT
Expand All @@ -560,6 +559,7 @@ class MachNopNode : public MachIdealNode {

virtual int ideal_Opcode() const { return Op_Con; } // bogus; see output.cpp
virtual const Pipeline *pipeline() const;
virtual uint size_of() const { return sizeof(MachNopNode); }
#ifndef PRODUCT
virtual const char *Name() const { return "Nop"; }
virtual void format( PhaseRegAlloc *, outputStream *st ) const;
Expand Down Expand Up @@ -787,6 +787,7 @@ class MachJumpNode : public MachConstantNode {
MachJumpNode() : MachConstantNode() {
init_class_id(Class_MachJump);
}
virtual uint size_of() const { return sizeof(MachJumpNode); }
};

//------------------------------MachGotoNode-----------------------------------
Expand Down Expand Up @@ -883,6 +884,7 @@ class MachSafePointNode : public MachReturnNode {
assert(verify_jvms(jvms), "jvms must match");
set_req(_jvmadj + jvms->monoff() + idx, c);
}
virtual uint size_of() const { return sizeof(MachSafePointNode); }
};

//------------------------------MachCallNode----------------------------------
Expand Down Expand Up @@ -997,6 +999,7 @@ class MachCallDynamicJavaNode : public MachCallJavaNode {
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
#endif
virtual uint size_of() const { return sizeof(MachCallDynamicJavaNode); }
};

//------------------------------MachCallRuntimeNode----------------------------
Expand Down Expand Up @@ -1030,6 +1033,7 @@ class MachHaltNode : public MachReturnNode {
bool _reachable;
const char* _halt_reason;
virtual JVMState* jvms() const;
virtual uint size_of() const { return sizeof(MachHaltNode); }
bool is_reachable() const {
return _reachable;
}
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/opto/memnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,11 @@ class ClearArrayNode: public Node {
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual uint match_edge(uint idx) const;
bool is_large() const { return _is_large; }
virtual uint size_of() const { return sizeof(ClearArrayNode); }
virtual uint hash() const { return Node::hash() + _is_large; }
virtual bool cmp(const Node& n) const {
return Node::cmp(n) && _is_large == ((ClearArrayNode&)n).is_large();
}

// Clear the given area of an object or array.
// The start offset must always be aligned mod BytesPerInt.
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/opto/opaquenode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class Opaque3Node : public Node {
virtual const Type* bottom_type() const { return TypeInt::INT; }
virtual Node* Identity(PhaseGVN* phase);
bool rtm_opt() const { return (_opt == RTM_OPT); }
virtual uint size_of() const { return sizeof(Opaque3Node); }
};

// Input 1 is a check that we know implicitly is always true or false
Expand Down Expand Up @@ -154,6 +155,7 @@ class ProfileBooleanNode : public Node {
virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
virtual Node* Identity(PhaseGVN* phase);
virtual const Type *bottom_type() const { return TypeInt::BOOL; }
virtual uint size_of() const { return sizeof(ProfileBooleanNode); }
};

#endif // SHARE_OPTO_OPAQUENODE_HPP