src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp
author darcy
Tue, 12 Nov 2019 10:45:23 -0800
changeset 59037 3d2575331a41
parent 58654 562bf1878089
child 58679 9c3209ff7550
permissions -rw-r--r--
8233940: Preview API tests for String methods should use ${jdk.version} as -source arg Reviewed-by: jlaskey, jlahoda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
55490
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
     2
 * Copyright (c) 1999, 2019, 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: 3261
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
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: 3261
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: 7108
diff changeset
    25
// no precompiled headers
47765
b7c7428eaab9 8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents: 47216
diff changeset
    26
#include "jvm.h"
14631
526804361522 8003250: SPARC: move MacroAssembler into separate file
twisti
parents: 13963
diff changeset
    27
#include "asm/macroAssembler.hpp"
33160
c59f1676d27e 8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents: 29573
diff changeset
    28
#include "macroAssembler_sparc.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    29
#include "classfile/classLoader.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    30
#include "classfile/systemDictionary.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    31
#include "classfile/vmSymbols.hpp"
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 23865
diff changeset
    32
#include "code/codeCache.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    33
#include "code/icBuffer.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    34
#include "code/vtableStubs.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    35
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    36
#include "memory/allocation.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    37
#include "nativeInst_sparc.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    38
#include "os_share_solaris.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    39
#include "prims/jniFastGetField.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    40
#include "prims/jvm_misc.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    41
#include "runtime/arguments.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    42
#include "runtime/extendedPC.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    43
#include "runtime/frame.inline.hpp"
49449
ef5d5d343e2a 8199263: Split interfaceSupport.hpp to not require including .inline.hpp files
coleenp
parents: 47881
diff changeset
    44
#include "runtime/interfaceSupport.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    45
#include "runtime/java.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    46
#include "runtime/javaCalls.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    47
#include "runtime/mutexLocker.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    48
#include "runtime/osThread.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    49
#include "runtime/sharedRuntime.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    50
#include "runtime/stubRoutines.hpp"
14583
d70ee55535f4 8003935: Simplify the needed includes for using Thread::current()
stefank
parents: 13963
diff changeset
    51
#include "runtime/thread.inline.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    52
#include "runtime/timer.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    53
#include "utilities/events.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7108
diff changeset
    54
#include "utilities/vmError.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
# include <signal.h>        // needed first to avoid name collision for "std" with SC 5.0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
// put OS-includes here
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
# include <sys/types.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
# include <sys/mman.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
# include <pthread.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
# include <errno.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
# include <dlfcn.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
# include <stdio.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
# include <unistd.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
# include <sys/resource.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# include <thread.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
# include <sys/stat.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
# include <sys/time.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
# include <sys/filio.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
# include <sys/utsname.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
# include <sys/systeminfo.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
# include <sys/socket.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
# include <sys/lwp.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
# include <poll.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
# include <sys/lwp.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
# define _STRUCTURED_PROC 1  //  this gets us the new structured proc interfaces of 5.6 & later
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
# include <sys/procfs.h>     //  see comment in <sys/procfs.h>
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
#define MAX_PATH (2 * K)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
42906
1a8db9cf1407 8170655: [posix] Fix minimum stack size computations
goetz
parents: 41070
diff changeset
    83
// Minimum usable stack sizes required to get to user code. Space for
1a8db9cf1407 8170655: [posix] Fix minimum stack size computations
goetz
parents: 41070
diff changeset
    84
// HotSpot guard pages is added later.
1a8db9cf1407 8170655: [posix] Fix minimum stack size computations
goetz
parents: 41070
diff changeset
    85
size_t os::Posix::_compiler_thread_min_stack_allowed = 104 * K;
1a8db9cf1407 8170655: [posix] Fix minimum stack size computations
goetz
parents: 41070
diff changeset
    86
size_t os::Posix::_java_thread_min_stack_allowed = 86 * K;
41070
496463b4e206 8140520: segfault on solaris-amd64 with "-XX:VMThreadStackSize=1" option
rdurbin
parents: 40898
diff changeset
    87
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 128 * K;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
static void handle_unflushed_register_windows(gwindows_t *win) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  int restore_count = win->wbcnt;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  int i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  for(i=0; i<restore_count; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
    address sp = ((address)win->spbuf[i]) + STACK_BIAS;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
    address reg_win = (address)&win->wbuf[i];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
    memcpy(sp,reg_win,sizeof(struct rwindow));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
char* os::non_memory_address_word() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  // Must never look like an address returned by reserve_memory,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // even in its subfields (as defined by the CPU immediate fields,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  // if the CPU splits constants across multiple instructions).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  // On SPARC, 0 != %hi(any real address), because there is no
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  // allocation in the first 1Kb of the virtual address space.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  return (char*) 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
// Validate a ucontext retrieved from walking a uc_link of a ucontext.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
// There are issues with libthread giving out uc_links for different threads
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
// on the same uc_link chain and bad or circular links.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
//
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   113
bool os::Solaris::valid_ucontext(Thread* thread, const ucontext_t* valid, const ucontext_t* suspect) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  if (valid >= suspect ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
      valid->uc_stack.ss_flags != suspect->uc_stack.ss_flags ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
      valid->uc_stack.ss_sp    != suspect->uc_stack.ss_sp    ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
      valid->uc_stack.ss_size  != suspect->uc_stack.ss_size) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    DEBUG_ONLY(tty->print_cr("valid_ucontext: failed test 1");)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  if (thread->is_Java_thread()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    if (!valid_stack_address(thread, (address)suspect)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
      DEBUG_ONLY(tty->print_cr("valid_ucontext: uc_link not in thread stack");)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
    address _sp   = (address)((intptr_t)suspect->uc_mcontext.gregs[REG_SP] + STACK_BIAS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
    if (!valid_stack_address(thread, _sp) ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
        !frame::is_valid_stack_pointer(((JavaThread*)thread)->base_of_stack_pointer(), (intptr_t*)_sp)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
      DEBUG_ONLY(tty->print_cr("valid_ucontext: stackpointer not in thread stack");)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
// We will only follow one level of uc_link since there are libthread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
// issues with ucontext linking and it is better to be safe and just
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
// let caller retry later.
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   140
const ucontext_t* os::Solaris::get_valid_uc_in_signal_handler(Thread *thread,
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   141
  const ucontext_t *uc) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   143
  const ucontext_t *retuc = NULL;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  // Sometimes the topmost register windows are not properly flushed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // i.e., if the kernel would have needed to take a page fault
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  if (uc != NULL && uc->uc_mcontext.gwins != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  if (uc != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    if (uc->uc_link == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
      // cannot validate without uc_link so accept current ucontext
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
      retuc = uc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
    } else if (os::Solaris::valid_ucontext(thread, uc, uc->uc_link)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
      // first ucontext is valid so try the next one
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
      uc = uc->uc_link;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
      if (uc->uc_link == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
        // cannot validate without uc_link so accept current ucontext
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
        retuc = uc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
      } else if (os::Solaris::valid_ucontext(thread, uc, uc->uc_link)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
        // the ucontext one level down is also valid so return it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
        retuc = uc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  return retuc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
// Assumes ucontext is valid
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   171
ExtendedPC os::Solaris::ucontext_get_ExtendedPC(const ucontext_t *uc) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  address pc = (address)uc->uc_mcontext.gregs[REG_PC];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  // set npc to zero to avoid using it for safepoint, good for profiling only
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  return ExtendedPC(pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
29573
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   177
void os::Solaris::ucontext_set_pc(ucontext_t* uc, address pc) {
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   178
  uc->uc_mcontext.gregs [REG_PC]  = (greg_t) pc;
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   179
  uc->uc_mcontext.gregs [REG_nPC] = (greg_t) (pc + 4);
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   180
}
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   181
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
// Assumes ucontext is valid
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   183
intptr_t* os::Solaris::ucontext_get_sp(const ucontext_t *uc) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  return (intptr_t*)((intptr_t)uc->uc_mcontext.gregs[REG_SP] + STACK_BIAS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
// Solaris X86 only
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   188
intptr_t* os::Solaris::ucontext_get_fp(const ucontext_t *uc) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   193
address os::Solaris::ucontext_get_pc(const ucontext_t *uc) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   194
  return (address) uc->uc_mcontext.gregs[REG_PC];
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   195
}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   196
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   197
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
// For Forte Analyzer AsyncGetCallTrace profiling support - thread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
// is currently interrupted by SIGPROF.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
// ret_fp parameter is only used by Solaris X86.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
// The difference between this and os::fetch_frame_from_context() is that
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
// here we try to skip nested signal frames.
35071
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   205
// This method is also used for stack overflow signal handling.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
ExtendedPC os::Solaris::fetch_frame_from_ucontext(Thread* thread,
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   207
  const ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  assert(thread != NULL, "just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  assert(ret_sp != NULL, "just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  assert(ret_fp == NULL, "just checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   213
  const ucontext_t *luc = os::Solaris::get_valid_uc_in_signal_handler(thread, uc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  return os::fetch_frame_from_context(luc, ret_sp, ret_fp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
// ret_fp parameter is only used by Solaris X86.
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   220
ExtendedPC os::fetch_frame_from_context(const void* ucVoid,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
                    intptr_t** ret_sp, intptr_t** ret_fp) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  ExtendedPC  epc;
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   224
  const ucontext_t *uc = (const ucontext_t*)ucVoid;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  if (uc != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
    epc = os::Solaris::ucontext_get_ExtendedPC(uc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
    if (ret_sp) *ret_sp = os::Solaris::ucontext_get_sp(uc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
    // construct empty ExtendedPC for return value checking
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
    epc = ExtendedPC(NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
    if (ret_sp) *ret_sp = (intptr_t *)NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  return epc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   238
frame os::fetch_frame_from_context(const void* ucVoid) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  intptr_t* sp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  intptr_t* fp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
  ExtendedPC epc = fetch_frame_from_context(ucVoid, &sp, &fp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  return frame(sp, frame::unpatchable, epc.pc());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
35071
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   245
frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   246
  intptr_t* sp;
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   247
  ExtendedPC epc = os::Solaris::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, NULL);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   248
  return frame(sp, frame::unpatchable, epc.pc());
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   249
}
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   250
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   251
bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   252
  address pc = (address) os::Solaris::ucontext_get_pc(uc);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   253
  if (Interpreter::contains(pc)) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   254
    *fr = os::fetch_frame_from_ucontext(thread, uc);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   255
    if (!fr->is_first_java_frame()) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   256
      assert(fr->safe_for_sender(thread), "Safety check");
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   257
      *fr = fr->java_sender();
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   258
    }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   259
  } else {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   260
    // more complex code with compiled code
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   261
    assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above");
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   262
    CodeBlob* cb = CodeCache::find_blob(pc);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   263
    if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   264
      // Not sure where the pc points to, fallback to default
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   265
      // stack overflow handling
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   266
      return false;
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   267
    } else {
40649
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   268
      // Returned frame will be the caller of the method that faults on the stack bang.
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   269
      // Register window not yet rotated (happens at SAVE after stack bang), so there is no new
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   270
      // frame to go with the faulting PC. Using caller SP that is still in SP, and caller PC
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   271
      // that was written to O7 at call.
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   272
      intptr_t* sp = os::Solaris::ucontext_get_sp(uc);
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   273
      address pc = (address)uc->uc_mcontext.gregs[REG_O7];
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   274
      *fr = frame(sp, frame::unpatchable, pc);
48c8f5272051 8156659: assert(CodeCache::find_blob_unsafe(_pc) == _cb) failed: inconsistent
neliasso
parents: 40093
diff changeset
   275
35071
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   276
      if (!fr->is_java_frame()) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   277
        assert(fr->safe_for_sender(thread), "Safety check");
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   278
        *fr = fr->java_sender();
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   279
      }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   280
    }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   281
  }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   282
  assert(fr->is_java_frame(), "Safety check");
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   283
  return true;
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   284
}
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   285
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
frame os::get_sender_for_C_frame(frame* fr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
11961
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   290
// Returns an estimate of the current stack pointer. Result must be guaranteed to
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   291
// point into the calling threads stack, and be no lower than the current stack
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   292
// pointer.
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   293
address os::current_stack_pointer() {
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   294
  volatile int dummy;
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   295
  address sp = (address)&dummy + 8;     // %%%% need to confirm if this is right
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   296
  return sp;
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   297
}
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   298
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
frame os::current_frame() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  intptr_t* sp = StubRoutines::Sparc::flush_callers_register_windows_func()();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  frame myframe(sp, frame::unpatchable,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
                CAST_FROM_FN_PTR(address, os::current_frame));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  if (os::is_first_C_frame(&myframe)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
    // stack is not walkable
26821
ce9f82507dc2 8058345: Refactor native stack printing from vmError.cpp to debug.cpp to make it available in gdb as well
simonis
parents: 26576
diff changeset
   305
    return frame(NULL, NULL, false);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
    return os::get_sender_for_C_frame(&myframe);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
bool os::is_allocatable(size_t bytes) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
   return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
8106
19106a0203fb 6588413: Use -fvisibility=hidden for gcc compiles
coleenp
parents: 7719
diff changeset
   315
extern "C" JNIEXPORT int
19106a0203fb 6588413: Use -fvisibility=hidden for gcc compiles
coleenp
parents: 7719
diff changeset
   316
JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
19106a0203fb 6588413: Use -fvisibility=hidden for gcc compiles
coleenp
parents: 7719
diff changeset
   317
                          int abort_if_unrecognized) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  ucontext_t* uc = (ucontext_t*) ucVoid;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
34633
2a6c7c7b30a7 8132510: Replace ThreadLocalStorage with compiler/language-based thread-local variables
dholmes
parents: 33732
diff changeset
   320
  Thread* t = Thread::current_or_null_safe();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
18943
7d0ef675e808 8020701: Avoid crashes in WatcherThread
rbackman
parents: 18025
diff changeset
   322
  // Must do this before SignalHandlerMark, if crash protection installed we will longjmp away
7d0ef675e808 8020701: Avoid crashes in WatcherThread
rbackman
parents: 18025
diff changeset
   323
  // (no destructors can be run)
46644
a5813fb66270 8183925: Decouple crash protection from watcher thread
rehn
parents: 46540
diff changeset
   324
  os::ThreadCrashProtection::check_crash_protection(sig, t);
18943
7d0ef675e808 8020701: Avoid crashes in WatcherThread
rbackman
parents: 18025
diff changeset
   325
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
  SignalHandlerMark shm(t);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
  if(sig == SIGPIPE || sig == SIGXFSZ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
    if (os::Solaris::chained_handler(sig, info, ucVoid)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
    } else {
37430
fd743dadef12 8151939: VM_Version_init() print buffer is too small
coleenp
parents: 35201
diff changeset
   332
      // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
  JavaThread* thread = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
  VMThread* vmthread = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
  if (os::Solaris::signal_handlers_are_installed) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
    if (t != NULL ){
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
      if(t->is_Java_thread()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
        thread = (JavaThread*)t;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
      else if(t->is_VM_thread()){
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
        vmthread = (VMThread *)t;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
46337
307e52ec20cd 8175817: Clean up Solaris signal code: SIGUSR2, SIGasync, SIGJVM1/2
dholmes
parents: 42906
diff changeset
   350
  if (sig == ASYNC_SIGNAL) {
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   351
    if (thread || vmthread) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents: 17087
diff changeset
   352
      OSThread::SR_handler(t, uc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
    } else if (os::Solaris::chained_handler(sig, info, ucVoid)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
    } else {
46337
307e52ec20cd 8175817: Clean up Solaris signal code: SIGUSR2, SIGasync, SIGJVM1/2
dholmes
parents: 42906
diff changeset
   357
      // If ASYNC_SIGNAL not chained, and this is a non-vm and
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
      // non-java thread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  if (info == NULL || info->si_code <= 0 || info->si_code == SI_NOINFO) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
    // can't decode this kind of signal
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
    info = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
    assert(sig == info->si_signo, "bad siginfo");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  // decide if this trap can be handled by a stub
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  address stub = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  address pc          = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  address npc         = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  //%note os_trap_1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  if (info != NULL && uc != NULL && thread != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
    // factor me: getPCfromContext
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
    pc  = (address) uc->uc_mcontext.gregs[REG_PC];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
    npc = (address) uc->uc_mcontext.gregs[REG_nPC];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
    // SafeFetch() support
18740
db44b1599483 8016697: Use stubs to implement safefetch
goetz
parents: 18025
diff changeset
   383
    if (StubRoutines::is_safefetch_fault(pc)) {
29573
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   384
      os::Solaris::ucontext_set_pc(uc, StubRoutines::continuation_for_safefetch_fault(pc));
18740
db44b1599483 8016697: Use stubs to implement safefetch
goetz
parents: 18025
diff changeset
   385
      return 1;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
    // Handle ALL stack overflow variations here
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
    if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
      address addr = (address) info->si_addr;
35201
996db89f378e 8139864: Improve handling of stack protection zones.
goetz
parents: 35077
diff changeset
   391
      if (thread->in_stack_yellow_reserved_zone(addr)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
        // Sometimes the register windows are not properly flushed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
        if(uc->uc_mcontext.gwins != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
          ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
        if (thread->thread_state() == _thread_in_Java) {
35071
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   397
          if (thread->in_stack_reserved_zone(addr)) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   398
            frame fr;
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   399
            if (os::Solaris::get_frame_at_stack_banging_point(thread, uc, &fr)) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   400
              assert(fr.is_java_frame(), "Must be a Java frame");
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   401
              frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   402
              if (activation.sp() != NULL) {
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   403
                thread->disable_stack_reserved_zone();
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   404
                RegisterMap map(thread);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   405
                int frame_size = activation.frame_size(&map);
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   406
                thread->set_reserved_stack_activation((address)(((address)activation.sp()) - STACK_BIAS));
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   407
                return true;
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   408
              }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   409
            }
a0910b1d3e0d 8046936: JEP 270: Reserved Stack Areas for Critical Sections
fparain
parents: 34667
diff changeset
   410
          }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
          // Throw a stack overflow exception.  Guard pages will be reenabled
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
          // while unwinding the stack.
35201
996db89f378e 8139864: Improve handling of stack protection zones.
goetz
parents: 35077
diff changeset
   413
          thread->disable_stack_yellow_reserved_zone();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
          stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
          // Thread was in the vm or native code.  Return and try to finish.
35201
996db89f378e 8139864: Improve handling of stack protection zones.
goetz
parents: 35077
diff changeset
   417
          thread->disable_stack_yellow_reserved_zone();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
          return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
      } else if (thread->in_stack_red_zone(addr)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
        // Fatal red zone violation.  Disable the guard pages and fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
        // to handle_unexpected_exception way down below.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
        thread->disable_stack_red_zone();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
        tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
        // Sometimes the register windows are not properly flushed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
        if(uc->uc_mcontext.gwins != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
          ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
55490
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   433
    if (thread->thread_state() == _thread_in_vm ||
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   434
        thread->thread_state() == _thread_in_native) {
40898
1c147e5e2b71 8165014: Unaligned unsafe access should throw InternalError on Solaris
mdoerr
parents: 40649
diff changeset
   435
      if (sig == SIGBUS && thread->doing_unsafe_access()) {
55490
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   436
        if (UnsafeCopyMemory::contains_pc(pc)) {
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   437
          npc = UnsafeCopyMemory::page_error_continue_pc(pc);
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   438
        }
38209
b2a58604e046 8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents: 38190
diff changeset
   439
        stub = SharedRuntime::handle_unsafe_access(thread, npc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
    else if (thread->thread_state() == _thread_in_Java) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
      // Java thread running in Java code => find exception handler if any
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
      // a fault inside compiled code, the interpreter, or a stub
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
      // Support Safepoint Polling
47881
0ce0ac68ace7 8189941: Implementation JEP 312: Thread-local handshake
rehn
parents: 47765
diff changeset
   448
      if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
        stub = SharedRuntime::get_poll_stub(pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
      // Not needed on x86 solaris because verify_oops doesn't generate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
      // SEGV/BUS like sparc does.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
      if ( (sig == SIGSEGV || sig == SIGBUS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
           && pc >= MacroAssembler::_verify_oop_implicit_branch[0]
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
           && pc <  MacroAssembler::_verify_oop_implicit_branch[1] ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
        stub     =  MacroAssembler::_verify_oop_implicit_branch[2];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
        warning("fixed up memory fault in +VerifyOops at address " INTPTR_FORMAT, info->si_addr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
      // This is not factored because on x86 solaris the patching for
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
      // zombies does not generate a SEGV.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
      else if (sig == SIGSEGV && nativeInstruction_at(pc)->is_zombie()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
        // zombie method (ld [%g0],%o7 instruction)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
        stub = SharedRuntime::get_handle_wrong_method_stub();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
        // At the stub it needs to look like a call from the caller of this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
        // method (not a call from the segv site).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
        pc = (address)uc->uc_mcontext.gregs[REG_O7];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
      else if (sig == SIGBUS && info->si_code == BUS_OBJERR) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
        // BugId 4454115: A read from a MappedByteBuffer can fault
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
        // here if the underlying file has been truncated.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
        // Do not crash the VM in such a case.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
        CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 37431
diff changeset
   476
        CompiledMethod* nm = cb->as_compiled_method_or_null();
55490
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   477
        bool is_unsafe_arraycopy = (thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc));
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   478
        if ((nm != NULL && nm->has_unsafe_access()) || is_unsafe_arraycopy) {
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   479
          if (is_unsafe_arraycopy) {
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   480
            npc = UnsafeCopyMemory::page_error_continue_pc(pc);
3f3dc00a69a5 8191278: MappedByteBuffer bulk access memory failures are not handled gracefully
jcm
parents: 53605
diff changeset
   481
          }
38209
b2a58604e046 8156088: Reintegrate 8153892: Handle unsafe access error directly in signal handler instead of going through a stub
mikael
parents: 38190
diff changeset
   482
          stub = SharedRuntime::handle_unsafe_access(thread, npc);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
      else if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
        // integer divide by zero
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
        stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
      else if (sig == SIGFPE && info->si_code == FPE_FLTDIV) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
        // floating-point divide by zero
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
        stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
#ifdef COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
      else if (sig == SIGILL && nativeInstruction_at(pc)->is_ic_miss_trap()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  #ifdef TIERED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
        CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
        assert(cb->is_compiled_by_c2(), "Wrong compiler");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
  #endif // TIERED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
#endif // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
        // Inline cache missed and user trap "Tne G0+ST_RESERVED_FOR_USER_0+2" taken.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
        stub = SharedRuntime::get_ic_miss_stub();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
        // At the stub it needs to look like a call from the caller of this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
        // method (not a call from the segv site).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
        pc = (address)uc->uc_mcontext.gregs[REG_O7];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
#endif  // COMPILER2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
52462
4ad404da0088 8213199: GC abstraction for Assembler::needs_explicit_null_check()
rkennke
parents: 52460
diff changeset
   510
      else if (sig == SIGSEGV && info->si_code > 0 && MacroAssembler::uses_implicit_null_check(info->si_addr)) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
        // Determination of interpreter/vtable stub/compiled code null exception
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
        stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
    // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
    // and the heap gets shrunk before the field access.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
    if ((sig == SIGSEGV) || (sig == SIGBUS)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
      address addr = JNI_FastGetField::find_slowcase_pc(pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
      if (addr != (address)-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
        stub = addr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
  if (stub != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
    // save all thread context in case we need to restore it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
    thread->set_saved_exception_pc(pc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
    thread->set_saved_exception_npc(npc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
    // simulate a branch to the stub (a "call" in the safepoint stub case)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
    // factor me: setPC
29573
2d800e5d575f 8074552: SafeFetch32 and SafeFetchN do not work in error handling
dholmes
parents: 26821
diff changeset
   534
    os::Solaris::ucontext_set_pc(uc, stub);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
  // signal-chaining
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
  if (os::Solaris::chained_handler(sig, info, ucVoid)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
  if (!abort_if_unrecognized) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
    // caller wants another chance, so give it to him
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
  if (!os::Solaris::libjsig_is_loaded) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
    struct sigaction oldAct;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
    sigaction(sig, (struct sigaction *)0, &oldAct);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
    if (oldAct.sa_sigaction != signalHandler) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
      void* sighand = oldAct.sa_sigaction ? CAST_FROM_FN_PTR(void*, oldAct.sa_sigaction)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
                                          : CAST_FROM_FN_PTR(void*, oldAct.sa_handler);
2131
98f9cef66a34 6810672: Comment typos
twisti
parents: 1
diff changeset
   555
      warning("Unexpected Signal %d occurred under user-defined signal handler " INTPTR_FORMAT, sig, (intptr_t)sighand);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
  if (pc == NULL && uc != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
    pc = (address) uc->uc_mcontext.gregs[REG_PC];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   563
  // Sometimes the register windows are not properly flushed.
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   564
  if(uc->uc_mcontext.gwins != NULL) {
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   565
    ::handle_unflushed_register_windows(uc->uc_mcontext.gwins);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   566
  }
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   567
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
  // unmask current signal
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
  sigset_t newset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
  sigemptyset(&newset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
  sigaddset(&newset, sig);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
  sigprocmask(SIG_UNBLOCK, &newset, NULL);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
7719
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   574
  // Determine which sort of error to throw.  Out of swap may signal
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   575
  // on the thread stack, which could get a mapping error when touched.
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   576
  address addr = (address) info->si_addr;
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   577
  if (sig == SIGBUS && info->si_code == BUS_OBJERR && info->si_errno == ENOMEM) {
17087
f0b76c4c93a0 8011661: Insufficient memory message says "malloc" when sometimes it should say "mmap"
ccheung
parents: 14633
diff changeset
   578
    vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "Out of swap space to map in thread stack.");
7719
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   579
  }
ef138e2849eb 6302804: Hotspot VM dies ungraceful death when C heap is exhausted in various places.
coleenp
parents: 7405
diff changeset
   580
33105
294e48b4f704 8080775: Better argument formatting for assert() and friends
david
parents: 29573
diff changeset
   581
  VMError::report_and_die(t, sig, pc, info, ucVoid);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
  ShouldNotReachHere();
34667
6b077f0ef25d 8144881: Various fixes to linux/sparc
mikael
parents: 34633
diff changeset
   584
  return false;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   587
void os::print_context(outputStream *st, const void *context) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
  if (context == NULL) return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   590
  const ucontext_t *uc = (const ucontext_t*)context;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
  st->print_cr("Registers:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   593
  st->print_cr(" G1=" INTPTR_FORMAT " G2=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   594
               " G3=" INTPTR_FORMAT " G4=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   595
            uc->uc_mcontext.gregs[REG_G1],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   596
            uc->uc_mcontext.gregs[REG_G2],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   597
            uc->uc_mcontext.gregs[REG_G3],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   598
            uc->uc_mcontext.gregs[REG_G4]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   599
  st->print_cr(" G5=" INTPTR_FORMAT " G6=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   600
               " G7=" INTPTR_FORMAT " Y=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   601
            uc->uc_mcontext.gregs[REG_G5],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   602
            uc->uc_mcontext.gregs[REG_G6],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   603
            uc->uc_mcontext.gregs[REG_G7],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   604
            uc->uc_mcontext.gregs[REG_Y]);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
  st->print_cr(" O0=" INTPTR_FORMAT " O1=" INTPTR_FORMAT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   606
               " O2=" INTPTR_FORMAT " O3=" INTPTR_FORMAT,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   607
                 uc->uc_mcontext.gregs[REG_O0],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   608
                 uc->uc_mcontext.gregs[REG_O1],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   609
                 uc->uc_mcontext.gregs[REG_O2],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
                 uc->uc_mcontext.gregs[REG_O3]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
  st->print_cr(" O4=" INTPTR_FORMAT " O5=" INTPTR_FORMAT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   612
               " O6=" INTPTR_FORMAT " O7=" INTPTR_FORMAT,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   613
            uc->uc_mcontext.gregs[REG_O4],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
            uc->uc_mcontext.gregs[REG_O5],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
            uc->uc_mcontext.gregs[REG_O6],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
            uc->uc_mcontext.gregs[REG_O7]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   618
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   619
  intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   620
  st->print_cr(" L0=" INTPTR_FORMAT " L1=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   621
               " L2=" INTPTR_FORMAT " L3=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   622
               sp[L0->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   623
               sp[L1->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   624
               sp[L2->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   625
               sp[L3->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   626
  st->print_cr(" L4=" INTPTR_FORMAT " L5=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   627
               " L6=" INTPTR_FORMAT " L7=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   628
               sp[L4->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   629
               sp[L5->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   630
               sp[L6->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   631
               sp[L7->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   632
  st->print_cr(" I0=" INTPTR_FORMAT " I1=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   633
               " I2=" INTPTR_FORMAT " I3=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   634
               sp[I0->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   635
               sp[I1->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   636
               sp[I2->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   637
               sp[I3->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   638
  st->print_cr(" I4=" INTPTR_FORMAT " I5=" INTPTR_FORMAT
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   639
               " I6=" INTPTR_FORMAT " I7=" INTPTR_FORMAT,
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   640
               sp[I4->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   641
               sp[I5->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   642
               sp[I6->sp_offset_in_saved_window()],
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   643
               sp[I7->sp_offset_in_saved_window()]);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   644
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
  st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
            uc->uc_mcontext.gregs[REG_PC],
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
            uc->uc_mcontext.gregs[REG_nPC]);
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   648
  st->cr();
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   649
  st->cr();
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   650
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   651
  st->print_cr("Top of Stack: (sp=" PTR_FORMAT ")", sp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   652
  print_hex_dump(st, (address)sp, (address)(sp + 32), sizeof(intptr_t));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   653
  st->cr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   654
489c9b5090e2 Initial load
duke
parents:
diff changeset
   655
  // Note: it may be unsafe to inspect memory near pc. For example, pc may
489c9b5090e2 Initial load
duke
parents:
diff changeset
   656
  // point to garbage if entry point in an nmethod is corrupted. Leave
489c9b5090e2 Initial load
duke
parents:
diff changeset
   657
  // this at the end, and hope for the best.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   658
  ExtendedPC epc = os::Solaris::ucontext_get_ExtendedPC(uc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   659
  address pc = epc.pc();
53605
853c68ff2ed7 8217879: hs_err should print more instructions in hex dump
shade
parents: 52462
diff changeset
   660
  print_instructions(st, pc, sizeof(char));
853c68ff2ed7 8217879: hs_err should print more instructions in hex dump
shade
parents: 52462
diff changeset
   661
  st->cr();
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   662
}
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   663
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   664
void os::print_register_info(outputStream *st, const void *context) {
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   665
  if (context == NULL) return;
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   666
35077
8b86440d3bf1 8145114: const-correctness for ucontext_t* reading functions
stuefe
parents: 35071
diff changeset
   667
  const ucontext_t *uc = (const ucontext_t*)context;
7108
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   668
  intptr_t *sp = (intptr_t *)os::Solaris::ucontext_get_sp(uc);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   669
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   670
  st->print_cr("Register to memory mapping:");
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   671
  st->cr();
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   672
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   673
  // this is only for the "general purpose" registers
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   674
  st->print("G1="); print_location(st, uc->uc_mcontext.gregs[REG_G1]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   675
  st->print("G2="); print_location(st, uc->uc_mcontext.gregs[REG_G2]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   676
  st->print("G3="); print_location(st, uc->uc_mcontext.gregs[REG_G3]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   677
  st->print("G4="); print_location(st, uc->uc_mcontext.gregs[REG_G4]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   678
  st->print("G5="); print_location(st, uc->uc_mcontext.gregs[REG_G5]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   679
  st->print("G6="); print_location(st, uc->uc_mcontext.gregs[REG_G6]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   680
  st->print("G7="); print_location(st, uc->uc_mcontext.gregs[REG_G7]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   681
  st->cr();
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   682
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   683
  st->print("O0="); print_location(st, uc->uc_mcontext.gregs[REG_O0]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   684
  st->print("O1="); print_location(st, uc->uc_mcontext.gregs[REG_O1]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   685
  st->print("O2="); print_location(st, uc->uc_mcontext.gregs[REG_O2]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   686
  st->print("O3="); print_location(st, uc->uc_mcontext.gregs[REG_O3]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   687
  st->print("O4="); print_location(st, uc->uc_mcontext.gregs[REG_O4]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   688
  st->print("O5="); print_location(st, uc->uc_mcontext.gregs[REG_O5]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   689
  st->print("O6="); print_location(st, uc->uc_mcontext.gregs[REG_O6]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   690
  st->print("O7="); print_location(st, uc->uc_mcontext.gregs[REG_O7]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   691
  st->cr();
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   692
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   693
  st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   694
  st->print("L1="); print_location(st, sp[L1->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   695
  st->print("L2="); print_location(st, sp[L2->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   696
  st->print("L3="); print_location(st, sp[L3->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   697
  st->print("L4="); print_location(st, sp[L4->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   698
  st->print("L5="); print_location(st, sp[L5->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   699
  st->print("L6="); print_location(st, sp[L6->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   700
  st->print("L7="); print_location(st, sp[L7->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   701
  st->cr();
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   702
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   703
  st->print("I0="); print_location(st, sp[I0->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   704
  st->print("I1="); print_location(st, sp[I1->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   705
  st->print("I2="); print_location(st, sp[I2->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   706
  st->print("I3="); print_location(st, sp[I3->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   707
  st->print("I4="); print_location(st, sp[I4->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   708
  st->print("I5="); print_location(st, sp[I5->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   709
  st->print("I6="); print_location(st, sp[I6->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   710
  st->print("I7="); print_location(st, sp[I7->sp_offset_in_saved_window()]);
4f87b92f3060 6970683: improvements to hs_err output
never
parents: 6176
diff changeset
   711
  st->cr();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   712
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   713
489c9b5090e2 Initial load
duke
parents:
diff changeset
   714
void os::Solaris::init_thread_fpu_state(void) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   715
    // Nothing needed on Sparc.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   716
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   717
11961
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   718
#ifndef PRODUCT
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   719
void os::verify_stack_alignment() {
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   720
}
0abd4cd26e5a 7147740: add assertions to check stack alignment on VM entry from generated code (x64)
roland
parents: 8921
diff changeset
   721
#endif
26576
a9429d24d429 8050147: StoreLoad barrier interferes with stack usages
shade
parents: 25715
diff changeset
   722
a9429d24d429 8050147: StoreLoad barrier interferes with stack usages
shade
parents: 25715
diff changeset
   723
int os::extra_bang_size_in_bytes() {
a9429d24d429 8050147: StoreLoad barrier interferes with stack usages
shade
parents: 25715
diff changeset
   724
  // SPARC does not require an additional stack bang.
a9429d24d429 8050147: StoreLoad barrier interferes with stack usages
shade
parents: 25715
diff changeset
   725
  return 0;
a9429d24d429 8050147: StoreLoad barrier interferes with stack usages
shade
parents: 25715
diff changeset
   726
}