hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
author duke
Wed, 05 Jul 2017 17:20:17 +0200
changeset 6218 5e435a178db7
parent 5547 f4b087cbb361
child 7397 5b173b4ca846
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
     1
/*
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5418
diff changeset
     2
 * Copyright (c) 2003, 2007, 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
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    26
// Constructors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    27
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    28
inline frame::frame() {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    29
  _zeroframe = NULL;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    30
  _sp = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    31
  _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    32
  _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    33
  _deopt_state = unknown;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    34
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    35
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    36
inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    37
  _zeroframe = zf;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    38
  _sp = sp;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    39
  switch (zeroframe()->type()) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    40
  case ZeroFrame::ENTRY_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    41
    _pc = StubRoutines::call_stub_return_pc();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    42
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    43
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    44
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    45
  case ZeroFrame::INTERPRETER_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    46
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    47
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    48
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    49
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    50
  case ZeroFrame::SHARK_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    51
    _pc = zero_sharkframe()->pc();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    52
    _cb = CodeCache::find_blob_unsafe(pc());
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    53
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    54
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    55
  case ZeroFrame::FAKE_STUB_FRAME:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    56
    _pc = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    57
    _cb = NULL;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    58
    break;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    59
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    60
  default:
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    61
    ShouldNotReachHere();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    62
  }
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    63
  _deopt_state = not_deoptimized;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    64
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    65
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    66
// Accessors
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    67
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    68
inline intptr_t* frame::sender_sp() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
    69
  return fp() + 1;
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    70
}
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::link() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    73
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    74
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    75
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    76
#ifdef CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    77
inline interpreterState frame::get_interpreterState() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    78
  return zero_interpreterframe()->interpreter_state();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    79
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    80
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    81
inline intptr_t** frame::interpreter_frame_locals_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    82
  return &(get_interpreterState()->_locals);
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
inline intptr_t* frame::interpreter_frame_bcx_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    86
  return (intptr_t*) &(get_interpreterState()->_bcp);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    87
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    88
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    89
inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    90
  return &(get_interpreterState()->_constants);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    91
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    92
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    93
inline methodOop* frame::interpreter_frame_method_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    94
  return &(get_interpreterState()->_method);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    95
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    96
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    97
inline intptr_t* frame::interpreter_frame_mdx_addr() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    98
  return (intptr_t*) &(get_interpreterState()->_mdx);
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
    99
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   100
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   101
inline intptr_t* frame::interpreter_frame_tos_address() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   102
  return get_interpreterState()->_stack + 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   103
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   104
#endif // CC_INTERP
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   105
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   106
inline int frame::interpreter_frame_monitor_size() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   107
  return BasicObjectLock::size();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   108
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   109
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   110
inline intptr_t* frame::interpreter_frame_expression_stack() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   111
  intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   112
  return monitor_end - 1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   113
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   114
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   115
inline jint frame::interpreter_frame_expression_stack_direction() {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   116
  return -1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   117
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   118
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   119
// 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
   120
// we can distinguish identity and younger/older relationship. NULL
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   121
// represents an invalid (incomparable) frame.
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   122
inline intptr_t* frame::id() const {
5418
c4955cb6ed33 6939182: Zero JNI handles fix
twisti
parents: 4013
diff changeset
   123
  return fp();
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   124
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   125
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   126
inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   127
  return zero_entryframe()->call_wrapper();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   128
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   129
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   130
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   131
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   132
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   133
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   134
inline oop frame::saved_oop_result(RegisterMap* map) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   135
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   136
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   137
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   138
inline bool frame::is_older(intptr_t* id) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   139
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   140
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   141
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   142
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   143
  ShouldNotCallThis();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   144
}
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   145
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   146
inline intptr_t* frame::unextended_sp() const {
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   147
  if (zeroframe()->is_shark_frame())
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   148
    return zero_sharkframe()->unextended_sp();
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   149
  else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   150
    return (intptr_t *) -1;
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents:
diff changeset
   151
}