src/share/vm/opto/macro.hpp

Thu, 21 Jul 2011 11:25:07 -0700

author
kvn
date
Thu, 21 Jul 2011 11:25:07 -0700
changeset 3037
3d42f82cd811
parent 2951
642c68c75db9
child 3311
1bd45abaa507
permissions
-rw-r--r--

7063628: Use cbcond on T4
Summary: Add new short branch instruction to Hotspot sparc assembler.
Reviewed-by: never, twisti, jrose

duke@435 1 /*
stefank@2314 2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_OPTO_MACRO_HPP
stefank@2314 26 #define SHARE_VM_OPTO_MACRO_HPP
stefank@2314 27
stefank@2314 28 #include "opto/phase.hpp"
stefank@2314 29
duke@435 30 class AllocateNode;
duke@435 31 class AllocateArrayNode;
duke@435 32 class CallNode;
duke@435 33 class Node;
duke@435 34 class PhaseIterGVN;
duke@435 35
duke@435 36 class PhaseMacroExpand : public Phase {
duke@435 37 private:
duke@435 38 PhaseIterGVN &_igvn;
duke@435 39
duke@435 40 // Helper methods roughly modelled after GraphKit:
duke@435 41 Node* top() const { return C->top(); }
duke@435 42 Node* intcon(jint con) const { return _igvn.intcon(con); }
duke@435 43 Node* longcon(jlong con) const { return _igvn.longcon(con); }
duke@435 44 Node* makecon(const Type *t) const { return _igvn.makecon(t); }
duke@435 45 Node* basic_plus_adr(Node* base, int offset) {
duke@435 46 return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
duke@435 47 }
duke@435 48 Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
duke@435 49 return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
duke@435 50 }
duke@435 51 Node* basic_plus_adr(Node* base, Node* offset) {
duke@435 52 return basic_plus_adr(base, base, offset);
duke@435 53 }
duke@435 54 Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
duke@435 55 Node* adr = new (C, 4) AddPNode(base, ptr, offset);
duke@435 56 return transform_later(adr);
duke@435 57 }
duke@435 58 Node* transform_later(Node* n) {
duke@435 59 // equivalent to _gvn.transform in GraphKit, Ideal, etc.
duke@435 60 _igvn.register_new_node_with_optimizer(n);
duke@435 61 return n;
duke@435 62 }
duke@435 63 void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
duke@435 64 Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
duke@435 65 const Type* value_type, BasicType bt);
duke@435 66 Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
duke@435 67 Node* value, BasicType bt);
duke@435 68
duke@435 69 // projections extracted from a call node
duke@435 70 ProjNode *_fallthroughproj;
duke@435 71 ProjNode *_fallthroughcatchproj;
duke@435 72 ProjNode *_ioproj_fallthrough;
duke@435 73 ProjNode *_ioproj_catchall;
duke@435 74 ProjNode *_catchallcatchproj;
duke@435 75 ProjNode *_memproj_fallthrough;
duke@435 76 ProjNode *_memproj_catchall;
duke@435 77 ProjNode *_resproj;
duke@435 78
duke@435 79
duke@435 80 void expand_allocate(AllocateNode *alloc);
duke@435 81 void expand_allocate_array(AllocateArrayNode *alloc);
duke@435 82 void expand_allocate_common(AllocateNode* alloc,
duke@435 83 Node* length,
duke@435 84 const TypeFunc* slow_call_type,
duke@435 85 address slow_call_address);
kvn@508 86 Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc);
kvn@682 87 Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc, Node_Stack *value_phis, int level);
kvn@508 88
kvn@508 89 bool eliminate_allocate_node(AllocateNode *alloc);
kvn@508 90 bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
kvn@508 91 bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
kvn@508 92 void process_users_of_allocation(AllocateNode *alloc);
kvn@508 93
kvn@508 94 void eliminate_card_mark(Node *cm);
kvn@2951 95 void mark_eliminated_locking_nodes(AbstractLockNode *alock);
kvn@501 96 bool eliminate_locking_node(AbstractLockNode *alock);
duke@435 97 void expand_lock_node(LockNode *lock);
duke@435 98 void expand_unlock_node(UnlockNode *unlock);
duke@435 99
duke@435 100 int replace_input(Node *use, Node *oldref, Node *newref);
duke@435 101 void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
kvn@855 102 Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);
duke@435 103 void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
duke@435 104 CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
duke@435 105 const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1);
duke@435 106 void extract_call_projections(CallNode *call);
duke@435 107
duke@435 108 Node* initialize_object(AllocateNode* alloc,
duke@435 109 Node* control, Node* rawmem, Node* object,
duke@435 110 Node* klass_node, Node* length,
duke@435 111 Node* size_in_bytes);
duke@435 112
duke@435 113 Node* prefetch_allocation(Node* i_o,
duke@435 114 Node*& needgc_false, Node*& contended_phi_rawmem,
duke@435 115 Node* old_eden_top, Node* new_eden_top,
duke@435 116 Node* length);
duke@435 117
duke@435 118 public:
coleenp@548 119 PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn) {
coleenp@548 120 _igvn.set_delay_transform(true);
coleenp@548 121 }
duke@435 122 bool expand_macro_nodes();
duke@435 123
duke@435 124 };
stefank@2314 125
stefank@2314 126 #endif // SHARE_VM_OPTO_MACRO_HPP

mercurial