c1_Canonicalizer.hpp revision 2051
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_CANONICALIZER_HPP
1879N/A#define SHARE_VM_C1_C1_CANONICALIZER_HPP
1879N/A
1879N/A#include "c1/c1_Instruction.hpp"
1879N/A
0N/Aclass Canonicalizer: InstructionVisitor {
0N/A private:
1703N/A Compilation *_compilation;
0N/A Instruction* _canonical;
0N/A int _bci;
0N/A
1703N/A Compilation *compilation() { return _compilation; }
0N/A void set_canonical(Value x);
0N/A void set_bci(int bci) { _bci = bci; }
0N/A void set_constant(jint x) { set_canonical(new Constant(new IntConstant(x))); }
0N/A void set_constant(jlong x) { set_canonical(new Constant(new LongConstant(x))); }
0N/A void set_constant(jfloat x) { set_canonical(new Constant(new FloatConstant(x))); }
0N/A void set_constant(jdouble x) { set_canonical(new Constant(new DoubleConstant(x))); }
0N/A void move_const_to_right(Op2* x);
0N/A void do_Op2(Op2* x);
0N/A void do_UnsafeRawOp(UnsafeRawOp* x);
0N/A
0N/A void unsafe_raw_match(UnsafeRawOp* x,
0N/A Instruction** base,
0N/A Instruction** index,
0N/A int* scale);
0N/A
0N/A public:
1703N/A Canonicalizer(Compilation* c, Value x, int bci) : _compilation(c), _canonical(x), _bci(bci) {
1703N/A if (CanonicalizeNodes) x->visit(this);
1703N/A }
0N/A Value canonical() const { return _canonical; }
0N/A int bci() const { return _bci; }
0N/A
0N/A virtual void do_Phi (Phi* x);
0N/A virtual void do_Constant (Constant* x);
0N/A virtual void do_Local (Local* 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_IfInstanceOf (IfInstanceOf* x);
0N/A virtual void do_Convert (Convert* x);
0N/A virtual void do_NullCheck (NullCheck* 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_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);
0N/A virtual void do_UnsafePrefetchRead (UnsafePrefetchRead* x);
0N/A virtual void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x);
0N/A virtual void do_ProfileCall (ProfileCall* x);
1703N/A virtual void do_ProfileInvoke (ProfileInvoke* x);
2051N/A virtual void do_RuntimeCall (RuntimeCall* x);
0N/A};
1879N/A
1879N/A#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP