hotspot/src/share/vm/opto/idealKit.hpp
author kvn
Mon, 21 Mar 2011 11:28:14 -0700
changeset 8732 16fc1c68714b
parent 7397 5b173b4ca846
child 9100 860ba6f8b53f
child 8921 14bfe81f2a9d
permissions -rw-r--r--
7008866: Missing loop predicate for loop with multiple entries Summary: Add predicates when loop head bytecode is parsed instead of when back branch bytecode is parsed. Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2005, 2010, 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: 3919
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3919
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: 3919
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
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_OPTO_IDEALKIT_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_OPTO_IDEALKIT_HPP
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/addnode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "opto/cfgnode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "opto/connode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "opto/divnode.hpp"
8732
16fc1c68714b 7008866: Missing loop predicate for loop with multiple entries
kvn
parents: 7397
diff changeset
    32
#include "opto/graphKit.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    33
#include "opto/mulnode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    34
#include "opto/phaseX.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    35
#include "opto/subnode.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    36
#include "opto/type.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    37
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
//-----------------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
//----------------------------IdealKit-----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// Set of utilities for creating control flow and scalar SSA data flow.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// Control:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
//    if_then(left, relop, right)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
//    else_ (optional)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
//    end_if
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
//    loop(iv variable, initial, relop, limit)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
//       - sets iv to initial for first trip
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
//       - exits when relation on limit is true
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
//       - the values of initial and limit should be loop invariant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
//       - no increment, must be explicitly coded
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
//       - final value of iv is available after end_loop (until dead())
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
//    end_loop
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
//    make_label(number of gotos)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
//    goto_(label)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
//    bind(label)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// Data:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
//    ConI(integer constant)     - create an integer constant
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
//    set(variable, value)       - assignment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
//    value(variable)            - reference value
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
//    dead(variable)             - variable's value is no longer live
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
//    increment(variable, value) - increment variable by value
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
//    simple operations: AddI, SubI, AndI, LShiftI, etc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// Example:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
//    Node* limit = ??
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
//    IdealVariable i(kit), j(kit);
3268
f034e0c86895 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 1
diff changeset
    65
//    declarations_done();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
//    Node* exit = make_label(1); // 1 goto
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
//    set(j, ConI(0));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
//    loop(i, ConI(0), BoolTest::lt, limit); {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
//       if_then(value(i), BoolTest::gt, ConI(5)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
//         set(j, ConI(1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
//         goto_(exit); dead(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
//       } end_if();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
//       increment(i, ConI(1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
//    } end_loop(); dead(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
//    bind(exit);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
// See string_indexOf for a more complete example.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
class IdealKit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
// Variable definition for IdealKit
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
class IdealVariable: public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
 friend class IdealKit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  int _id;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  void set_id(int id) { _id = id; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  IdealVariable(IdealKit &k);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  int id() { assert(has_id(),"uninitialized id"); return _id; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  bool has_id() { return _id >= 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
class IdealKit: public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
 friend class IdealVariable;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  // The main state (called a cvstate for Control and Variables)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // contains both the current values of the variables and the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  // current set of predecessor control edges.  The variable values
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  // are managed via a Node [in(1)..in(_var_ct)], and the predecessor
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // control edges managed via a RegionNode. The in(0) of the Node
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  // for variables points to the RegionNode for the control edges.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  Compile * const C;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  PhaseGVN &_gvn;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  GrowableArray<Node*>* _pending_cvstates; // stack of cvstates
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  GrowableArray<Node*>* _delay_transform;  // delay invoking gvn.transform until drain
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  Node* _cvstate;                          // current cvstate (control, memory and variables)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  uint _var_ct;                            // number of variables
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  bool _delay_all_transforms;              // flag forcing all transforms to be delayed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  Node* _initial_ctrl;                     // saves initial control until variables declared
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  Node* _initial_memory;                   // saves initial memory  until variables declared
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  PhaseGVN& gvn() const { return _gvn; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  // Create a new cvstate filled with nulls
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  Node* new_cvstate();                     // Create a new cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  Node* cvstate() { return _cvstate; }     // current cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  Node* copy_cvstate();                    // copy current cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  void set_memory(Node* mem, uint alias_idx );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  void do_memory_merge(Node* merging, Node* join);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  void clear(Node* m);                     // clear a cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  void stop() { clear(_cvstate); }         // clear current cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  Node* delay_transform(Node* n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  Node* transform(Node* n);                // gvn.transform or push node on delay list
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  Node* promote_to_phi(Node* n, Node* reg);// Promote "n" to a phi on region "reg"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  bool was_promoted_to_phi(Node* n, Node* reg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    return (n->is_Phi() && n->in(0) == reg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  void declare(IdealVariable* v) { v->set_id(_var_ct++); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // This declares the position where vars are kept in the cvstate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // For some degree of consistency we use the TypeFunc enum to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // soak up spots in the inputs even though we only use early Control
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  // and Memory slots. (So far.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  static const uint first_var; // = TypeFunc::Parms + 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  enum State { NullS=0, BlockS=1, LoopS=2, IfThenS=4, ElseS=8, EndifS= 16 };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  GrowableArray<int>* _state;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  State state() { return (State)(_state->top()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  // Users should not care about slices only MergedMem so no access for them.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  Node* memory(uint alias_idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
 public:
3268
f034e0c86895 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 1
diff changeset
   145
  IdealKit(PhaseGVN &gvn, Node* control, Node* memory, bool delay_all_transforms = false, bool has_declarations = false);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  ~IdealKit() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
    stop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    drain_delay_transform();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  // Control
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  Node* ctrl()                          { return _cvstate->in(TypeFunc::Control); }
3268
f034e0c86895 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 1
diff changeset
   152
  void set_ctrl(Node* ctrl)             { _cvstate->set_req(TypeFunc::Control, ctrl); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  Node* top()                           { return C->top(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  MergeMemNode* merged_memory()         { return _cvstate->in(TypeFunc::Memory)->as_MergeMem(); }
3268
f034e0c86895 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 1
diff changeset
   155
  void set_all_memory(Node* mem)        { _cvstate->set_req(TypeFunc::Memory, mem); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  void set(IdealVariable& v, Node* rhs) { _cvstate->set_req(first_var + v.id(), rhs); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  Node* value(IdealVariable& v)         { return _cvstate->in(first_var + v.id()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  void dead(IdealVariable& v)           { set(v, (Node*)NULL); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  void if_then(Node* left, BoolTest::mask relop, Node* right,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
               float prob = PROB_FAIR, float cnt = COUNT_UNKNOWN,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
               bool push_new_state = true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  void else_();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  void end_if();
8732
16fc1c68714b 7008866: Missing loop predicate for loop with multiple entries
kvn
parents: 7397
diff changeset
   164
  void loop(GraphKit* gkit, int nargs, IdealVariable& iv, Node* init, BoolTest::mask cmp, Node* limit,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
            float prob = PROB_LIKELY(0.9), float cnt = COUNT_UNKNOWN);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  void end_loop();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  Node* make_label(int goto_ct);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  void bind(Node* lab);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  void goto_(Node* lab, bool bind = false);
3268
f034e0c86895 6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents: 1
diff changeset
   170
  void declarations_done();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  void drain_delay_transform();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  Node* IfTrue(IfNode* iff)  { return transform(new (C,1) IfTrueNode(iff)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  Node* IfFalse(IfNode* iff) { return transform(new (C,1) IfFalseNode(iff)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  // Data
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  Node* ConI(jint k) { return (Node*)gvn().intcon(k); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  Node* makecon(const Type *t)  const { return _gvn.makecon(t); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  Node* AddI(Node* l, Node* r) { return transform(new (C,3) AddINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  Node* SubI(Node* l, Node* r) { return transform(new (C,3) SubINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  Node* AndI(Node* l, Node* r) { return transform(new (C,3) AndINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  Node* MaxI(Node* l, Node* r) { return transform(new (C,3) MaxINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  Node* LShiftI(Node* l, Node* r) { return transform(new (C,3) LShiftINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  Node* CmpI(Node* l, Node* r) { return transform(new (C,3) CmpINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  Node* Bool(Node* cmp, BoolTest::mask relop) { return transform(new (C,2) BoolNode(cmp, relop)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  void  increment(IdealVariable& v, Node* j)  { set(v, AddI(value(v), j)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  void  decrement(IdealVariable& v, Node* j)  { set(v, SubI(value(v), j)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  Node* CmpL(Node* l, Node* r) { return transform(new (C,3) CmpLNode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  // TLS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  Node* thread()  {  return gvn().transform(new (C, 1) ThreadLocalNode()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  // Pointers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  Node* AddP(Node *base, Node *ptr, Node *off) { return transform(new (C,4) AddPNode(base, ptr, off)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  Node* CmpP(Node* l, Node* r) { return transform(new (C,3) CmpPNode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
#ifdef _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  Node* XorX(Node* l, Node* r) { return transform(new (C,3) XorLNode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
#else // _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  Node* XorX(Node* l, Node* r) { return transform(new (C,3) XorINode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
#endif // _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  Node* URShiftX(Node* l, Node* r) { return transform(new (C,3) URShiftXNode(l, r)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  Node* ConX(jint k) { return (Node*)gvn().MakeConX(k); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  Node* CastPX(Node* ctl, Node* p) { return transform(new (C,2) CastP2XNode(ctl, p)); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  // Add a fixed offset to a pointer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  Node* basic_plus_adr(Node* base, Node* ptr, intptr_t offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  // Memory operations
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  // This is the base version which is given an alias index.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  Node* load(Node* ctl,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
             Node* adr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
             const Type* t,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
             BasicType bt,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
             int adr_idx,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
             bool require_atomic_access = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  // Return the new StoreXNode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  Node* store(Node* ctl,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
              Node* adr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
              Node* val,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
              BasicType bt,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
              int adr_idx,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
              bool require_atomic_access = false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  // Store a card mark ordered after store_oop
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  Node* storeCM(Node* ctl,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
                Node* adr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
                Node* val,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
                Node* oop_store,
3904
007a45522a7f 6877254: Server vm crashes with no branches off of store slice" when run with CMS and UseSuperWord(default)
cfang
parents: 3268
diff changeset
   232
                int oop_adr_idx,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
                BasicType bt,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
                int adr_idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  // Trivial call
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  void make_leaf_call(const TypeFunc *slow_call_type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
                      address slow_call,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
                      const char *leaf_name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
                      Node* parm0,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
                      Node* parm1 = NULL,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
                      Node* parm2 = NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   244
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   245
#endif // SHARE_VM_OPTO_IDEALKIT_HPP