Mon, 24 Nov 2014 07:29:03 -0800
8058148: MaxNodeLimit and LiveNodeCountInliningCutoff
Reviewed-by: kvn, roland
duke@435 | 1 | /* |
mikael@6198 | 2 | * Copyright (c) 2005, 2013, 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) { |
kvn@4115 | 55 | Node* adr = new (C) 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 | |
kvn@6429 | 79 | // Additional data collected during macro expansion |
kvn@6429 | 80 | bool _has_locks; |
duke@435 | 81 | |
duke@435 | 82 | void expand_allocate(AllocateNode *alloc); |
duke@435 | 83 | void expand_allocate_array(AllocateArrayNode *alloc); |
duke@435 | 84 | void expand_allocate_common(AllocateNode* alloc, |
duke@435 | 85 | Node* length, |
duke@435 | 86 | const TypeFunc* slow_call_type, |
duke@435 | 87 | address slow_call_address); |
kvn@508 | 88 | Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc); |
kvn@682 | 89 | 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 | 90 | |
kvn@5110 | 91 | bool eliminate_boxing_node(CallStaticJavaNode *boxing); |
kvn@508 | 92 | bool eliminate_allocate_node(AllocateNode *alloc); |
kvn@508 | 93 | bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints); |
kvn@508 | 94 | bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done); |
kvn@5110 | 95 | void process_users_of_allocation(CallNode *alloc); |
kvn@508 | 96 | |
kvn@508 | 97 | void eliminate_card_mark(Node *cm); |
kvn@3406 | 98 | void mark_eliminated_box(Node* box, Node* obj); |
kvn@2951 | 99 | void mark_eliminated_locking_nodes(AbstractLockNode *alock); |
kvn@501 | 100 | bool eliminate_locking_node(AbstractLockNode *alock); |
duke@435 | 101 | void expand_lock_node(LockNode *lock); |
duke@435 | 102 | void expand_unlock_node(UnlockNode *unlock); |
duke@435 | 103 | |
duke@435 | 104 | int replace_input(Node *use, Node *oldref, Node *newref); |
duke@435 | 105 | void copy_call_debug_info(CallNode *oldcall, CallNode * newcall); |
kvn@855 | 106 | Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false); |
duke@435 | 107 | void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call); |
duke@435 | 108 | CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call, |
duke@435 | 109 | const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1); |
duke@435 | 110 | void extract_call_projections(CallNode *call); |
duke@435 | 111 | |
duke@435 | 112 | Node* initialize_object(AllocateNode* alloc, |
duke@435 | 113 | Node* control, Node* rawmem, Node* object, |
duke@435 | 114 | Node* klass_node, Node* length, |
duke@435 | 115 | Node* size_in_bytes); |
duke@435 | 116 | |
duke@435 | 117 | Node* prefetch_allocation(Node* i_o, |
duke@435 | 118 | Node*& needgc_false, Node*& contended_phi_rawmem, |
duke@435 | 119 | Node* old_eden_top, Node* new_eden_top, |
duke@435 | 120 | Node* length); |
duke@435 | 121 | |
duke@435 | 122 | public: |
kvn@6429 | 123 | PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn), _has_locks(false) { |
coleenp@548 | 124 | _igvn.set_delay_transform(true); |
coleenp@548 | 125 | } |
kvn@3311 | 126 | void eliminate_macro_nodes(); |
duke@435 | 127 | bool expand_macro_nodes(); |
duke@435 | 128 | |
duke@435 | 129 | }; |
stefank@2314 | 130 | |
stefank@2314 | 131 | #endif // SHARE_VM_OPTO_MACRO_HPP |