macro.hpp revision 113
0N/A/*
0N/A * Copyright 2005-2006 Sun Microsystems, Inc. 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 *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A *
0N/A */
0N/A
0N/Aclass AllocateNode;
0N/Aclass AllocateArrayNode;
0N/Aclass CallNode;
0N/Aclass Node;
0N/Aclass PhaseIterGVN;
0N/A
0N/Aclass PhaseMacroExpand : public Phase {
0N/Aprivate:
0N/A PhaseIterGVN &_igvn;
0N/A
0N/A // Helper methods roughly modelled after GraphKit:
0N/A Node* top() const { return C->top(); }
0N/A Node* intcon(jint con) const { return _igvn.intcon(con); }
0N/A Node* longcon(jlong con) const { return _igvn.longcon(con); }
0N/A Node* makecon(const Type *t) const { return _igvn.makecon(t); }
0N/A Node* basic_plus_adr(Node* base, int offset) {
0N/A return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
0N/A }
0N/A Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
0N/A return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
0N/A }
0N/A Node* basic_plus_adr(Node* base, Node* offset) {
0N/A return basic_plus_adr(base, base, offset);
0N/A }
0N/A Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
0N/A Node* adr = new (C, 4) AddPNode(base, ptr, offset);
0N/A return transform_later(adr);
0N/A }
0N/A Node* transform_later(Node* n) {
0N/A // equivalent to _gvn.transform in GraphKit, Ideal, etc.
0N/A _igvn.register_new_node_with_optimizer(n);
0N/A return n;
0N/A }
0N/A void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
0N/A Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
0N/A const Type* value_type, BasicType bt);
0N/A Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
0N/A Node* value, BasicType bt);
0N/A
0N/A // projections extracted from a call node
0N/A ProjNode *_fallthroughproj;
0N/A ProjNode *_fallthroughcatchproj;
0N/A ProjNode *_ioproj_fallthrough;
0N/A ProjNode *_ioproj_catchall;
0N/A ProjNode *_catchallcatchproj;
0N/A ProjNode *_memproj_fallthrough;
0N/A ProjNode *_memproj_catchall;
0N/A ProjNode *_resproj;
0N/A
0N/A
0N/A void expand_allocate(AllocateNode *alloc);
0N/A void expand_allocate_array(AllocateArrayNode *alloc);
0N/A void expand_allocate_common(AllocateNode* alloc,
0N/A Node* length,
0N/A const TypeFunc* slow_call_type,
0N/A address slow_call_address);
73N/A Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc);
73N/A Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc, int level);
73N/A
73N/A bool eliminate_allocate_node(AllocateNode *alloc);
73N/A bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
73N/A bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
73N/A void process_users_of_allocation(AllocateNode *alloc);
73N/A
73N/A void eliminate_card_mark(Node *cm);
66N/A bool eliminate_locking_node(AbstractLockNode *alock);
0N/A void expand_lock_node(LockNode *lock);
0N/A void expand_unlock_node(UnlockNode *unlock);
0N/A
0N/A int replace_input(Node *use, Node *oldref, Node *newref);
0N/A void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
0N/A Node* opt_iff(Node* region, Node* iff);
0N/A void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
0N/A CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
0N/A const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1);
0N/A void extract_call_projections(CallNode *call);
0N/A
0N/A Node* initialize_object(AllocateNode* alloc,
0N/A Node* control, Node* rawmem, Node* object,
0N/A Node* klass_node, Node* length,
0N/A Node* size_in_bytes);
0N/A
0N/A Node* prefetch_allocation(Node* i_o,
0N/A Node*& needgc_false, Node*& contended_phi_rawmem,
0N/A Node* old_eden_top, Node* new_eden_top,
0N/A Node* length);
0N/A
0N/Apublic:
113N/A PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn) {
113N/A _igvn.set_delay_transform(true);
113N/A }
0N/A bool expand_macro_nodes();
0N/A
0N/A};