equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
41 } |
41 } |
42 |
42 |
43 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } |
43 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } |
44 |
44 |
45 //------------------------------proj_out--------------------------------------- |
45 //------------------------------proj_out--------------------------------------- |
46 // Get a named projection |
46 // Get a named projection or null if not found |
47 ProjNode* MultiNode::proj_out(uint which_proj) const { |
47 ProjNode* MultiNode::proj_out_or_null(uint which_proj) const { |
48 assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); |
48 assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); |
49 assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2, "bad if #1"); |
49 assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || outcnt() == 2, "bad if #1"); |
50 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { |
50 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { |
51 Node *p = fast_out(i); |
51 Node *p = fast_out(i); |
52 if (p->is_Proj()) { |
52 if (p->is_Proj()) { |
59 assert(p == this && this->is_Start(), "else must be proj"); |
59 assert(p == this && this->is_Start(), "else must be proj"); |
60 continue; |
60 continue; |
61 } |
61 } |
62 } |
62 } |
63 return NULL; |
63 return NULL; |
|
64 } |
|
65 |
|
66 // Get a named projection |
|
67 ProjNode* MultiNode::proj_out(uint which_proj) const { |
|
68 ProjNode* p = proj_out_or_null(which_proj); |
|
69 assert(p != NULL, "named projection %u not found", which_proj); |
|
70 return p; |
64 } |
71 } |
65 |
72 |
66 //============================================================================= |
73 //============================================================================= |
67 //------------------------------ProjNode--------------------------------------- |
74 //------------------------------ProjNode--------------------------------------- |
68 uint ProjNode::hash() const { |
75 uint ProjNode::hash() const { |
212 return NULL; |
219 return NULL; |
213 } |
220 } |
214 } |
221 } |
215 |
222 |
216 ProjNode* other_proj = iff->proj_out(1-_con); |
223 ProjNode* other_proj = iff->proj_out(1-_con); |
217 if (other_proj == NULL) // Should never happen, but make Parfait happy. |
|
218 return NULL; |
|
219 CallStaticJavaNode* call = other_proj->is_uncommon_trap_proj(reason); |
224 CallStaticJavaNode* call = other_proj->is_uncommon_trap_proj(reason); |
220 if (call != NULL) { |
225 if (call != NULL) { |
221 assert(reason == Deoptimization::Reason_none || |
226 assert(reason == Deoptimization::Reason_none || |
222 Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); |
227 Compile::current()->is_predicate_opaq(iff->in(1)->in(1)), "should be on the list"); |
223 return call; |
228 return call; |