/* * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
//============================================================================= // Do not match memory edge.
uint StrIntrinsicNode::match_edge(uint idx) const { return idx == 2 || idx == 3;
}
//------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies
Node* StrIntrinsicNode::Ideal(PhaseGVN* phase, bool can_reshape) { if (remove_dead_region(phase, can_reshape)) returnthis; // Don't bother trying to transform a dead node if (in(0) && in(0)->is_top()) return NULL;
if (can_reshape) {
Node* mem = phase->transform(in(MemNode::Memory)); // If transformed to a MergeMem, get the desired slice
uint alias_idx = phase->C->get_alias_index(adr_type());
mem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(alias_idx) : mem; if (mem != in(MemNode::Memory)) {
set_req_X(MemNode::Memory, mem, phase); returnthis;
}
} return NULL;
}
//============================================================================= //------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies
Node* StrCompressedCopyNode::Ideal(PhaseGVN* phase, bool can_reshape) { return remove_dead_region(phase, can_reshape) ? this : NULL;
}
//============================================================================= //------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies
Node* StrInflatedCopyNode::Ideal(PhaseGVN* phase, bool can_reshape) { return remove_dead_region(phase, can_reshape) ? this : NULL;
}
//============================================================================= //------------------------------match_edge------------------------------------- // Do not match memory edge
uint EncodeISOArrayNode::match_edge(uint idx) const { return idx == 2 || idx == 3; // EncodeISOArray src (Binary dst len)
}
//------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies
Node* EncodeISOArrayNode::Ideal(PhaseGVN* phase, bool can_reshape) { return remove_dead_region(phase, can_reshape) ? this : NULL;
}
jlong hi = bt == T_INT ? max_jint : max_jlong;
jlong lo = bt == T_INT ? min_jint : min_jlong;
if(mask_type->is_con() && mask_type->get_con_as_long(bt) != -1L) {
jlong maskcon = mask_type->get_con_as_long(bt); int bitcount = population_count(static_cast<julong>(bt == T_INT ? maskcon & 0xFFFFFFFFL : maskcon)); if (opc == Op_CompressBits) { // Bit compression selects the source bits corresponding to true mask bits // and lays them out contiguously at desitination bit poistions starting from // LSB, remaining higher order bits are set to zero. // Thus, it will always generates a +ve value i.e. sign bit set to 0 if // any bit of constant mask value is zero.
lo = 0L;
hi = (1L << bitcount) - 1;
} else {
assert(opc == Op_ExpandBits, ""); // Expansion sequentially reads source bits starting from LSB // and places them over destination at bit positions corresponding // set mask bit. Thus bit expansion for non-negative mask value // will always generate a +ve value.
hi = maskcon >= 0L ? maskcon : maskcon ^ lo;
lo = maskcon >= 0L ? 0L : lo;
}
}
if (!mask_type->is_con()) { int mask_max_bw; int max_bw = bt == T_INT ? 32 : 64; // Case 1) Mask value range includes -1. if ((mask_type->lo_as_long() < 0L && mask_type->hi_as_long() >= -1L)) {
mask_max_bw = max_bw; // Case 2) Mask value range is less than -1.
} elseif (mask_type->hi_as_long() < -1L) {
mask_max_bw = max_bw - 1;
} else { // Case 3) Mask value range only includes +ve values.
assert(mask_type->lo_as_long() >= 0, "");
jlong clz = count_leading_zeros(mask_type->hi_as_long());
clz = bt == T_INT ? clz - 32 : clz;
mask_max_bw = max_bw - clz;
} if ( opc == Op_CompressBits) {
lo = mask_max_bw == max_bw ? lo : 0L; // Compress operation is inherently an unsigned operation and // result value range is primarily dependent on true count // of participating mask value.
hi = mask_max_bw < max_bw ? (1L << mask_max_bw) - 1 : src_type->hi_as_long();
} else {
assert(opc == Op_ExpandBits, "");
jlong max_mask = mask_type->hi_as_long(); // Since mask here a range and not a constant value, hence being // conservative in determining the value range of result.
lo = mask_type->lo_as_long() >= 0L ? 0L : lo;
hi = mask_type->lo_as_long() >= 0L ? max_mask : hi;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.