macro.hpp revision 73
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This code is free software; you can redistribute it and/or modify it
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * under the terms of the GNU General Public License version 2 only, as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * published by the Free Software Foundation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This code is distributed in the hope that it will be useful, but WITHOUT
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * version 2 for more details (a copy is included in the LICENSE file that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * accompanied this code).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You should have received a copy of the GNU General Public License version
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * 2 along with this work; if not, write to the Free Software Foundation,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CA 95054 USA or visit www.sun.com if you need additional information or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * have any questions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte // Helper methods roughly modelled after GraphKit:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* intcon(jint con) const { return _igvn.intcon(con); }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* longcon(jlong con) const { return _igvn.longcon(con); }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* makecon(const Type *t) const { return _igvn.makecon(t); }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* adr = new (C, 4) AddPNode(base, ptr, offset);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte // equivalent to _gvn.transform in GraphKit, Ideal, etc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte // projections extracted from a call node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void expand_allocate_array(AllocateArrayNode *alloc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node *value_from_mem(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, Node *alloc, int level);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bool eliminate_allocate_node(AllocateNode *alloc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void process_users_of_allocation(AllocateNode *alloc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte bool eliminate_locking_node(AbstractLockNode *alock);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int replace_input(Node *use, Node *oldref, Node *newref);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Node*& needgc_false, Node*& contended_phi_rawmem,