src/hotspot/cpu/ppc/frame_ppc.inline.hpp
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 57626 91bc70505019
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51382
diff changeset
     2
 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
35594
cc13089c6327 8147937: Adapt SAP copyrights to new company name.
goetz
parents: 35232
diff changeset
     3
 * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     5
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
     9
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    14
 * accompanied this code).
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    15
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    19
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    22
 * questions.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    23
 *
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    24
 */
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    25
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51382
diff changeset
    26
#ifndef CPU_PPC_FRAME_PPC_INLINE_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51382
diff changeset
    27
#define CPU_PPC_FRAME_PPC_INLINE_HPP
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    28
24349
d8f40e5b392d 8042309: Some bugfixes for the ppc64 port.
goetz
parents: 23221
diff changeset
    29
#include "code/codeCache.hpp"
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 24349
diff changeset
    30
#include "code/vmreg.inline.hpp"
46625
edefffab74e2 8183552: Move align functions to align.hpp
stefank
parents: 46620
diff changeset
    31
#include "utilities/align.hpp"
24349
d8f40e5b392d 8042309: Some bugfixes for the ppc64 port.
goetz
parents: 23221
diff changeset
    32
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    33
// Inline functions for ppc64 frames:
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    34
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    35
// Find codeblob and set deopt_state.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    36
inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    37
  assert(pc != NULL, "precondition: must have PC");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    38
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    39
  _cb = CodeCache::find_blob(pc);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    40
  _pc = pc;   // Must be set for get_deopt_original_pc()
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    41
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    42
  _fp = (intptr_t*)own_abi()->callers_sp;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    43
38133
78b95467b9f1 8151956: Support non-continuous CodeBlobs in HotSpot
rbackman
parents: 35594
diff changeset
    44
  address original_pc = CompiledMethod::get_deopt_original_pc(this);
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    45
  if (original_pc != NULL) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    46
    _pc = original_pc;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    47
    _deopt_state = is_deoptimized;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    48
  } else {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    49
    _deopt_state = not_deoptimized;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    50
  }
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    51
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    52
  assert(((uint64_t)_sp & 0xf) == 0, "SP must be 16-byte aligned");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    53
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    54
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    55
// Constructors
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    56
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    57
// Initialize all fields, _unextended_sp will be adjusted in find_codeblob_and_set_pc_and_deopt_state.
51382
0038e99f93bc 8209357: [PPC64] Fix build which was broken by 8208672 (Enable -Wreorder)
ghaug
parents: 49480
diff changeset
    58
inline frame::frame() : _sp(NULL), _pc(NULL), _cb(NULL),  _deopt_state(unknown), _unextended_sp(NULL), _fp(NULL) {}
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    59
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    60
inline frame::frame(intptr_t* sp) : _sp(sp), _unextended_sp(sp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    61
  find_codeblob_and_set_pc_and_deopt_state((address)own_abi()->lr); // also sets _fp and adjusts _unextended_sp
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    62
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    63
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    64
inline frame::frame(intptr_t* sp, address pc) : _sp(sp), _unextended_sp(sp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    65
  find_codeblob_and_set_pc_and_deopt_state(pc); // also sets _fp and adjusts _unextended_sp
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    66
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    67
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    68
inline frame::frame(intptr_t* sp, address pc, intptr_t* unextended_sp) : _sp(sp), _unextended_sp(unextended_sp) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    69
  find_codeblob_and_set_pc_and_deopt_state(pc); // also sets _fp and adjusts _unextended_sp
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    70
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    71
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    72
// Accessors
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    73
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    74
// Return unique id for this frame. The id must have a value where we
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    75
// can distinguish identity and younger/older relationship. NULL
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    76
// represents an invalid (incomparable) frame.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    77
inline intptr_t* frame::id(void) const {
22861
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22824
diff changeset
    78
  // Use _fp. _sp or _unextended_sp wouldn't be correct due to resizing.
f5c393d456fc 8029940: PPC64 (part 122): C2 compiler port
goetz
parents: 22824
diff changeset
    79
  return _fp;
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    80
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    81
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    82
// Return true if this frame is older (less recent activation) than
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    83
// the frame represented by id.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    84
inline bool frame::is_older(intptr_t* id) const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    85
   assert(this->id() != NULL && id != NULL, "NULL frame id");
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    86
   // Stack grows towards smaller addresses on ppc64.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    87
   return this->id() > id;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    88
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    89
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    90
inline int frame::frame_size(RegisterMap* map) const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    91
  // Stack grows towards smaller addresses on PPC64: sender is at a higher address.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    92
  return sender_sp() - sp();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    93
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    94
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    95
// Return the frame's stack pointer before it has been extended by a
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    96
// c2i adapter. This is needed by deoptimization for ignoring c2i adapter
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    97
// frames.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    98
inline intptr_t* frame::unextended_sp() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
    99
  return _unextended_sp;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   100
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   101
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   102
// All frames have this field.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   103
inline address frame::sender_pc() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   104
  return (address)callers_abi()->lr;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   105
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   106
inline address* frame::sender_pc_addr() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   107
  return (address*)&(callers_abi()->lr);
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   108
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   109
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   110
// All frames have this field.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   111
inline intptr_t* frame::sender_sp() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   112
  return (intptr_t*)callers_abi();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   113
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   114
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   115
// All frames have this field.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   116
inline intptr_t* frame::link() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   117
  return (intptr_t*)callers_abi()->callers_sp;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   118
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   119
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   120
inline intptr_t* frame::real_fp() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   121
  return fp();
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   122
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   123
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   124
// Template Interpreter frame value accessors.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   125
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   126
inline frame::ijava_state* frame::get_ijava_state() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   127
  return (ijava_state*) ((uintptr_t)fp() - ijava_state_size);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   128
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   129
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   130
inline intptr_t** frame::interpreter_frame_locals_addr() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   131
  return (intptr_t**) &(get_ijava_state()->locals);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   132
}
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   133
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 24349
diff changeset
   134
inline intptr_t* frame::interpreter_frame_bcp_addr() const {
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   135
  return (intptr_t*) &(get_ijava_state()->bcp);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   136
}
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   137
25714
87fa6860b5ae 8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents: 24349
diff changeset
   138
inline intptr_t* frame::interpreter_frame_mdp_addr() const {
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   139
  return (intptr_t*) &(get_ijava_state()->mdx);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   140
}
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   141
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   142
// Pointer beyond the "oldest/deepest" BasicObjectLock on stack.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   143
inline BasicObjectLock* frame::interpreter_frame_monitor_end() const {
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   144
  return (BasicObjectLock*) get_ijava_state()->monitors;
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   145
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   146
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   147
inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   148
  return (BasicObjectLock*) get_ijava_state();
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   149
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   150
31773
f874931cbae7 8130653: ppc: implement MultiplyToLen intrinsic
goetz
parents: 25717
diff changeset
   151
// Return register stack slot addr at which currently interpreted method is found.
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   152
inline Method** frame::interpreter_frame_method_addr() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   153
  return (Method**) &(get_ijava_state()->method);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   154
}
38074
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35594
diff changeset
   155
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35594
diff changeset
   156
inline oop* frame::interpreter_frame_mirror_addr() const {
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35594
diff changeset
   157
  return (oop*) &(get_ijava_state()->mirror);
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35594
diff changeset
   158
}
8475fdc6dcc3 8154580: Save mirror in interpreter frame to enable cleanups of CLDClosure
coleenp
parents: 35594
diff changeset
   159
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   160
inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   161
  return (ConstantPoolCache**) &(get_ijava_state()->cpoolCache);
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   162
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   163
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   164
inline oop* frame::interpreter_frame_temp_oop_addr() const {
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   165
  return (oop*) &(get_ijava_state()->oop_tmp);
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   166
}
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   167
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   168
inline intptr_t* frame::interpreter_frame_esp() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   169
  return (intptr_t*) get_ijava_state()->esp;
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   170
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   171
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   172
// Convenient setters
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   173
inline void frame::interpreter_frame_set_monitor_end(BasicObjectLock* end)    { get_ijava_state()->monitors = (intptr_t) end;}
57626
91bc70505019 8228649: [PPC64] SA reads wrong slots from interpreter frames
mdoerr
parents: 53244
diff changeset
   174
inline void frame::interpreter_frame_set_cpcache(ConstantPoolCache* cp)       { *interpreter_frame_cache_addr() = cp; }
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   175
inline void frame::interpreter_frame_set_esp(intptr_t* esp)                   { get_ijava_state()->esp = (intptr_t) esp; }
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   176
inline void frame::interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp) { get_ijava_state()->top_frame_sp = (intptr_t) top_frame_sp; }
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   177
inline void frame::interpreter_frame_set_sender_sp(intptr_t* sender_sp)       { get_ijava_state()->sender_sp = (intptr_t) sender_sp; }
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   178
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   179
inline intptr_t* frame::interpreter_frame_expression_stack() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   180
  return (intptr_t*)interpreter_frame_monitor_end() - 1;
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   181
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   182
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   183
// top of expression stack
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   184
inline intptr_t* frame::interpreter_frame_tos_address() const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   185
  return ((intptr_t*) get_ijava_state()->esp) + Interpreter::stackElementWords;
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   186
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   187
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   188
inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   189
  return &interpreter_frame_tos_address()[offset];
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   190
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents: 22861
diff changeset
   191
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   192
inline int frame::interpreter_frame_monitor_size() {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   193
  // Number of stack slots for a monitor.
46620
750c6edff33b 8178500: Replace usages of round_to and round_down with align_up and align_down
stefank
parents: 38144
diff changeset
   194
  return align_up(BasicObjectLock::size(),  // number of stack slots
22824
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   195
                  WordsPerLong);            // number of stack slots for a Java long
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   196
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   197
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   198
inline int frame::interpreter_frame_monitor_size_in_bytes() {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   199
  return frame::interpreter_frame_monitor_size() * wordSize;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   200
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   201
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   202
// entry frames
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   203
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   204
inline intptr_t* frame::entry_frame_argument_at(int offset) const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   205
  // Since an entry frame always calls the interpreter first, the
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   206
  // parameters are on the stack and relative to known register in the
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   207
  // entry frame.
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   208
  intptr_t* tos = (intptr_t*)get_entry_frame_locals()->arguments_tos_address;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   209
  return &tos[offset + 1]; // prepushed tos
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   210
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   211
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   212
inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   213
  return (JavaCallWrapper**)&get_entry_frame_locals()->call_wrapper_address;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   214
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   215
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   216
inline oop frame::saved_oop_result(RegisterMap* map) const {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   217
  return *((oop*)map->location(R3->as_VMReg()));
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   218
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   219
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   220
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   221
  *((oop*)map->location(R3->as_VMReg())) = obj;
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   222
}
28258dd5cb2e 8019972: PPC64 (part 9): platform files for interpreter only VM.
goetz
parents:
diff changeset
   223
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 51382
diff changeset
   224
#endif // CPU_PPC_FRAME_PPC_INLINE_HPP