1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
422 if( two_adr() ) return false;
423
424 // Check for rematerializing float constants, or not
425 if( !Matcher::rematerialize_float_constants ) {
426 int op = ideal_Opcode();
427 if( op == Op_ConF || op == Op_ConD )
428 return false;
429 }
430
431 // Defining flags - can't spill these! Must remateralize.
432 if( ideal_reg() == Op_RegFlags )
433 return true;
434
435 // Stretching lots of inputs - don't do it.
436 if( req() > 2 )
437 return false;
438
439 // Don't remateralize somebody with bound inputs - it stretches a
440 // fixed register lifetime.
441 uint idx = oper_input_base();
442 if( req() > idx ) {
443 const RegMask &rm = in_RegMask(idx);
444 if( rm.is_bound1() || rm.is_bound2() )
445 return false;
446 }
447
448 return true;
449 }
450
451 #ifndef PRODUCT
452 //------------------------------dump_spec--------------------------------------
453 // Print any per-operand special info
454 void MachNode::dump_spec(outputStream *st) const {
455 uint cnt = num_opnds();
456 for( uint i=0; i<cnt; i++ )
457 _opnds[i]->dump_spec(st);
458 const TypePtr *t = adr_type();
459 if( t ) {
460 Compile* C = Compile::current();
461 if( C->alias_type(t)->is_volatile() )
462 st->print(" Volatile!");
463 }
464 }
|
1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
422 if( two_adr() ) return false;
423
424 // Check for rematerializing float constants, or not
425 if( !Matcher::rematerialize_float_constants ) {
426 int op = ideal_Opcode();
427 if( op == Op_ConF || op == Op_ConD )
428 return false;
429 }
430
431 // Defining flags - can't spill these! Must remateralize.
432 if( ideal_reg() == Op_RegFlags )
433 return true;
434
435 // Stretching lots of inputs - don't do it.
436 if( req() > 2 )
437 return false;
438
439 // Don't remateralize somebody with bound inputs - it stretches a
440 // fixed register lifetime.
441 uint idx = oper_input_base();
442 if (req() > idx) {
443 const RegMask &rm = in_RegMask(idx);
444 if (rm.is_bound(ideal_reg()))
445 return false;
446 }
447
448 return true;
449 }
450
451 #ifndef PRODUCT
452 //------------------------------dump_spec--------------------------------------
453 // Print any per-operand special info
454 void MachNode::dump_spec(outputStream *st) const {
455 uint cnt = num_opnds();
456 for( uint i=0; i<cnt; i++ )
457 _opnds[i]->dump_spec(st);
458 const TypePtr *t = adr_type();
459 if( t ) {
460 Compile* C = Compile::current();
461 if( C->alias_type(t)->is_volatile() )
462 st->print(" Volatile!");
463 }
464 }
|