hotspot/src/share/vm/c1/c1_ValueMap.hpp
author jiangli
Tue, 21 Feb 2012 13:14:55 -0500
changeset 11886 feebf5c9f40c
parent 8671 13ffa40a2f0a
child 12946 6007040eb77d
permissions -rw-r--r--
7120481: storeStore barrier in constructor with final field Summary: Issue storestore barrier before constructor return if the constructor write final field. Reviewed-by: dholmes, jrose, roland, coleenp Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8065
7ca689ce3d32 6809483: hotspot:::method_entry are not correctly generated for "method()V"
never
parents: 7397
diff changeset
     2
 * Copyright (c) 1999, 2011, 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: 1623
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1623
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: 1623
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_VALUEMAP_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    26
#define SHARE_VM_C1_C1_VALUEMAP_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
#include "c1/c1_ValueSet.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    30
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
class ValueMapEntry: public CompilationResourceObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
  intx           _hash;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  Value          _value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  int            _nesting;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  ValueMapEntry* _next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  ValueMapEntry(intx hash, Value value, int nesting, ValueMapEntry* next)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
    : _hash(hash)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
    , _value(value)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
    , _nesting(nesting)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
    , _next(next)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  intx           hash()      { return _hash; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  Value          value()     { return _value; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  int            nesting()   { return _nesting; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  ValueMapEntry* next()      { return _next; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  void set_next(ValueMapEntry* next) { _next = next; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
define_array(ValueMapEntryArray, ValueMapEntry*)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
define_stack(ValueMapEntryList, ValueMapEntryArray)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
// ValueMap implements nested hash tables for value numbering.  It
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
// maintains a set _killed_values which represents the instructions
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
// which have been killed so far and an array of linked lists of
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// ValueMapEntries names _entries.  Each ValueMapEntry has a nesting
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
// which indicates what ValueMap nesting it belongs to.  Higher
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
// nesting values are always before lower values in the linked list.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
// This allows cloning of parent ValueMaps by simply copying the heads
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
// of the list.  _entry_count represents the number of reachable
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
// entries in the ValueMap.  A ValueMap is only allowed to mutate
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
// ValueMapEntries with the same nesting level.  Adding or removing
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
// entries at the current nesting level requires updating
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
// _entry_count.  Elements in the parent's list that get killed can be
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
// skipped if they are at the head of the list by simply moving to the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
// next element in the list and decrementing _entry_count.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
class ValueMap: public CompilationResourceObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  int           _nesting;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  ValueMapEntryArray _entries;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  ValueSet      _killed_values;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  int           _entry_count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  int           nesting()                        { return _nesting; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  bool          is_local_value_numbering()       { return _nesting == 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  bool          is_global_value_numbering()      { return _nesting > 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  int           entry_count()                    { return _entry_count; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  int           size()                           { return _entries.length(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  ValueMapEntry* entry_at(int i)                 { return _entries.at(i); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // calculates the index of a hash value in a hash table of size n
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  int           entry_index(intx hash, int n)    { return (unsigned int)hash % n; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // if entry_count > size_threshold, the size of the hash table is increased
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  int           size_threshold()                 { return size(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  // management of the killed-bitset for global value numbering
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  void          kill_value(Value v)              { if (is_global_value_numbering()) _killed_values.put(v); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  bool          is_killed(Value v)               { if (is_global_value_numbering()) return _killed_values.contains(v); else return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  // helper functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  void          increase_table_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  static int _number_of_finds;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  static int _number_of_hits;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  static int _number_of_kills;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
#endif // PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // creation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  ValueMap();                // empty value map
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  ValueMap(ValueMap* old);   // value map with increased nesting
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  // manipulation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  Value find_insert(Value x);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  void kill_memory();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  void kill_field(ciField* field);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  void kill_array(ValueType* type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  void kill_exception();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  void kill_map(ValueMap* map);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  void kill_all();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  // debugging/printing
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  void print();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  static void reset_statistics();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  static void print_statistics();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
define_array(ValueMapArray, ValueMap*)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
class ValueNumberingVisitor: public InstructionVisitor {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  // called by visitor functions for instructions that kill values
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  virtual void kill_memory() = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  virtual void kill_field(ciField* field) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  virtual void kill_array(ValueType* type) = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  // visitor functions
1612
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   143
  void do_StoreField     (StoreField*      x) {
8671
13ffa40a2f0a 6965570: assert(!needs_patching && x->is_loaded(),"how do we know it's volatile if it's not loaded")
never
parents: 8065
diff changeset
   144
    if (x->is_init_point()) {
13ffa40a2f0a 6965570: assert(!needs_patching && x->is_loaded(),"how do we know it's volatile if it's not loaded")
never
parents: 8065
diff changeset
   145
      // putstatic is an initialization point so treat it as a wide kill
1612
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   146
      kill_memory();
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   147
    } else {
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   148
      kill_field(x->field());
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   149
    }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   150
  }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   151
  void do_StoreIndexed   (StoreIndexed*    x) { kill_array(x->type()); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   152
  void do_MonitorEnter   (MonitorEnter*    x) { kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   153
  void do_MonitorExit    (MonitorExit*     x) { kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   154
  void do_Invoke         (Invoke*          x) { kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   155
  void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   156
  void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   157
  void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
1612
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   159
  void do_Phi            (Phi*             x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   160
  void do_Local          (Local*           x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   161
  void do_Constant       (Constant*        x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   162
  void do_LoadField      (LoadField*       x) {
8671
13ffa40a2f0a 6965570: assert(!needs_patching && x->is_loaded(),"how do we know it's volatile if it's not loaded")
never
parents: 8065
diff changeset
   163
    if (x->is_init_point()) {
13ffa40a2f0a 6965570: assert(!needs_patching && x->is_loaded(),"how do we know it's volatile if it's not loaded")
never
parents: 8065
diff changeset
   164
      // getstatic is an initialization point so treat it as a wide kill
1612
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   165
      kill_memory();
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   166
    }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   167
  }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   168
  void do_ArrayLength    (ArrayLength*     x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   169
  void do_LoadIndexed    (LoadIndexed*     x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   170
  void do_NegateOp       (NegateOp*        x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   171
  void do_ArithmeticOp   (ArithmeticOp*    x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   172
  void do_ShiftOp        (ShiftOp*         x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   173
  void do_LogicOp        (LogicOp*         x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   174
  void do_CompareOp      (CompareOp*       x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   175
  void do_IfOp           (IfOp*            x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   176
  void do_Convert        (Convert*         x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   177
  void do_NullCheck      (NullCheck*       x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   178
  void do_NewInstance    (NewInstance*     x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   179
  void do_NewTypeArray   (NewTypeArray*    x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   180
  void do_NewObjectArray (NewObjectArray*  x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   181
  void do_NewMultiArray  (NewMultiArray*   x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   182
  void do_CheckCast      (CheckCast*       x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   183
  void do_InstanceOf     (InstanceOf*      x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   184
  void do_BlockBegin     (BlockBegin*      x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   185
  void do_Goto           (Goto*            x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   186
  void do_If             (If*              x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   187
  void do_IfInstanceOf   (IfInstanceOf*    x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   188
  void do_TableSwitch    (TableSwitch*     x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   189
  void do_LookupSwitch   (LookupSwitch*    x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   190
  void do_Return         (Return*          x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   191
  void do_Throw          (Throw*           x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   192
  void do_Base           (Base*            x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   193
  void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   194
  void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   195
  void do_RoundFP        (RoundFP*         x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   196
  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   197
  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   198
  void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   199
  void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   200
  void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
8065
7ca689ce3d32 6809483: hotspot:::method_entry are not correctly generated for "method()V"
never
parents: 7397
diff changeset
   201
  void do_ProfileInvoke  (ProfileInvoke*   x) { /* nothing to do */ };
7ca689ce3d32 6809483: hotspot:::method_entry are not correctly generated for "method()V"
never
parents: 7397
diff changeset
   202
  void do_RuntimeCall    (RuntimeCall*     x) { /* nothing to do */ };
11886
feebf5c9f40c 7120481: storeStore barrier in constructor with final field
jiangli
parents: 8671
diff changeset
   203
  void do_MemBar         (MemBar*          x) { /* nothing to do */ };
1612
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   204
};
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   205
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   206
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   207
class ValueNumberingEffects: public ValueNumberingVisitor {
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   208
 private:
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   209
  ValueMap*     _map;
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   210
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   211
 public:
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   212
  // implementation for abstract methods of ValueNumberingVisitor
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   213
  void          kill_memory()                    { _map->kill_memory(); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   214
  void          kill_field(ciField* field)       { _map->kill_field(field); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   215
  void          kill_array(ValueType* type)      { _map->kill_array(type); }
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   216
2488b45ded37 6756768: C1 generates invalid code
never
parents: 1
diff changeset
   217
  ValueNumberingEffects(ValueMap* map): _map(map) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
class GlobalValueNumbering: public ValueNumberingVisitor {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  ValueMap*     _current_map;     // value map of current block
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  ValueMapArray _value_maps;      // list of value maps for all blocks
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  // accessors
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
  ValueMap*     current_map()                    { return _current_map; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  ValueMap*     value_map_of(BlockBegin* block)  { return _value_maps.at(block->linear_scan_number()); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  void          set_value_map_of(BlockBegin* block, ValueMap* map)   { assert(value_map_of(block) == NULL, ""); _value_maps.at_put(block->linear_scan_number(), map); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  // implementation for abstract methods of ValueNumberingVisitor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  void          kill_memory()                    { current_map()->kill_memory(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  void          kill_field(ciField* field)       { current_map()->kill_field(field); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  void          kill_array(ValueType* type)      { current_map()->kill_array(type); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  // main entry point that performs global value numbering
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
  GlobalValueNumbering(IR* ir);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   240
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
   241
#endif // SHARE_VM_C1_C1_VALUEMAP_HPP