src/hotspot/cpu/zero/frame_zero.inline.hpp
author stefank
Thu, 09 May 2019 14:28:30 +0200
changeset 54786 ebf733a324d4
parent 53244 9807daeb47c4
permissions -rw-r--r--
8223624: Cleanup includes of universe.hpp Reviewed-by: coleenp, lkorinth
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49480
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
     3
 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     5
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     9
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    14
 * accompanied this code).
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    15
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    19
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
    22
 * questions.
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    23
 *
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    24
 */
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49480
diff changeset
    26
#ifndef CPU_ZERO_FRAME_ZERO_INLINE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49480
diff changeset
    27
#define CPU_ZERO_FRAME_ZERO_INLINE_HPP
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
26142
038e0f01b4a9 8055231: ZERO variant build is broken
coleenp
parents: 25714
diff changeset
    29
#include "code/codeCache.hpp"
038e0f01b4a9 8055231: ZERO variant build is broken
coleenp
parents: 25714
diff changeset
    30
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
// Constructors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    32
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
inline frame::frame() {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    34
  _zeroframe = NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
  _sp = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    36
  _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    37
  _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
  _deopt_state = unknown;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    39
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
19336
ddceb0657500 8022956: Clang: enable return type warnings on BSD
twisti
parents: 19267
diff changeset
    41
inline address  frame::sender_pc()           const { ShouldNotCallThis(); return NULL; }
14294
130e947dfbe6 8000780: make Zero build and run with JDK8
twisti
parents: 13728
diff changeset
    42
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    43
inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    44
  _zeroframe = zf;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
  _sp = sp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
  switch (zeroframe()->type()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
  case ZeroFrame::ENTRY_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
    _pc = StubRoutines::call_stub_return_pc();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
    _cb = NULL;
15205
17da82a12ff4 8005817: Shark: implement deoptimization support
twisti
parents: 14294
diff changeset
    50
    _deopt_state = not_deoptimized;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
  case ZeroFrame::INTERPRETER_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
    _cb = NULL;
15205
17da82a12ff4 8005817: Shark: implement deoptimization support
twisti
parents: 14294
diff changeset
    56
    _deopt_state = not_deoptimized;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
  case ZeroFrame::FAKE_STUB_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
    _cb = NULL;
15205
17da82a12ff4 8005817: Shark: implement deoptimization support
twisti
parents: 14294
diff changeset
    62
    _deopt_state = not_deoptimized;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
  default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
    ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    69
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
// Accessors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    71
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    72
inline intptr_t* frame::sender_sp() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    73
  return fp() + 1;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
11486
cdc636532368 7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents: 7397
diff changeset
    76
inline intptr_t* frame::real_fp() const {
cdc636532368 7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents: 7397
diff changeset
    77
  return fp();
cdc636532368 7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents: 7397
diff changeset
    78
}
cdc636532368 7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents: 7397
diff changeset
    79
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
inline intptr_t* frame::link() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
  ShouldNotCallThis();
19336
ddceb0657500 8022956: Clang: enable return type warnings on BSD
twisti
parents: 19267
diff changeset
    82
  return NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    83
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    84
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    85
#ifdef CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
inline interpreterState frame::get_interpreterState() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
  return zero_interpreterframe()->interpreter_state();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
inline intptr_t** frame::interpreter_frame_locals_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
  return &(get_interpreterState()->_locals);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 22234
diff changeset
    94
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
  return (intptr_t*) &(get_interpreterState()->_bcp);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11486
diff changeset
    98
inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
  return &(get_interpreterState()->_constants);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 11486
diff changeset
   102
inline Method** frame::interpreter_frame_method_addr() const {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
  return &(get_interpreterState()->_method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
38074
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35214
diff changeset
   106
inline oop* frame::interpreter_frame_mirror_addr() const {
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35214
diff changeset
   107
  return &(get_interpreterState()->_mirror);
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35214
diff changeset
   108
}
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35214
diff changeset
   109
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 22234
diff changeset
   110
inline intptr_t* frame::interpreter_frame_mdp_addr() const {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
  return (intptr_t*) &(get_interpreterState()->_mdx);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
inline intptr_t* frame::interpreter_frame_tos_address() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
  return get_interpreterState()->_stack + 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
}
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 26142
diff changeset
   117
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 26142
diff changeset
   118
inline oop* frame::interpreter_frame_temp_oop_addr() const {
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 26142
diff changeset
   119
  interpreterState istate = get_interpreterState();
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 26142
diff changeset
   120
  return (oop *)&istate->_oop_temp;
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 26142
diff changeset
   121
}
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
#endif // CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   123
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
inline int frame::interpreter_frame_monitor_size() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
  return BasicObjectLock::size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
inline intptr_t* frame::interpreter_frame_expression_stack() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
  intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
  return monitor_end - 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
// Return a unique id for this frame. The id must have a value where
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
// we can distinguish identity and younger/older relationship. NULL
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
// represents an invalid (incomparable) frame.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
inline intptr_t* frame::id() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
   137
  return fp();
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
19267
058bf12be1e0 8022188: Make zero compile after 8016131 and 8016697
omajid
parents: 15205
diff changeset
   140
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
  return zero_entryframe()->call_wrapper();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
inline oop frame::saved_oop_result(RegisterMap* map) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
  ShouldNotCallThis();
19336
ddceb0657500 8022956: Clang: enable return type warnings on BSD
twisti
parents: 19267
diff changeset
   150
  return NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   152
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   153
inline bool frame::is_older(intptr_t* id) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   154
  ShouldNotCallThis();
19336
ddceb0657500 8022956: Clang: enable return type warnings on BSD
twisti
parents: 19267
diff changeset
   155
  return false;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   156
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   157
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   158
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   159
  ShouldNotCallThis();
19336
ddceb0657500 8022956: Clang: enable return type warnings on BSD
twisti
parents: 19267
diff changeset
   160
  return NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   161
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   162
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   163
inline intptr_t* frame::unextended_sp() const {
47687
fb290fd1f9d4 8171853: Remove Shark compiler
rkennke
parents: 47216
diff changeset
   164
  return (intptr_t *) -1;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   165
}
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   166
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 49480
diff changeset
   167
#endif // CPU_ZERO_FRAME_ZERO_INLINE_HPP