src/hotspot/share/c1/c1_Canonicalizer.hpp
author coleenp
Mon, 16 Oct 2017 22:36:06 -0400
changeset 47634 6a0c42c40cd1
parent 47216 71c04702a3d5
child 47765 b7c7428eaab9
permissions -rw-r--r--
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot Summary: With the new template functions these are unnecessary. Reviewed-by: kbarrett, dholmes, eosterlund
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
28954
7dda6c26cc98 8068977: Remove unused sun.misc.Unsafe prefetch intrinsic support
psandoz
parents: 22234
diff changeset
     2
 * Copyright (c) 1999, 2015, 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: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
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: 1
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: 6453
diff changeset
    25
#ifndef SHARE_VM_C1_C1_CANONICALIZER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    26
#define SHARE_VM_C1_C1_CANONICALIZER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    28
#include "c1/c1_Instruction.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    29
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
class Canonicalizer: InstructionVisitor {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
 private:
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
    32
  Compilation *_compilation;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
  Instruction* _canonical;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  int _bci;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
    36
  Compilation *compilation()                     { return _compilation; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  void set_canonical(Value x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
  void set_bci(int bci)                          { _bci = bci; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  void set_constant(jint x)                      { set_canonical(new Constant(new IntConstant(x))); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  void set_constant(jlong x)                     { set_canonical(new Constant(new LongConstant(x))); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  void set_constant(jfloat x)                    { set_canonical(new Constant(new FloatConstant(x))); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  void set_constant(jdouble x)                   { set_canonical(new Constant(new DoubleConstant(x))); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  void move_const_to_right(Op2* x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  void do_Op2(Op2* x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  void do_UnsafeRawOp(UnsafeRawOp* x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  void unsafe_raw_match(UnsafeRawOp* x,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
                        Instruction** base,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
                        Instruction** index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
                        int* scale);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
 public:
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
    53
  Canonicalizer(Compilation* c, Value x, int bci) : _compilation(c), _canonical(x), _bci(bci) {
10974
ace1746b24ab 7104177: Tiered: -XX:+PrintCanonicalization doesn't work with -XX:+TieredCompilation
iveresov
parents: 8065
diff changeset
    54
    NOT_PRODUCT(x->set_printable_bci(bci));
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
    55
    if (CanonicalizeNodes) x->visit(this);
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
    56
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  Value canonical() const                        { return _canonical; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  int bci() const                                { return _bci; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  virtual void do_Phi            (Phi*             x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  virtual void do_Constant       (Constant*        x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  virtual void do_Local          (Local*           x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  virtual void do_LoadField      (LoadField*       x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  virtual void do_StoreField     (StoreField*      x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  virtual void do_ArrayLength    (ArrayLength*     x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  virtual void do_LoadIndexed    (LoadIndexed*     x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  virtual void do_StoreIndexed   (StoreIndexed*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  virtual void do_NegateOp       (NegateOp*        x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  virtual void do_ArithmeticOp   (ArithmeticOp*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  virtual void do_ShiftOp        (ShiftOp*         x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  virtual void do_LogicOp        (LogicOp*         x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  virtual void do_CompareOp      (CompareOp*       x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  virtual void do_IfOp           (IfOp*            x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  virtual void do_IfInstanceOf   (IfInstanceOf*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  virtual void do_Convert        (Convert*         x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  virtual void do_NullCheck      (NullCheck*       x);
13391
30245956af37 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 11886
diff changeset
    77
  virtual void do_TypeCast       (TypeCast*        x);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  virtual void do_Invoke         (Invoke*          x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  virtual void do_NewInstance    (NewInstance*     x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  virtual void do_NewTypeArray   (NewTypeArray*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  virtual void do_NewObjectArray (NewObjectArray*  x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  virtual void do_NewMultiArray  (NewMultiArray*   x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  virtual void do_CheckCast      (CheckCast*       x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  virtual void do_InstanceOf     (InstanceOf*      x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  virtual void do_MonitorEnter   (MonitorEnter*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  virtual void do_MonitorExit    (MonitorExit*     x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  virtual void do_Intrinsic      (Intrinsic*       x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  virtual void do_BlockBegin     (BlockBegin*      x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  virtual void do_Goto           (Goto*            x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  virtual void do_If             (If*              x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  virtual void do_TableSwitch    (TableSwitch*     x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  virtual void do_LookupSwitch   (LookupSwitch*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  virtual void do_Return         (Return*          x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  virtual void do_Throw          (Throw*           x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  virtual void do_Base           (Base*            x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  virtual void do_OsrEntry       (OsrEntry*        x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  virtual void do_ExceptionObject(ExceptionObject* x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  virtual void do_RoundFP        (RoundFP*         x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  virtual void do_UnsafePutRaw   (UnsafePutRaw*    x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  virtual void do_UnsafeGetObject(UnsafeGetObject* x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  virtual void do_UnsafePutObject(UnsafePutObject* x);
13886
8d82c4dfa722 7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents: 13391
diff changeset
   103
  virtual void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  virtual void do_ProfileCall    (ProfileCall*     x);
20709
034be898bf04 8026054: New type profiling points: type of return values at calls
roland
parents: 17011
diff changeset
   105
  virtual void do_ProfileReturnType (ProfileReturnType*  x);
6453
970dc585ab63 6953144: Tiered compilation
iveresov
parents: 5547
diff changeset
   106
  virtual void do_ProfileInvoke  (ProfileInvoke*   x);
8065
7ca689ce3d32 6809483: hotspot:::method_entry are not correctly generated for "method()V"
never
parents: 7397
diff changeset
   107
  virtual void do_RuntimeCall    (RuntimeCall*     x);
11886
feebf5c9f40c 7120481: storeStore barrier in constructor with final field
jiangli
parents: 10974
diff changeset
   108
  virtual void do_MemBar         (MemBar*          x);
16611
6807a703dd6b 7153771: array bound check elimination for c1
roland
parents: 13963
diff changeset
   109
  virtual void do_RangeCheckPredicate(RangeCheckPredicate* x);
17011
def8879c5b81 8011648: C1: optimized build is broken after 7153771
roland
parents: 16611
diff changeset
   110
#ifdef ASSERT
16611
6807a703dd6b 7153771: array bound check elimination for c1
roland
parents: 13963
diff changeset
   111
  virtual void do_Assert         (Assert*          x);
17011
def8879c5b81 8011648: C1: optimized build is broken after 7153771
roland
parents: 16611
diff changeset
   112
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   114
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   115
#endif // SHARE_VM_C1_C1_CANONICALIZER_HPP