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 * 23 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_Canonicalizer.cpp.incl" 27 28 29 class PrintValueVisitor: public ValueVisitor { 30 void visit(Value* vp) { 31 (*vp)->print_line(); 32 } 33 }; 34 35 void Canonicalizer::set_canonical(Value x) { 36 assert(x != NULL, "value must exist"); 37 // Note: we can not currently substitute root nodes which show up in 38 // the instruction stream (because the instruction list is embedded 39 // in the instructions). 40 if (canonical() != x) { 41 if (PrintCanonicalization) { 42 PrintValueVisitor do_print_value; 43 canonical()->input_values_do(&do_print_value); 44 canonical()->print_line(); 45 tty->print_cr("canonicalized to:"); 46 x->input_values_do(&do_print_value); | 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 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "c1/c1_Canonicalizer.hpp" 27 #include "c1/c1_InstructionPrinter.hpp" 28 #include "ci/ciArray.hpp" 29 #include "runtime/sharedRuntime.hpp" 30 31 32 class PrintValueVisitor: public ValueVisitor { 33 void visit(Value* vp) { 34 (*vp)->print_line(); 35 } 36 }; 37 38 void Canonicalizer::set_canonical(Value x) { 39 assert(x != NULL, "value must exist"); 40 // Note: we can not currently substitute root nodes which show up in 41 // the instruction stream (because the instruction list is embedded 42 // in the instructions). 43 if (canonical() != x) { 44 if (PrintCanonicalization) { 45 PrintValueVisitor do_print_value; 46 canonical()->input_values_do(&do_print_value); 47 canonical()->print_line(); 48 tty->print_cr("canonicalized to:"); 49 x->input_values_do(&do_print_value); |