Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/cfgnode.hpp @ 127:e0bd2e08e3d0
6663848: assert(i < Max(),"oob") in C2 with -Xcomp
Summary: NeverBranchNodes aren't handled properly
Reviewed-by: kvn, sgoldman, rasbold, jrose
author | never |
---|---|
date | Thu, 24 Apr 2008 11:13:03 -0700 |
parents | 2a9af0b9cb1c |
children | d1605aabd0a1 1dd146f17531 |
comparison
equal
deleted
inserted
replaced
126:72f4a668df19 | 127:e0bd2e08e3d0 |
---|---|
242 class MultiBranchNode : public MultiNode { | 242 class MultiBranchNode : public MultiNode { |
243 public: | 243 public: |
244 MultiBranchNode( uint required ) : MultiNode(required) { | 244 MultiBranchNode( uint required ) : MultiNode(required) { |
245 init_class_id(Class_MultiBranch); | 245 init_class_id(Class_MultiBranch); |
246 } | 246 } |
247 // returns required number of users to be well formed. | |
248 virtual int required_outcnt() const = 0; | |
247 }; | 249 }; |
248 | 250 |
249 //------------------------------IfNode----------------------------------------- | 251 //------------------------------IfNode----------------------------------------- |
250 // Output selected Control, based on a boolean test | 252 // Output selected Control, based on a boolean test |
251 class IfNode : public MultiBranchNode { | 253 class IfNode : public MultiBranchNode { |
331 virtual int Opcode() const; | 333 virtual int Opcode() const; |
332 virtual bool pinned() const { return true; } | 334 virtual bool pinned() const { return true; } |
333 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } | 335 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } |
334 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | 336 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
335 virtual const Type *Value( PhaseTransform *phase ) const; | 337 virtual const Type *Value( PhaseTransform *phase ) const; |
338 virtual int required_outcnt() const { return 2; } | |
336 virtual const RegMask &out_RegMask() const; | 339 virtual const RegMask &out_RegMask() const; |
337 void dominated_by(Node* prev_dom, PhaseIterGVN* igvn); | 340 void dominated_by(Node* prev_dom, PhaseIterGVN* igvn); |
338 int is_range_check(Node* &range, Node* &index, jint &offset); | 341 int is_range_check(Node* &range, Node* &index, jint &offset); |
339 Node* fold_compares(PhaseGVN* phase); | 342 Node* fold_compares(PhaseGVN* phase); |
340 static Node* up_one_dom(Node* curr, bool linear_only = false); | 343 static Node* up_one_dom(Node* curr, bool linear_only = false); |
389 virtual int Opcode() const; | 392 virtual int Opcode() const; |
390 virtual const Type *Value( PhaseTransform *phase ) const; | 393 virtual const Type *Value( PhaseTransform *phase ) const; |
391 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | 394 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); |
392 virtual const Type *bottom_type() const; | 395 virtual const Type *bottom_type() const; |
393 virtual bool pinned() const { return true; } | 396 virtual bool pinned() const { return true; } |
397 virtual int required_outcnt() const { return _size; } | |
394 }; | 398 }; |
395 | 399 |
396 //------------------------------JumpNode--------------------------------------- | 400 //------------------------------JumpNode--------------------------------------- |
397 // Indirect branch. Uses PCTable above to implement a switch statement. | 401 // Indirect branch. Uses PCTable above to implement a switch statement. |
398 // It emits as a table load and local branch. | 402 // It emits as a table load and local branch. |
502 public: | 506 public: |
503 NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); } | 507 NeverBranchNode( Node *ctrl ) : MultiBranchNode(1) { init_req(0,ctrl); } |
504 virtual int Opcode() const; | 508 virtual int Opcode() const; |
505 virtual bool pinned() const { return true; }; | 509 virtual bool pinned() const { return true; }; |
506 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } | 510 virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } |
507 | 511 virtual const Type *Value( PhaseTransform *phase ) const; |
512 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); | |
513 virtual int required_outcnt() const { return 2; } | |
508 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } | 514 virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } |
509 virtual uint size(PhaseRegAlloc *ra_) const { return 0; } | 515 virtual uint size(PhaseRegAlloc *ra_) const { return 0; } |
510 #ifndef PRODUCT | 516 #ifndef PRODUCT |
511 virtual void format( PhaseRegAlloc *, outputStream *st ) const; | 517 virtual void format( PhaseRegAlloc *, outputStream *st ) const; |
512 #endif | 518 #endif |