0N/A/*
2051N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP
1879N/A#define SHARE_VM_C1_C1_INSTRUCTIONPRINTER_HPP
1879N/A
1879N/A#include "c1/c1_IR.hpp"
1879N/A#include "c1/c1_Instruction.hpp"
1879N/A#include "c1/c1_Runtime1.hpp"
1879N/A
0N/A#ifndef PRODUCT
0N/Aclass InstructionPrinter: public InstructionVisitor {
0N/A private:
0N/A outputStream* _output;
0N/A bool _print_phis;
0N/A
0N/A enum LayoutConstants {
0N/A bci_pos = 2,
0N/A use_pos = 7,
0N/A temp_pos = 12,
0N/A instr_pos = 19,
0N/A end_pos = 60
0N/A };
0N/A
0N/A bool is_illegal_phi(Value v);
0N/A
0N/A public:
0N/A InstructionPrinter(bool print_phis = true, outputStream* output = tty)
0N/A : _print_phis(print_phis)
0N/A , _output(output)
0N/A {}
0N/A
0N/A outputStream* output() { return _output; }
0N/A
0N/A // helpers
0N/A static const char* basic_type_name(BasicType type);
0N/A static const char* cond_name(If::Condition cond);
0N/A static const char* op_name(Bytecodes::Code op);
0N/A bool is_phi_of_block(Value v, BlockBegin* b);
0N/A
0N/A // type-specific print functions
0N/A void print_klass(ciKlass* klass);
0N/A void print_object(Value obj);
0N/A
0N/A // generic print functions
0N/A void print_temp(Value value);
0N/A void print_field(AccessField* field);
0N/A void print_indexed(AccessIndexed* indexed);
0N/A void print_monitor(AccessMonitor* monitor);
0N/A void print_op2(Op2* instr);
0N/A void print_value(Value value);
0N/A void print_instr(Instruction* instr);
0N/A void print_stack(ValueStack* stack);
0N/A void print_inline_level(BlockBegin* block);
0N/A void print_unsafe_op(UnsafeOp* op, const char* name);
0N/A void print_unsafe_raw_op(UnsafeRawOp* op, const char* name);
0N/A void print_unsafe_object_op(UnsafeObjectOp* op, const char* name);
0N/A void print_phi(int i, Value v, BlockBegin* b);
0N/A void print_alias(Value v);
0N/A
0N/A // line printing of instructions
0N/A void fill_to(int pos, char filler = ' ');
0N/A void print_head();
0N/A void print_line(Instruction* instr);
0N/A
0N/A // visitor functionality
0N/A virtual void do_Phi (Phi* x);
0N/A virtual void do_Local (Local* x);
0N/A virtual void do_Constant (Constant* x);
0N/A virtual void do_LoadField (LoadField* x);
0N/A virtual void do_StoreField (StoreField* x);
0N/A virtual void do_ArrayLength (ArrayLength* x);
0N/A virtual void do_LoadIndexed (LoadIndexed* x);
0N/A virtual void do_StoreIndexed (StoreIndexed* x);
0N/A virtual void do_NegateOp (NegateOp* x);
0N/A virtual void do_ArithmeticOp (ArithmeticOp* x);
0N/A virtual void do_ShiftOp (ShiftOp* x);
0N/A virtual void do_LogicOp (LogicOp* x);
0N/A virtual void do_CompareOp (CompareOp* x);
0N/A virtual void do_IfOp (IfOp* x);
0N/A virtual void do_Convert (Convert* x);
0N/A virtual void do_NullCheck (NullCheck* x);
3932N/A virtual void do_TypeCast (TypeCast* x);
0N/A virtual void do_Invoke (Invoke* x);
0N/A virtual void do_NewInstance (NewInstance* x);
0N/A virtual void do_NewTypeArray (NewTypeArray* x);
0N/A virtual void do_NewObjectArray (NewObjectArray* x);
0N/A virtual void do_NewMultiArray (NewMultiArray* x);
0N/A virtual void do_CheckCast (CheckCast* x);
0N/A virtual void do_InstanceOf (InstanceOf* x);
0N/A virtual void do_MonitorEnter (MonitorEnter* x);
0N/A virtual void do_MonitorExit (MonitorExit* x);
0N/A virtual void do_Intrinsic (Intrinsic* x);
0N/A virtual void do_BlockBegin (BlockBegin* x);
0N/A virtual void do_Goto (Goto* x);
0N/A virtual void do_If (If* x);
0N/A virtual void do_IfInstanceOf (IfInstanceOf* x);
0N/A virtual void do_TableSwitch (TableSwitch* x);
0N/A virtual void do_LookupSwitch (LookupSwitch* x);
0N/A virtual void do_Return (Return* x);
0N/A virtual void do_Throw (Throw* x);
0N/A virtual void do_Base (Base* x);
0N/A virtual void do_OsrEntry (OsrEntry* x);
0N/A virtual void do_ExceptionObject(ExceptionObject* x);
0N/A virtual void do_RoundFP (RoundFP* x);
0N/A virtual void do_UnsafeGetRaw (UnsafeGetRaw* x);
0N/A virtual void do_UnsafePutRaw (UnsafePutRaw* x);
0N/A virtual void do_UnsafeGetObject(UnsafeGetObject* x);
0N/A virtual void do_UnsafePutObject(UnsafePutObject* x);
Error!

 

There was an error!

null

java.lang.NullPointerException