hotspot/src/os_cpu/linux_s390/vm/thread_linux_s390.hpp
author weijun
Sat, 08 Jul 2017 14:09:01 +0800
changeset 45839 6df5e24443fc
parent 42065 6032b31e3719
child 47106 bed18a111b90
permissions -rw-r--r--
8183509: keytool should not allow multiple commands Reviewed-by: mullan, vinnie
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42065
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     1
/*
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     3
 * Copyright (c) 2016 SAP SE. All rights reserved.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     5
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
     9
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    14
 * accompanied this code).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    15
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    19
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    22
 * questions.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    23
 *
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    24
 */
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    25
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    26
#ifndef OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    27
#define OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    28
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    29
 private:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    30
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    31
  void pd_initialize() {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    32
    _anchor.clear();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    33
    _last_interpreter_fp = NULL;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    34
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    35
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    36
  // The `last' frame is the youngest Java frame on the thread's stack.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    37
  frame pd_last_frame() {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    38
    assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    39
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    40
    intptr_t* sp = last_Java_sp();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    41
    address pc = _anchor.last_Java_pc();
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    42
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    43
    // Last_Java_pc ist not set if we come here from compiled code.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    44
    if (pc == NULL) {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    45
      pc = (address) *(sp + 14);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    46
    }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    47
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    48
    return frame(sp, pc);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    49
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    50
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    51
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    52
  void set_base_of_stack_pointer(intptr_t* base_sp) {}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    53
  intptr_t* base_of_stack_pointer() { return NULL; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    54
  void record_base_of_stack_pointer() {}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    55
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    56
  // These routines are only used on cpu architectures that
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    57
  // have separate register stacks (Itanium).
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    58
  static bool register_stack_overflow() { return false; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    59
  static void enable_register_stack_guard() {}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    60
  static void disable_register_stack_guard() {}
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    61
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    62
  bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    63
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    64
 protected:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    65
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    66
  // -Xprof support
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    67
  //
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    68
  // In order to find the last Java fp from an async profile
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    69
  // tick, we store the current interpreter fp in the thread.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    70
  // This value is only valid while we are in the C++ interpreter
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    71
  // and profiling.
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    72
  intptr_t *_last_interpreter_fp;
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    73
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    74
 public:
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    75
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    76
  static ByteSize last_interpreter_fp_offset() {
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    77
    return byte_offset_of(JavaThread, _last_interpreter_fp);
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    78
  }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    79
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    80
  intptr_t* last_interpreter_fp() { return _last_interpreter_fp; }
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    81
6032b31e3719 8167673: [s390] The s390 port.
goetz
parents:
diff changeset
    82
#endif // OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP