src/hotspot/share/opto/macro.hpp
author phedlin
Wed, 23 Oct 2019 12:51:53 +0200
changeset 58816 77148b8bb7a1
parent 58217 b1a394e15ae9
permissions -rw-r--r--
8231565: More node budget asserts in fuzzed tests. Reviewed-by: neliasso, thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51806
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1500
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1500
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1500
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51806
diff changeset
    25
#ifndef SHARE_OPTO_MACRO_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51806
diff changeset
    26
#define SHARE_OPTO_MACRO_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "opto/phase.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
class  AllocateNode;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
class  AllocateArrayNode;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class  CallNode;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
class  Node;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class  PhaseIterGVN;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
class PhaseMacroExpand : public Phase {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  PhaseIterGVN &_igvn;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
    40
public:
26166
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
    41
  // Helper methods roughly modeled after GraphKit:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  Node* basic_plus_adr(Node* base, int offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    return (offset == 0)? base: basic_plus_adr(base, MakeConX(offset));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  Node* basic_plus_adr(Node* base, Node* ptr, int offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    return (offset == 0)? ptr: basic_plus_adr(base, ptr, MakeConX(offset));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  Node* basic_plus_adr(Node* base, Node* offset) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    return basic_plus_adr(base, base, offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  Node* basic_plus_adr(Node* base, Node* ptr, Node* offset) {
24923
9631f7d691dc 8034812: remove IDX_INIT macro hack in Node class
thartmann
parents: 23491
diff changeset
    52
    Node* adr = new AddPNode(base, ptr, offset);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    return transform_later(adr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  Node* transform_later(Node* n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    // equivalent to _gvn.transform in GraphKit, Ideal, etc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    _igvn.register_new_node_with_optimizer(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    return n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  void set_eden_pointers(Node* &eden_top_adr, Node* &eden_end_adr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  Node* make_load( Node* ctl, Node* mem, Node* base, int offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
                   const Type* value_type, BasicType bt);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  Node* make_store(Node* ctl, Node* mem, Node* base, int offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
                   Node* value, BasicType bt);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
58217
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    66
  Node* make_leaf_call(Node* ctrl, Node* mem,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    67
                       const TypeFunc* call_type, address call_addr,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    68
                       const char* call_name,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    69
                       const TypePtr* adr_type,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    70
                       Node* parm0 = NULL, Node* parm1 = NULL,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    71
                       Node* parm2 = NULL, Node* parm3 = NULL,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    72
                       Node* parm4 = NULL, Node* parm5 = NULL,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    73
                       Node* parm6 = NULL, Node* parm7 = NULL);
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    74
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    75
  address basictype2arraycopy(BasicType t,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    76
                              Node* src_offset,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    77
                              Node* dest_offset,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    78
                              bool disjoint_bases,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    79
                              const char* &name,
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    80
                              bool dest_uninitialized);
b1a394e15ae9 8231085: C2/GC: Better GC-interface for expanding clone
rkennke
parents: 53244
diff changeset
    81
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
    82
private:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // projections extracted from a call node
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  ProjNode *_fallthroughproj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  ProjNode *_fallthroughcatchproj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  ProjNode *_ioproj_fallthrough;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  ProjNode *_ioproj_catchall;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  ProjNode *_catchallcatchproj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  ProjNode *_memproj_fallthrough;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  ProjNode *_memproj_catchall;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  ProjNode *_resproj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 22234
diff changeset
    93
  // Additional data collected during macro expansion
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 22234
diff changeset
    94
  bool _has_locks;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  void expand_allocate(AllocateNode *alloc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  void expand_allocate_array(AllocateArrayNode *alloc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  void expand_allocate_common(AllocateNode* alloc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
                              Node* length,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
                              const TypeFunc* slow_call_type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
                              address slow_call_address);
32370
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 30244
diff changeset
   102
  Node *value_from_mem(Node *mem, Node *ctl, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc);
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 30244
diff changeset
   103
  Node *value_from_mem_phi(Node *mem, BasicType ft, const Type *ftype, const TypeOopPtr *adr_t, AllocateNode *alloc, Node_Stack *value_phis, int level);
246
b029af7e69d3 6259129: (Escape Analysis) scalar replacement for not escaping objects
kvn
parents: 239
diff changeset
   104
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 13963
diff changeset
   105
  bool eliminate_boxing_node(CallStaticJavaNode *boxing);
246
b029af7e69d3 6259129: (Escape Analysis) scalar replacement for not escaping objects
kvn
parents: 239
diff changeset
   106
  bool eliminate_allocate_node(AllocateNode *alloc);
b029af7e69d3 6259129: (Escape Analysis) scalar replacement for not escaping objects
kvn
parents: 239
diff changeset
   107
  bool can_eliminate_allocation(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints);
b029af7e69d3 6259129: (Escape Analysis) scalar replacement for not escaping objects
kvn
parents: 239
diff changeset
   108
  bool scalar_replacement(AllocateNode *alloc, GrowableArray <SafePointNode *>& safepoints_done);
17383
3665c0901a0d 6934604: enable parts of EliminateAutoBox by default
kvn
parents: 13963
diff changeset
   109
  void process_users_of_allocation(CallNode *alloc);
246
b029af7e69d3 6259129: (Escape Analysis) scalar replacement for not escaping objects
kvn
parents: 239
diff changeset
   110
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   111
  void eliminate_gc_barrier(Node *p2x);
11445
3c768dca60f5 7125896: Eliminate nested locks
kvn
parents: 11191
diff changeset
   112
  void mark_eliminated_box(Node* box, Node* obj);
9977
c23d1a8dcaa9 7050280: assert(u->as_Unlock()->is_eliminated()) failed: sanity
kvn
parents: 7397
diff changeset
   113
  void mark_eliminated_locking_nodes(AbstractLockNode *alock);
239
fb31825d5444 6672848: (Escape Analysis) improve lock elimination with EA
kvn
parents: 1
diff changeset
   114
  bool eliminate_locking_node(AbstractLockNode *alock);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  void expand_lock_node(LockNode *lock);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  void expand_unlock_node(UnlockNode *unlock);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
26166
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   118
  // More helper methods modeled after GraphKit for array copy
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   119
  void insert_mem_bar(Node** ctrl, Node** mem, int opcode, Node* precedent = NULL);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   120
  Node* array_element_address(Node* ary, Node* idx, BasicType elembt);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   121
  Node* ConvI2L(Node* offset);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   122
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   123
  // helper methods modeled after LibraryCallKit for array copy
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   124
  Node* generate_guard(Node** ctrl, Node* test, RegionNode* region, float true_prob);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   125
  Node* generate_slow_guard(Node** ctrl, Node* test, RegionNode* region);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   126
  void generate_negative_guard(Node** ctrl, Node* index, RegionNode* region);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   127
  void generate_limit_guard(Node** ctrl, Node* offset, Node* subseq_length, Node* array_length, RegionNode* region);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   128
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   129
  // More helper methods for array copy
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   130
  Node* generate_nonpositive_guard(Node** ctrl, Node* index, bool never_negative);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   131
  void finish_arraycopy_call(Node* call, Node** ctrl, MergeMemNode** mem, const TypePtr* adr_type);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   132
  Node* generate_arraycopy(ArrayCopyNode *ac,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   133
                           AllocateArrayNode* alloc,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   134
                           Node** ctrl, MergeMemNode* mem, Node** io,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   135
                           const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   136
                           BasicType basic_elem_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   137
                           Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   138
                           Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   139
                           Node* copy_length,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   140
                           bool disjoint_bases = false,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   141
                           bool length_never_negative = false,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   142
                           RegionNode* slow_region = NULL);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   143
  void generate_clear_array(Node* ctrl, MergeMemNode* merge_mem,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   144
                            const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   145
                            Node* dest,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   146
                            BasicType basic_elem_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   147
                            Node* slice_idx,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   148
                            Node* slice_len,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   149
                            Node* dest_size);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   150
  bool generate_block_arraycopy(Node** ctrl, MergeMemNode** mem, Node* io,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   151
                                const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   152
                                BasicType basic_elem_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   153
                                AllocateNode* alloc,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   154
                                Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   155
                                Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   156
                                Node* dest_size, bool dest_uninitialized);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   157
  MergeMemNode* generate_slow_arraycopy(ArrayCopyNode *ac,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   158
                                        Node** ctrl, Node* mem, Node** io,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   159
                                        const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   160
                                        Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   161
                                        Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   162
                                        Node* copy_length, bool dest_uninitialized);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   163
  Node* generate_checkcast_arraycopy(Node** ctrl, MergeMemNode** mem,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   164
                                     const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   165
                                     Node* dest_elem_klass,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   166
                                     Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   167
                                     Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   168
                                     Node* copy_length, bool dest_uninitialized);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   169
  Node* generate_generic_arraycopy(Node** ctrl, MergeMemNode** mem,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   170
                                   const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   171
                                   Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   172
                                   Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   173
                                   Node* copy_length, bool dest_uninitialized);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   174
  void generate_unchecked_arraycopy(Node** ctrl, MergeMemNode** mem,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   175
                                    const TypePtr* adr_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   176
                                    BasicType basic_elem_type,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   177
                                    bool disjoint_bases,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   178
                                    Node* src,  Node* src_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   179
                                    Node* dest, Node* dest_offset,
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   180
                                    Node* copy_length, bool dest_uninitialized);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   181
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   182
  void expand_arraycopy_node(ArrayCopyNode *ac);
4b49fd58bbd9 7173584: Implement arraycopy as a macro node
roland
parents: 24923
diff changeset
   183
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  int replace_input(Node *use, Node *oldref, Node *newref);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  void copy_call_debug_info(CallNode *oldcall, CallNode * newcall);
1500
bea9a90f3e8f 6462850: generate biased locking code in C2 ideal graph
kvn
parents: 955
diff changeset
   186
  Node* opt_bits_test(Node* ctrl, Node* region, int edge, Node* word, int mask, int bits, bool return_fast_path = false);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  void copy_predefined_input_for_runtime_call(Node * ctrl, CallNode* oldcall, CallNode* call);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  CallNode* make_slow_call(CallNode *oldcall, const TypeFunc* slow_call_type, address slow_call,
30244
d4e471395ff5 8073165: Contended Locking fast exit bucket
dcubed
parents: 26166
diff changeset
   189
                           const char* leaf_name, Node* slow_path, Node* parm0, Node* parm1,
d4e471395ff5 8073165: Contended Locking fast exit bucket
dcubed
parents: 26166
diff changeset
   190
                           Node* parm2);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  void extract_call_projections(CallNode *call);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  Node* initialize_object(AllocateNode* alloc,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
                          Node* control, Node* rawmem, Node* object,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
                          Node* klass_node, Node* length,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
                          Node* size_in_bytes);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
43483
17e7b1ef5a83 8173147: [ctw] fails during compilation of sun.security.krb5.internal.crypto.RsaMd5DesCksumType::calculateKeyedChecksum with " graph should be schedulable"
roland
parents: 32370
diff changeset
   198
  Node* make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset, Node* ctl, Node* mem, BasicType ft, const Type *ftype, AllocateNode *alloc);
32370
38b7b5772b4f 8130847: Cloned object's fields observed as null after C2 escape analysis
roland
parents: 30244
diff changeset
   199
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
public:
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 22234
diff changeset
   201
  PhaseMacroExpand(PhaseIterGVN &igvn) : Phase(Macro_Expand), _igvn(igvn), _has_locks(false) {
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 246
diff changeset
   202
    _igvn.set_delay_transform(true);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 246
diff changeset
   203
  }
11191
d54ab5dcba83 6890673: Eliminate allocations immediately after EA
kvn
parents: 9977
diff changeset
   204
  void eliminate_macro_nodes();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  bool expand_macro_nodes();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
50180
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   207
  PhaseIterGVN &igvn() const { return _igvn; }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   208
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   209
  // Members accessed from BarrierSetC2
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   210
  void replace_node(Node* source, Node* target) { _igvn.replace_node(source, target); }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   211
  Node* intcon(jint con)        const { return _igvn.intcon(con); }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   212
  Node* longcon(jlong con)      const { return _igvn.longcon(con); }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   213
  Node* makecon(const Type *t)  const { return _igvn.makecon(t); }
ffa644980dff 8202377: Modularize C2 GC barriers
eosterlund
parents: 47216
diff changeset
   214
  Node* top()                   const { return C->top(); }
51806
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 50180
diff changeset
   215
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 50180
diff changeset
   216
  Node* prefetch_allocation(Node* i_o,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 50180
diff changeset
   217
                            Node*& needgc_false, Node*& contended_phi_rawmem,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 50180
diff changeset
   218
                            Node* old_eden_top, Node* new_eden_top,
1ecc914fb707 8210829: Modularize allocations in C2
rkennke
parents: 50180
diff changeset
   219
                            intx lines);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   221
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51806
diff changeset
   222
#endif // SHARE_OPTO_MACRO_HPP