hotspot/src/share/vm/opto/runtime.hpp
author goetz
Fri, 04 Jul 2014 11:46:01 +0200
changeset 25715 d5a8dbdc5150
parent 24953 9680119572be
child 25949 34557722059b
permissions -rw-r--r--
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories. Summary: Introduce and clean up umbrella headers for the files in the cpu subdirectories. Reviewed-by: lfoltan, coleenp, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 23491
diff changeset
     2
 * Copyright (c) 1998, 2014, 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: 4637
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4637
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: 4637
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: 6433
diff changeset
    25
#ifndef SHARE_VM_OPTO_RUNTIME_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    26
#define SHARE_VM_OPTO_RUNTIME_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    28
#include "code/codeBlob.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    29
#include "opto/machnode.hpp"
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 24953
diff changeset
    30
#include "opto/optoreg.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    31
#include "opto/type.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    32
#include "runtime/biasedLocking.hpp"
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
    33
#include "runtime/rtmLocking.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    34
#include "runtime/deoptimization.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    35
#include "runtime/vframe.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
    36
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
//------------------------------OptoRuntime------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// Opto compiler runtime routines
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// These are all generated from Ideal graphs.  They are called with the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
// Java calling convention.  Internally they call C++.  They are made once at
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
// startup time and Opto compiles calls to them later.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
// Things are broken up into quads: the signature they will be called with,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
// the address of the generated code, the corresponding C++ code and an
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
// nmethod.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
// The signature (returned by "xxx_Type()") is used at startup time by the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
// Generator to make the generated code "xxx_Java".  Opto compiles calls
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
// to the generated code "xxx_Java".  When the compiled code gets executed,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
// it calls the C++ code "xxx_C".  The generated nmethod is saved in the
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
// CodeCache.  Exception handlers use the nmethod to get the callee-save
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
// register OopMaps.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
class CallInfo;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// NamedCounters are tagged counters which can be used for profiling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
// code in various ways.  Currently they are used by the lock coarsening code
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 12377
diff changeset
    60
class NamedCounter : public CHeapObj<mtCompiler> {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    enum CounterTag {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    NoTag,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
    LockCounter,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
    EliminatedLockCounter,
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
    66
    BiasedLockingCounter,
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
    67
    RTMLockingCounter
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  const char *  _name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  int           _count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  CounterTag    _tag;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  NamedCounter* _next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  NamedCounter(const char *n, CounterTag tag = NoTag):
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    _name(n),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    _count(0),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    _next(NULL),
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    _tag(tag) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  const char * name() const     { return _name; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  int count() const             { return _count; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  address addr()                { return (address)&_count; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  CounterTag tag() const        { return _tag; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  void set_tag(CounterTag tag)  { _tag = tag; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  NamedCounter* next() const    { return _next; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  void set_next(NamedCounter* next) {
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
    91
    assert(_next == NULL || next == NULL, "already set");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    _next = next;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
class BiasedLockingNamedCounter : public NamedCounter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  BiasedLockingCounters _counters;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  BiasedLockingNamedCounter(const char *n) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    NamedCounter(n, BiasedLockingCounter), _counters() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  BiasedLockingCounters* counters() { return &_counters; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
23491
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   108
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   109
class RTMLockingNamedCounter : public NamedCounter {
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   110
 private:
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   111
 RTMLockingCounters _counters;
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   112
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   113
 public:
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   114
  RTMLockingNamedCounter(const char *n) :
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   115
    NamedCounter(n, RTMLockingCounter), _counters() {}
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   116
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   117
  RTMLockingCounters* counters() { return &_counters; }
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   118
};
f690330b10b9 8031320: Use Intel RTM instructions for locks
kvn
parents: 20707
diff changeset
   119
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
typedef const TypeFunc*(*TypeFunc_generator)();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
class OptoRuntime : public AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  friend class Matcher;  // allow access to stub names
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  // define stubs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char *name, int is_fancy_jump, bool pass_tls, bool save_arguments, bool return_pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // References to generated stubs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  static address _new_instance_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  static address _new_array_Java;
10566
630c177ec580 7081933: Use zeroing elimination optimization for large array
kvn
parents: 10028
diff changeset
   132
  static address _new_array_nozero_Java;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  static address _multianewarray2_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  static address _multianewarray3_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  static address _multianewarray4_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  static address _multianewarray5_Java;
10028
035159a868a1 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 7397
diff changeset
   137
  static address _multianewarrayN_Java;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   138
  static address _g1_wb_pre_Java;
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   139
  static address _g1_wb_post_Java;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  static address _vtable_must_compile_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  static address _complete_monitor_locking_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  static address _rethrow_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  static address _slow_arraycopy_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  static address _register_finalizer_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
# ifdef ENABLE_ZAP_DEAD_LOCALS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  static address _zap_dead_Java_locals_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  static address _zap_dead_native_locals_Java;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
# endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  // Implementation of runtime methods
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  // =================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // Allocate storage for a Java instance.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   158
  static void new_instance_C(Klass* instance_klass, JavaThread *thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  // Allocate storage for a objArray or typeArray
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   161
  static void new_array_C(Klass* array_klass, int len, JavaThread *thread);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   162
  static void new_array_nozero_C(Klass* array_klass, int len, JavaThread *thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
4637
af4d405aacc1 6896647: card marks can be deferred too long
ysr
parents: 4030
diff changeset
   164
  // Post-slow-path-allocation, pre-initializing-stores step for
af4d405aacc1 6896647: card marks can be deferred too long
ysr
parents: 4030
diff changeset
   165
  // implementing ReduceInitialCardMarks
af4d405aacc1 6896647: card marks can be deferred too long
ysr
parents: 4030
diff changeset
   166
  static void new_store_pre_barrier(JavaThread* thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  // Allocate storage for a multi-dimensional arrays
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
  // Note: needs to be fixed for arbitrary number of dimensions
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   170
  static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread *thread);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   171
  static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread *thread);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   172
  static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread *thread);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   173
  static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread *thread);
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13195
diff changeset
   174
  static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread *thread);
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   175
  static void g1_wb_pre_C(oopDesc* orig, JavaThread* thread);
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   176
  static void g1_wb_post_C(void* card_addr, JavaThread* thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  // Slow-path Locking and Unlocking
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  static void complete_monitor_locking_C(oopDesc* obj, BasicLock* lock, JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  static void complete_monitor_unlocking_C(oopDesc* obj, BasicLock* lock);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
  // Implicit exception support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  static void throw_null_exception_C(JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  // Exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  static address handle_exception_C       (JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  static address rethrow_C                (oopDesc* exception, JavaThread *thread, address return_pc );
14835
70896cb93c35 8004741: Missing compiled exception handle table entry for multidimensional array allocation
kvn
parents: 14132
diff changeset
   192
  static void deoptimize_caller_frame     (JavaThread *thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  static void deoptimize_caller_frame     (JavaThread *thread, bool doit);
10987
696ed3367418 7109887: java/util/Arrays/CopyMethods.java fails with -XX:+DeoptimizeALot
kvn
parents: 10566
diff changeset
   194
  static bool is_deoptimized_caller_frame (JavaThread *thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  // CodeBlob support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  // ===================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  static ExceptionBlob*       _exception_blob;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  static void generate_exception_blob();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  static void register_finalizer(oopDesc* obj, JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  // zaping dead locals, either from Java frames or from native frames
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
# ifdef ENABLE_ZAP_DEAD_LOCALS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  static void zap_dead_Java_locals_C(   JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  static void zap_dead_native_locals_C( JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  static void zap_dead_java_or_native_locals( JavaThread*, bool (*)(frame*));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
   static int ZapDeadCompiledLocals_count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
# endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  static bool is_callee_saved_register(MachRegisterNumbers reg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
20707
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 18507
diff changeset
   221
  // One time only generate runtime code stubs. Returns true
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 18507
diff changeset
   222
  // when runtime stubs have been generated successfully and
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 18507
diff changeset
   223
  // false otherwise.
b3b658c6d1f8 8023014: CodeSweeperSweepNoFlushTest.java fails with HS crash
anoll
parents: 18507
diff changeset
   224
  static bool generate(ciEnv* env);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  // Returns the name of a stub
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  static const char* stub_name(address entry);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  // access to runtime stubs entry points for java code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  static address new_instance_Java()                     { return _new_instance_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  static address new_array_Java()                        { return _new_array_Java; }
10566
630c177ec580 7081933: Use zeroing elimination optimization for large array
kvn
parents: 10028
diff changeset
   232
  static address new_array_nozero_Java()                 { return _new_array_nozero_Java; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  static address multianewarray2_Java()                  { return _multianewarray2_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  static address multianewarray3_Java()                  { return _multianewarray3_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  static address multianewarray4_Java()                  { return _multianewarray4_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
  static address multianewarray5_Java()                  { return _multianewarray5_Java; }
10028
035159a868a1 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 7397
diff changeset
   237
  static address multianewarrayN_Java()                  { return _multianewarrayN_Java; }
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   238
  static address g1_wb_pre_Java()                        { return _g1_wb_pre_Java; }
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   239
  static address g1_wb_post_Java()                       { return _g1_wb_post_Java; }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  static address vtable_must_compile_stub()              { return _vtable_must_compile_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  static address complete_monitor_locking_Java()         { return _complete_monitor_locking_Java;   }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  static address slow_arraycopy_Java()                   { return _slow_arraycopy_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  static address register_finalizer_Java()               { return _register_finalizer_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
# ifdef ENABLE_ZAP_DEAD_LOCALS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  static address zap_dead_locals_stub(bool is_native)    { return is_native
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
                                                                  ? _zap_dead_native_locals_Java
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
                                                                  : _zap_dead_Java_locals_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
  static MachNode* node_to_call_zap_dead_locals(Node* n, int block_num, bool is_native);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
# endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
  static ExceptionBlob*    exception_blob()                      { return _exception_blob; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  // Leaf routines helping with method data update
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  static void profile_receiver_type_C(DataLayout* data, oopDesc* receiver);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  // Implicit exception support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  static void throw_div0_exception_C      (JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  static void throw_stack_overflow_error_C(JavaThread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  // Exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  static address rethrow_stub()             { return _rethrow_Java; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  // Type functions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
  // ======================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
  static const TypeFunc* new_instance_Type(); // object allocation (slow case)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
  static const TypeFunc* new_array_Type ();   // [a]newarray (slow case)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
  static const TypeFunc* multianewarray_Type(int ndim); // multianewarray
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
  static const TypeFunc* multianewarray2_Type(); // multianewarray
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
  static const TypeFunc* multianewarray3_Type(); // multianewarray
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
  static const TypeFunc* multianewarray4_Type(); // multianewarray
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  static const TypeFunc* multianewarray5_Type(); // multianewarray
10028
035159a868a1 7058510: multinewarray with 6 dimensions uncommon traps in server compiler
iveresov
parents: 7397
diff changeset
   277
  static const TypeFunc* multianewarrayN_Type(); // multianewarray
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   278
  static const TypeFunc* g1_wb_pre_Type();
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
   279
  static const TypeFunc* g1_wb_post_Type();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  static const TypeFunc* complete_monitor_enter_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  static const TypeFunc* complete_monitor_exit_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
  static const TypeFunc* uncommon_trap_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  static const TypeFunc* athrow_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  static const TypeFunc* rethrow_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  static const TypeFunc* Math_D_D_Type();  // sin,cos & friends
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  static const TypeFunc* Math_DD_D_Type(); // mod,pow & friends
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  static const TypeFunc* modf_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  static const TypeFunc* l2f_Type();
12377
ae6def2813e0 7160570: Intrinsification support for tracing framework
rbackman
parents: 10987
diff changeset
   289
  static const TypeFunc* void_long_Type();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
  static const TypeFunc* flush_windows_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  // arraycopy routine types
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  static const TypeFunc* fast_arraycopy_Type(); // bit-blasters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  static const TypeFunc* checkcast_arraycopy_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  static const TypeFunc* generic_arraycopy_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  static const TypeFunc* slow_arraycopy_Type();   // the full routine
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
6433
b0e4fafdc38b 4809552: Optimize Arrays.fill(...)
never
parents: 5547
diff changeset
   299
  static const TypeFunc* array_fill_Type();
b0e4fafdc38b 4809552: Optimize Arrays.fill(...)
never
parents: 5547
diff changeset
   300
14132
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents: 13728
diff changeset
   301
  static const TypeFunc* aescrypt_block_Type();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents: 13728
diff changeset
   302
  static const TypeFunc* cipherBlockChaining_aescrypt_Type();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents: 13728
diff changeset
   303
24953
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 23491
diff changeset
   304
  static const TypeFunc* sha_implCompress_Type();
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 23491
diff changeset
   305
  static const TypeFunc* digestBase_implCompressMB_Type();
9680119572be 8035968: Leverage CPU Instructions to Improve SHA Performance on SPARC
kvn
parents: 23491
diff changeset
   306
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents: 14835
diff changeset
   307
  static const TypeFunc* updateBytesCRC32_Type();
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents: 14835
diff changeset
   308
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  // leaf on stack replacement interpreter accessor types
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  static const TypeFunc* osr_end_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  // leaf methodData routine types
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  static const TypeFunc* profile_receiver_type_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  // leaf on stack replacement interpreter accessor types
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  static const TypeFunc* fetch_int_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  static const TypeFunc* fetch_long_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  static const TypeFunc* fetch_float_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  static const TypeFunc* fetch_double_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
  static const TypeFunc* fetch_oop_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
  static const TypeFunc* fetch_monitor_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  static const TypeFunc* register_finalizer_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
  // Dtrace support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  static const TypeFunc* dtrace_method_entry_exit_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
  static const TypeFunc* dtrace_object_alloc_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
# ifdef ENABLE_ZAP_DEAD_LOCALS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  static const TypeFunc* zap_dead_locals_Type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
# endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
 static NamedCounter * volatile _named_counters;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
 // helper function which creates a named counter labeled with the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
 // if they are available
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
 // dumps all the named counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
 static void          print_named_counters();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
   345
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6433
diff changeset
   346
#endif // SHARE_VM_OPTO_RUNTIME_HPP