hotspot/src/share/vm/opto/narrowptrnode.hpp
author kvn
Fri, 21 Nov 2014 17:17:41 -0800
changeset 27704 88c9f3b507ff
parent 23528 8f1a7f5e8066
child 30300 4b12a5b40064
permissions -rw-r--r--
8065618: C2 RA incorrectly removes kill projections Summary: Don't remove KILL projections if their "defining" nodes have SCMemProj projection (memory side effects). Reviewed-by: iveresov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23528
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     1
/*
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     4
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     8
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    13
 * accompanied this code).
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    14
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    18
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    21
 * questions.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    22
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    23
 */
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    24
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    25
#ifndef SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    26
#define SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    27
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    28
#include "opto/node.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    29
#include "opto/opcodes.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    30
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    31
//------------------------------EncodeNarrowPtr--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    32
class EncodeNarrowPtrNode : public TypeNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    33
  protected:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    34
  EncodeNarrowPtrNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    35
  TypeNode(type, 2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    36
    init_class_id(Class_EncodeNarrowPtr);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    37
    init_req(0, NULL);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    38
    init_req(1, value);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    39
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    40
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    41
  virtual uint  ideal_reg() const { return Op_RegN; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    42
  virtual Node *Ideal_DU_postCCP( PhaseCCP *ccp );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    43
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    44
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    45
//------------------------------EncodeP--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    46
// Encodes an oop pointers into its compressed form
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    47
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    48
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    49
class EncodePNode : public EncodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    50
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    51
  EncodePNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    52
  EncodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    53
    init_class_id(Class_EncodeP);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    54
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    55
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    56
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    57
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    58
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    59
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    60
//------------------------------EncodePKlass--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    61
// Encodes a klass pointer into its compressed form
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    62
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    63
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    64
class EncodePKlassNode : public EncodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    65
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    66
  EncodePKlassNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    67
  EncodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    68
    init_class_id(Class_EncodePKlass);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    69
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    70
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    71
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    72
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    73
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    74
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    75
//------------------------------DecodeNarrowPtr--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    76
class DecodeNarrowPtrNode : public TypeNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    77
  protected:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    78
  DecodeNarrowPtrNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    79
  TypeNode(type, 2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    80
    init_class_id(Class_DecodeNarrowPtr);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    81
    init_req(0, NULL);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    82
    init_req(1, value);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    83
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    84
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    85
  virtual uint  ideal_reg() const { return Op_RegP; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    86
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    87
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    88
//------------------------------DecodeN--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    89
// Converts a narrow oop into a real oop ptr.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    90
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    91
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    92
class DecodeNNode : public DecodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    93
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    94
  DecodeNNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    95
  DecodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    96
    init_class_id(Class_DecodeN);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    97
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    98
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    99
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   100
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   101
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   102
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   103
//------------------------------DecodeNKlass--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   104
// Converts a narrow klass pointer into a real klass ptr.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   105
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   106
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   107
class DecodeNKlassNode : public DecodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   108
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   109
  DecodeNKlassNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   110
  DecodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   111
    init_class_id(Class_DecodeNKlass);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   112
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   113
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   114
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   115
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   116
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   117
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   118
#endif // SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   119