src/hotspot/share/runtime/interfaceSupport.inline.hpp
author vromero
Mon, 08 Oct 2018 06:52:41 -0700
changeset 52038 957de5be48bc
parent 51996 84743156e780
child 52450 2790da836dc3
permissions -rw-r--r--
8209407: VerifyError is thrown for inner class with lambda Reviewed-by: mcimadamore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
50946
be2d74d91351 8205417: Obsolete UnlinkSymbolsALot debugging option
coleenp
parents: 49679
diff changeset
     2
 * Copyright (c) 1997, 2018, 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
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
    25
#ifndef SHARE_VM_RUNTIME_INTERFACESUPPORT_INLINE_HPP
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
    26
#define SHARE_VM_RUNTIME_INTERFACESUPPORT_INLINE_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "runtime/handles.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "runtime/mutexLocker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "runtime/orderAccess.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
#include "runtime/os.hpp"
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
    32
#include "runtime/safepointMechanism.inline.hpp"
49594
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
    33
#include "runtime/safepointVerifiers.hpp"
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
    34
#include "runtime/thread.hpp"
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
    35
#include "runtime/vm_operations.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    36
#include "utilities/globalDefinitions.hpp"
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 37466
diff changeset
    37
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    38
#include "utilities/preserveException.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    39
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// Wrapper for all entry points to the virtual machine.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
    42
// InterfaceSupport provides functionality used by the VM_LEAF_BASE and
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
    43
// VM_ENTRY_BASE macros. These macros are used to guard entry points into
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
    44
// the VM and perform checks upon leave of the VM.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
class InterfaceSupport: AllStatic {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
# ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  static long _scavenge_alot_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  static long _fullgc_alot_counter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  static long _number_of_calls;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  static long _fullgc_alot_invocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // Helper methods used to implement +ScavengeALot and +FullGCALot
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  static void gc_alot();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  static void walk_stack_from(vframe* start_vf);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  static void walk_stack();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  static void zombieAll();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  static void deoptimizeAll();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  static void stress_derived_pointers();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  static void verify_stack();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  static void verify_last_frame();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
 public:
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    70
  static void serialize_thread_state_with_handler(JavaThread* thread) {
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    71
    serialize_thread_state_internal(thread, true);
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    72
  }
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    73
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    74
  // Should only call this if we know that we have a proper SEH set up.
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    75
  static void serialize_thread_state(JavaThread* thread) {
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    76
    serialize_thread_state_internal(thread, false);
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    77
  }
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 37466
diff changeset
    78
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    79
 private:
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    80
  static void serialize_thread_state_internal(JavaThread* thread, bool needs_exception_handler) {
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    81
    // Make sure new state is seen by VM thread
51996
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    82
    if (UseMembar) {
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    83
      // Force a fence between the write above and read below
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    84
      OrderAccess::fence();
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    85
    } else {
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    86
      // store to serialize page so VM thread can do pseudo remote membar
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    87
      if (needs_exception_handler) {
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    88
        os::write_memory_serialize_page_with_handler(thread);
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    89
      } else {
51996
84743156e780 8188764: Obsolete AssumeMP and then remove all support for non-MP builds
dholmes
parents: 50946
diff changeset
    90
        os::write_memory_serialize_page(thread);
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    91
      }
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    92
    }
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
    93
  }
1
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
// Basic class for all thread transition classes.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
class ThreadStateTransition : public StackObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  JavaThread* _thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  ThreadStateTransition(JavaThread *thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    _thread = thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  // Change threadstate in a manner, so safepoint can detect changes.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  // Time-critical: called on exit from every runtime routine
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
    assert(from != _thread_in_Java, "use transition_from_java");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
    assert(from != _thread_in_native, "use transition_from_native");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    assert(thread->thread_state() == from, "coming from wrong thread state");
46373
e8e9b36783f3 8166927: interfaceSupport.hpp has ancient comments about TSO
dholmes
parents: 41084
diff changeset
   115
    // Change to transition state
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
    thread->set_thread_state((JavaThreadState)(from + 1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
   118
    InterfaceSupport::serialize_thread_state(thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   120
    SafepointMechanism::block_if_requested(thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    thread->set_thread_state(to);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  // transition_and_fence must be used on any thread state transition
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  // where there might not be a Java call stub on the stack, in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  // particular on Windows where the Structured Exception Handler is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // set up in the call stub. os::write_memory_serialize_page() can
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // fault and we can't recover from it on Windows without a SEH in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // place.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  static inline void transition_and_fence(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    assert(thread->thread_state() == from, "coming from wrong thread state");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
46373
e8e9b36783f3 8166927: interfaceSupport.hpp has ancient comments about TSO
dholmes
parents: 41084
diff changeset
   135
    // Change to transition state
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    thread->set_thread_state((JavaThreadState)(from + 1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
   138
    InterfaceSupport::serialize_thread_state_with_handler(thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   140
    SafepointMechanism::block_if_requested(thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    thread->set_thread_state(to);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
    CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Same as above, but assumes from = _thread_in_Java. This is simpler, since we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  // never block on entry to the VM. This will break the code, since e.g. preserve arguments
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  // have not been setup.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  static inline void transition_from_java(JavaThread *thread, JavaThreadState to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
    assert(thread->thread_state() == _thread_in_Java, "coming from wrong thread state");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    thread->set_thread_state(to);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  static inline void transition_from_native(JavaThread *thread, JavaThreadState to) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
    assert((to & 1) == 0, "odd numbers are transitions states");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
    assert(thread->thread_state() == _thread_in_native, "coming from wrong thread state");
46373
e8e9b36783f3 8166927: interfaceSupport.hpp has ancient comments about TSO
dholmes
parents: 41084
diff changeset
   157
    // Change to transition state
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    thread->set_thread_state(_thread_in_native_trans);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
46604
d409276ee40c 8183198: Factor out thread state serialization into a proper helper function
mgerdin
parents: 46373
diff changeset
   160
    InterfaceSupport::serialize_thread_state_with_handler(thread);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
    // We never install asynchronous exceptions when coming (back) in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    // to the runtime from native code because the runtime is not set
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
    // up to handle exceptions floating around at arbitrary points.
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   165
    if (SafepointMechanism::poll(thread) || thread->is_suspend_after_native()) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
      JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
      // Clear unhandled oops anywhere where we could block, even if we don't.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
      CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    thread->set_thread_state(to);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
 protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
   void trans(JavaThreadState from, JavaThreadState to)  { transition(_thread, from, to); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
   void trans_from_java(JavaThreadState to)              { transition_from_java(_thread, to); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
   void trans_from_native(JavaThreadState to)            { transition_from_native(_thread, to); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
   void trans_and_fence(JavaThreadState from, JavaThreadState to) { transition_and_fence(_thread, from, to); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   181
class ThreadInVMForHandshake : public ThreadStateTransition {
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   182
  const JavaThreadState _original_state;
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   183
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   184
  void transition_back() {
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   185
    // This can be invoked from transition states and must return to the original state properly
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   186
    assert(_thread->thread_state() == _thread_in_vm, "should only call when leaving VM after handshake");
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   187
    _thread->set_thread_state(_thread_in_vm_trans);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   188
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   189
    InterfaceSupport::serialize_thread_state(_thread);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   190
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   191
    SafepointMechanism::block_if_requested(_thread);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   192
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   193
    _thread->set_thread_state(_original_state);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   194
  }
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   195
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   196
 public:
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   197
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   198
  ThreadInVMForHandshake(JavaThread* thread) : ThreadStateTransition(thread),
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   199
      _original_state(thread->thread_state()) {
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   200
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   201
    if (thread->has_last_Java_frame()) {
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   202
      thread->frame_anchor()->make_walkable(thread);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   203
    }
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   204
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   205
    thread->set_thread_state(_thread_in_vm);
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   206
  }
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   207
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   208
  ~ThreadInVMForHandshake() {
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   209
    transition_back();
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   210
  }
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   211
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47216
diff changeset
   212
};
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
class ThreadInVMfromJava : public ThreadStateTransition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  ThreadInVMfromJava(JavaThread* thread) : ThreadStateTransition(thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    trans_from_java(_thread_in_vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  ~ThreadInVMfromJava()  {
40926
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   220
    if (_thread->stack_yellow_reserved_zone_disabled()) {
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   221
      _thread->enable_stack_yellow_reserved_zone();
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   222
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    trans(_thread_in_vm, _thread_in_Java);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    // Check for pending. async. exceptions or suspends.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
class ThreadInVMfromUnknown {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  JavaThread* _thread;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  ThreadInVMfromUnknown() : _thread(NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
    Thread* t = Thread::current();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
    if (t->is_Java_thread()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
      JavaThread* t2 = (JavaThread*) t;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
      if (t2->thread_state() == _thread_in_native) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
        _thread = t2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
        ThreadStateTransition::transition_from_native(t2, _thread_in_vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
        // Used to have a HandleMarkCleaner but that is dangerous as
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
        // it could free a handle in our (indirect, nested) caller.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
        // We expect any handles will be short lived and figure we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
        // don't need an actual HandleMark.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  ~ThreadInVMfromUnknown()  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
    if (_thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
      ThreadStateTransition::transition_and_fence(_thread, _thread_in_vm, _thread_in_native);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
class ThreadInVMfromNative : public ThreadStateTransition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  ThreadInVMfromNative(JavaThread* thread) : ThreadStateTransition(thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
    trans_from_native(_thread_in_vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  ~ThreadInVMfromNative() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    trans_and_fence(_thread_in_vm, _thread_in_native);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
class ThreadToNativeFromVM : public ThreadStateTransition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  ThreadToNativeFromVM(JavaThread *thread) : ThreadStateTransition(thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
    // We are leaving the VM at this point and going directly to native code.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
    // Block, if we are in the middle of a safepoint synchronization.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
    assert(!thread->owns_locks(), "must release all locks when leaving VM");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
    thread->frame_anchor()->make_walkable(thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
    trans_and_fence(_thread_in_vm, _thread_in_native);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
    // Check for pending. async. exceptions or suspends.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
    if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition(false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
  ~ThreadToNativeFromVM() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    trans_from_native(_thread_in_vm);
41084
fc5db29fa08e 8164086: Checked JNI pending exception check should be cleared when returning to Java frame
dsimms
parents: 40926
diff changeset
   281
    assert(!_thread->is_pending_jni_exception_check(), "Pending JNI Exception Check");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    // We don't need to clear_walkable because it will happen automagically when we return to java
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
class ThreadBlockInVM : public ThreadStateTransition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  ThreadBlockInVM(JavaThread *thread)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  : ThreadStateTransition(thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    // Once we are blocked vm expects stack to be walkable
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
    thread->frame_anchor()->make_walkable(thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
    trans_and_fence(_thread_in_vm, _thread_blocked);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  ~ThreadBlockInVM() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
    trans_and_fence(_thread_blocked, _thread_in_vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    // We don't need to clear_walkable because it will happen automagically when we return to java
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
// This special transition class is only used to prevent asynchronous exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
// from being installed on vm exit in situations where we can't tolerate them.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
// See bugs: 4324348, 4854693, 4998314, 5040492, 5050705.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
class ThreadInVMfromJavaNoAsyncException : public ThreadStateTransition {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  ThreadInVMfromJavaNoAsyncException(JavaThread* thread) : ThreadStateTransition(thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
    trans_from_java(_thread_in_vm);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  ~ThreadInVMfromJavaNoAsyncException()  {
40926
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   311
    if (_thread->stack_yellow_reserved_zone_disabled()) {
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   312
      _thread->enable_stack_yellow_reserved_zone();
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   313
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
    trans(_thread_in_vm, _thread_in_Java);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
    // NOTE: We do not check for pending. async. exceptions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
    // If we did and moved the pending async exception over into the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    // pending exception field, we would need to deopt (currently C2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
    // only). However, to do so would require that we transition back
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
    // to the _thread_in_vm state. Instead we postpone the handling of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    // the async exception.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
40926
2fd1cf3e70e9 8137035: nsk/stress/stack/stack tests got EXCEPTION_STACK_OVERFLOW on Windows 64 bit
fparain
parents: 40010
diff changeset
   322
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
    // Check for pending. suspends only.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    if (_thread->has_special_runtime_exit_condition())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
      _thread->handle_special_runtime_exit_condition(false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
// Debug class instantiated in JRT_ENTRY and ITR_ENTRY macro.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
// Can be used to verify properties on enter/exit of the VM.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
class VMEntryWrapper {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
 public:
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
   335
  VMEntryWrapper();
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
   336
  ~VMEntryWrapper();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
class VMNativeEntryWrapper {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  VMNativeEntryWrapper() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
    if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  ~VMNativeEntryWrapper() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
    if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
// VM-internal runtime interface support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
49594
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   356
// Definitions for JRT (Java (Compiler/Shared) Runtime)
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   357
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   358
// JRT_LEAF currently can be called from either _thread_in_Java or
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   359
// _thread_in_native mode. In _thread_in_native, it is ok
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   360
// for another thread to trigger GC. The rest of the JRT_LEAF
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   361
// rules apply.
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   362
class JRTLeafVerifier : public NoSafepointVerifier {
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   363
  static bool should_verify_GC();
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   364
 public:
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   365
#ifdef ASSERT
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   366
  JRTLeafVerifier();
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   367
  ~JRTLeafVerifier();
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   368
#else
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   369
  JRTLeafVerifier() {}
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   370
  ~JRTLeafVerifier() {}
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   371
#endif
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   372
};
898ef81cbc0e 8200106: Move NoSafepointVerifier out from gcLocker.hpp
stefank
parents: 49449
diff changeset
   373
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
class RuntimeHistogramElement : public HistogramElement {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
   RuntimeHistogramElement(const char* name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
#define TRACE_CALL(result_type, header)                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  InterfaceSupport::_number_of_calls++;                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  if (CountRuntimeCalls) {                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
    static RuntimeHistogramElement* e = new RuntimeHistogramElement(#header); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
    if (e != NULL) e->increment_count();                           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
#define TRACE_CALL(result_type, header)                            \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  /* do nothing */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
// LEAF routines do not lock, GC or throw exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   395
#define VM_LEAF_BASE(result_type, header)                            \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
  TRACE_CALL(result_type, header)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  debug_only(NoHandleMark __hm;)                                     \
11961
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 10969
diff changeset
   398
  os::verify_stack_alignment();                                      \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  /* begin of body */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
36086
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   401
#define VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread)         \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   402
  TRACE_CALL(result_type, header)                                    \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   403
  debug_only(ResetNoHandleMark __rnhm;)                              \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   404
  HandleMarkCleaner __hm(thread);                                    \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   405
  Thread* THREAD = thread;                                           \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   406
  os::verify_stack_alignment();                                      \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   407
  /* begin of body */
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   408
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
// ENTRY routines may lock, GC and throw exceptions
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   412
#define VM_ENTRY_BASE(result_type, header, thread)                   \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  TRACE_CALL(result_type, header)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
  HandleMarkCleaner __hm(thread);                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  Thread* THREAD = thread;                                           \
11961
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 10969
diff changeset
   416
  os::verify_stack_alignment();                                      \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
  /* begin of body */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
// QUICK_ENTRY routines behave like ENTRY but without a handle mark
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   422
#define VM_QUICK_ENTRY_BASE(result_type, header, thread)             \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  TRACE_CALL(result_type, header)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
  debug_only(NoHandleMark __hm;)                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  Thread* THREAD = thread;                                           \
11961
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 10969
diff changeset
   426
  os::verify_stack_alignment();                                      \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
  /* begin of body */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
// Definitions for IRT (Interpreter Runtime)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
// (thread is an argument passed in to all these routines)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
#define IRT_ENTRY(result_type, header)                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  result_type header {                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
    ThreadInVMfromJava __tiv(thread);                                \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   436
    VM_ENTRY_BASE(result_type, header, thread)                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
    debug_only(VMEntryWrapper __vew;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
#define IRT_LEAF(result_type, header)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
  result_type header {                                               \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   442
    VM_LEAF_BASE(result_type, header)                                \
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 34633
diff changeset
   443
    debug_only(NoSafepointVerifier __nspv(true);)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
#define IRT_ENTRY_NO_ASYNC(result_type, header)                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
  result_type header {                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
    ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   449
    VM_ENTRY_BASE(result_type, header, thread)                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
    debug_only(VMEntryWrapper __vew;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
#define IRT_END }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
#define JRT_ENTRY(result_type, header)                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
  result_type header {                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
    ThreadInVMfromJava __tiv(thread);                                \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   457
    VM_ENTRY_BASE(result_type, header, thread)                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
    debug_only(VMEntryWrapper __vew;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
#define JRT_LEAF(result_type, header)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
  result_type header {                                               \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   463
  VM_LEAF_BASE(result_type, header)                                  \
35492
c8c0273e6b91 8146690: Make all classes in GC follow the naming convention.
david
parents: 34633
diff changeset
   464
  debug_only(JRTLeafVerifier __jlv;)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
#define JRT_ENTRY_NO_ASYNC(result_type, header)                      \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
  result_type header {                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
    ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   470
    VM_ENTRY_BASE(result_type, header, thread)                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
    debug_only(VMEntryWrapper __vew;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
// Same as JRT Entry but allows for return value after the safepoint
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
// to get back into Java from the VM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
#define JRT_BLOCK_ENTRY(result_type, header)                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
  result_type header {                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
    TRACE_CALL(result_type, header)                                  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
    HandleMarkCleaner __hm(thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
#define JRT_BLOCK                                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
    {                                                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
    ThreadInVMfromJava __tiv(thread);                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
    Thread* THREAD = thread;                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
    debug_only(VMEntryWrapper __vew;)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
29070
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   486
#define JRT_BLOCK_NO_ASYNC                                           \
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   487
    {                                                                \
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   488
    ThreadInVMfromJavaNoAsyncException __tiv(thread);                \
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   489
    Thread* THREAD = thread;                                         \
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   490
    debug_only(VMEntryWrapper __vew;)
b0a5fc9c59c8 8061553: Contended Locking fast enter bucket
dcubed
parents: 22838
diff changeset
   491
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
#define JRT_BLOCK_END }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
#define JRT_END }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
// Definitions for JNI
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
#define JNI_ENTRY(result_type, header)                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
    JNI_ENTRY_NO_PRESERVE(result_type, header)                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
    WeakPreserveExceptionMark __wem(thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
36551
77f29c57ed2e 8149159: Clean up Unsafe
mikael
parents: 36086
diff changeset
   502
#define JNI_ENTRY_NO_PRESERVE(result_type, header)                   \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
extern "C" {                                                         \
36551
77f29c57ed2e 8149159: Clean up Unsafe
mikael
parents: 36086
diff changeset
   504
  result_type JNICALL header {                                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
    assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
    ThreadInVMfromNative __tiv(thread);                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
    debug_only(VMNativeEntryWrapper __vew;)                          \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   509
    VM_ENTRY_BASE(result_type, header, thread)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
// Ensure that the VMNativeEntryWrapper constructor, which can cause
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   513
// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE).
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
#define JNI_QUICK_ENTRY(result_type, header)                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
extern "C" {                                                         \
36551
77f29c57ed2e 8149159: Clean up Unsafe
mikael
parents: 36086
diff changeset
   516
  result_type JNICALL header {                                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
    assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
    ThreadInVMfromNative __tiv(thread);                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
    debug_only(VMNativeEntryWrapper __vew;)                          \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   521
    VM_QUICK_ENTRY_BASE(result_type, header, thread)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
#define JNI_LEAF(result_type, header)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
extern "C" {                                                         \
36551
77f29c57ed2e 8149159: Clean up Unsafe
mikael
parents: 36086
diff changeset
   526
  result_type JNICALL header {                                       \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
    assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   529
    VM_LEAF_BASE(result_type, header)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
// Close the routine and the extern "C"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
#define JNI_END } }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
// Definitions for JVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
#define JVM_ENTRY(result_type, header)                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
extern "C" {                                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
  result_type JNICALL header {                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
    ThreadInVMfromNative __tiv(thread);                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
    debug_only(VMNativeEntryWrapper __vew;)                          \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   545
    VM_ENTRY_BASE(result_type, header, thread)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
#define JVM_ENTRY_NO_ENV(result_type, header)                        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
extern "C" {                                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
  result_type JNICALL header {                                       \
34633
2a6c7c7b30a7 8132510: Replace ThreadLocalStorage with compiler/language-based thread-local variables
dholmes
parents: 34285
diff changeset
   551
    JavaThread* thread = JavaThread::current();                      \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
    ThreadInVMfromNative __tiv(thread);                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
    debug_only(VMNativeEntryWrapper __vew;)                          \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   554
    VM_ENTRY_BASE(result_type, header, thread)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
#define JVM_QUICK_ENTRY(result_type, header)                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
extern "C" {                                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
  result_type JNICALL header {                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
    ThreadInVMfromNative __tiv(thread);                              \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
    debug_only(VMNativeEntryWrapper __vew;)                          \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   563
    VM_QUICK_ENTRY_BASE(result_type, header, thread)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
#define JVM_LEAF(result_type, header)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
extern "C" {                                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
  result_type JNICALL header {                                       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
    VM_Exit::block_if_vm_exited();                                   \
10969
3ecf25293e5a 7103224: collision between __LEAF define in interfaceSupport.hpp and /usr/include/sys/cdefs.h with gcc
never
parents: 10565
diff changeset
   570
    VM_LEAF_BASE(result_type, header)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
36086
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   573
#define JVM_ENTRY_FROM_LEAF(env, result_type, header)                \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   574
  { {                                                                \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   575
    JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   576
    ThreadInVMfromNative __tiv(thread);                              \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   577
    debug_only(VMNativeEntryWrapper __vew;)                          \
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   578
    VM_ENTRY_BASE_FROM_LEAF(result_type, header, thread)
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   579
f70e100d3195 8141491: Unaligned memory access in Bits.c
mikael
parents: 35492
diff changeset
   580
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
#define JVM_END } }
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   582
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
   583
#endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_INLINE_HPP