annotate hotspot/src/share/vm/opto/macro.hpp @ 360:21d113ecbf6a

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents b029af7e69d3
children ddf3e9583f2f
rev   line source
duke@1 1 /*
duke@1 2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
duke@1 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@1 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@1 21 * have any questions.
duke@1 22 *
duke@1 23 */
duke@1 24
duke@1 25 class AllocateNode;
duke@1 26 class AllocateArrayNode;
duke@1 27 class CallNode;
duke@1 28 class Node;
duke@1 29 class PhaseIterGVN;
duke@1 30
duke@1 31 class PhaseMacroExpand : public Phase {
duke@1 32 private:
duke@1 33 PhaseIterGVN &_igvn;
duke@1 34
duke@1 35 // Helper methods roughly modelled after GraphKit:
duke@1 36 Node* top() const { return C->top(); }
duke@1 37 Node* intcon(jint con) const { return _igvn.intcon(con); }
duke@1 38 Node* longcon(jlong con) const { return _igvn.longcon(con); }
duke@1 39 Node* makecon(const Type *t) const { return _igvn.makecon(t); }
duke@1 40 Node* basic_plus_adr(Node* base, int offset) {
duke@1 41 return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
duke@1 42 }
duke@1 43 Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
duke@1 44 return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
duke@1 45 }
duke@1 46 Node* basic_plus_adr(Node* base, Node* offset) {
duke@1 47 return basic_plus_adr(base, base, offset);
duke@1 48 }
duke@1 49 Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
duke@1 50 Node* adr = new (C, 4) AddPNode(base, ptr, offset);
duke@1 51 return transform_later(adr);
duke@1 52 }
duke@1 53 Node* transform_later(Node* n) {
duke@1 54 // equivalent to _gvn.transform in GraphKit, Ideal, etc.
duke@1 55 _igvn.register_new_node_with_optimizer(n);
duke@1 56 return n;
duke@1 57 }
duke@1 58 void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
duke@1 59 Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
duke@1 60 const Type* value_type, BasicType bt);
duke@1 61 Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
duke@1 62 Node* value, BasicType bt);
duke@1 63
duke@1 64 // projections extracted from a call node
duke@1 65 ProjNode *_fallthroughproj;
duke@1 66 ProjNode *_fallthroughcatchproj;
duke@1 67 ProjNode *_ioproj_fallthrough;
duke@1 68 ProjNode *_ioproj_catchall;
duke@1 69 ProjNode *_catchallcatchproj;
duke@1 70 ProjNode *_memproj_fallthrough;
duke@1 71 ProjNode *_memproj_catchall;
duke@1 72 ProjNode *_resproj;
duke@1 73
duke@1 74
duke@1 75 void expand_allocate(AllocateNode *alloc);
duke@1 76 void expand_allocate_array(AllocateArrayNode *alloc);
duke@1 77 void expand_allocate_common(AllocateNode* alloc,
duke@1 78 Node* length,
duke@1 79 const TypeFunc* slow_call_type,
duke@1 80 address slow_call_address);
kvn@246 81 Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc);
kvn@246 82 Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc, int level);
kvn@246 83
kvn@246 84 bool eliminate_allocate_node(AllocateNode *alloc);
kvn@246 85 bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
kvn@246 86 bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
kvn@246 87 void process_users_of_allocation(AllocateNode *alloc);
kvn@246 88
kvn@246 89 void eliminate_card_mark(Node *cm);
kvn@239 90 bool eliminate_locking_node(AbstractLockNode *alock);
duke@1 91 void expand_lock_node(LockNode *lock);
duke@1 92 void expand_unlock_node(UnlockNode *unlock);
duke@1 93
duke@1 94 int replace_input(Node *use, Node *oldref, Node *newref);
duke@1 95 void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
duke@1 96 Node* opt_iff(Node* region, Node* iff);
duke@1 97 void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
duke@1 98 CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
duke@1 99 const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1);
duke@1 100 void extract_call_projections(CallNode *call);
duke@1 101
duke@1 102 Node* initialize_object(AllocateNode* alloc,
duke@1 103 Node* control, Node* rawmem, Node* object,
duke@1 104 Node* klass_node, Node* length,
duke@1 105 Node* size_in_bytes);
duke@1 106
duke@1 107 Node* prefetch_allocation(Node* i_o,
duke@1 108 Node*& needgc_false, Node*& contended_phi_rawmem,
duke@1 109 Node* old_eden_top, Node* new_eden_top,
duke@1 110 Node* length);
duke@1 111
duke@1 112 public:
coleenp@360 113 PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn) {
coleenp@360 114 _igvn.set_delay_transform(true);
coleenp@360 115 }
duke@1 116 bool expand_macro_nodes();
duke@1 117
duke@1 118 };