hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
author coleenp
Tue, 22 Dec 2015 11:11:29 -0500
changeset 35214 d86005e0b4c2
parent 34651 07b1cc0f6040
permissions -rw-r--r--
8074457: Remove the non-Zero CPP Interpreter Summary: Remove cppInterpreter assembly files and reorganize InterpreterGenerator includes Reviewed-by: goetz, bdelsart
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
31790
4a08476437e8 8025692: Log what methods are touched at run-time
minqi
parents: 28650
diff changeset
     2
 * Copyright (c) 1997, 2015, 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: 5419
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5419
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: 5419
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: 6453
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    26
#include "interpreter/interpreter.hpp"
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    27
#include "oops/constMethod.hpp"
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13391
diff changeset
    28
#include "oops/method.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    29
#include "runtime/arguments.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    30
#include "runtime/frame.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6453
diff changeset
    31
#include "runtime/synchronizer.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 15116
diff changeset
    32
#include "utilities/macros.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    34
// Size of interpreter code.  Increase if too small.  Interpreter will
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    35
// fail with a guarantee ("not enough space for interpreter generation");
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    36
// if too small.
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    37
// Run with +PrintInterpreter to get the VM to print out the size.
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    38
// Max size with JVMTI
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    39
#ifdef _LP64
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    40
  // The sethi() instruction generates lots more instructions when shell
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    41
  // stack limit is unlimited, so that's why this is much bigger.
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    42
int TemplateInterpreter::InterpreterCodeSize = 260 * K;
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    43
#else
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    44
int TemplateInterpreter::InterpreterCodeSize = 230 * K;
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    45
#endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    47
int AbstractInterpreter::BasicType_as_index(BasicType type) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    48
  int i = 0;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    49
  switch (type) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    50
    case T_BOOLEAN: i = 0; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    51
    case T_CHAR   : i = 1; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    52
    case T_BYTE   : i = 2; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    53
    case T_SHORT  : i = 3; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    54
    case T_INT    : i = 4; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    55
    case T_LONG   : i = 5; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    56
    case T_VOID   : i = 6; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    57
    case T_FLOAT  : i = 7; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    58
    case T_DOUBLE : i = 8; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    59
    case T_OBJECT : i = 9; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    60
    case T_ARRAY  : i = 9; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    61
    default       : ShouldNotReachHere();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  }
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    63
  assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    64
  return i;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    67
bool AbstractInterpreter::can_be_compiled(methodHandle m) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    68
  // No special entry points that preclude compilation
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 34205
diff changeset
    69
  return true;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  // Figure out the size of an interpreter frame (in words) given that we have a fully allocated
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  // expression stack, the callee will have callee_extra_locals (so we can account for
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  // frame extension) and monitor_size for monitors. Basically we need to calculate
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  // this exactly like generate_fixed_frame/generate_compute_interpreter_state.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // The big complicating thing here is that we must ensure that the stack stays properly
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  // aligned. This would be even uglier if monitor size wasn't modulo what the stack
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  // needs to be aligned for). We are given that the sp (fp) is already aligned by
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  // the caller so we must ensure that it is properly aligned for our callee.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  const int rounded_vm_local_words =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
       round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  // callee_locals and max_stack are counts, not the size in frame.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  const int locals_size =
5419
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
    89
       round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
f2e8cc8c12ea 6943304: remove tagged stack interpreter
twisti
parents: 5416
diff changeset
    90
  const int max_stack_words = max_stack * Interpreter::stackElementWords;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  return (round_to((max_stack_words
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
                   + rounded_vm_local_words
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
                   + frame::memory_parameter_word_sp_offset), WordsPerLong)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
                   // already rounded
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
                   + locals_size + monitor_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
// How much stack a method top interpreter activation needs in words.
13728
882756847a04 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 13391
diff changeset
    99
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  // See call_stub code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  int call_stub_size  = round_to(7 + frame::memory_parameter_word_sp_offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
                                 WordsPerLong);    // 7 + register save area
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  // Save space for one monitor to get into the interpreted method in case
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // the method is synchronized
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  int monitor_size    = method->is_synchronized() ?
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
                                1*frame::interpreter_frame_monitor_size() : 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
  return size_activation_helper(method->max_locals(), method->max_stack(),
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   110
                                monitor_size) + call_stub_size;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   113
int AbstractInterpreter::size_activation(int max_stack,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   114
                                         int temps,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   115
                                         int extra_args,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   116
                                         int monitors,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   117
                                         int callee_params,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   118
                                         int callee_locals,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   119
                                         bool is_top_frame) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  // Note: This calculation must exactly parallel the frame setup
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
   121
  // in TemplateInterpreterGenerator::generate_fixed_frame.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   123
  int monitor_size           = monitors * frame::interpreter_frame_monitor_size();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   126
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  // Note: if you look closely this appears to be doing something much different
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  // than generate_fixed_frame. What is happening is this. On sparc we have to do
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  // this dance with interpreter_sp_adjustment because the window save area would
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  // appear just below the bottom (tos) of the caller's java expression stack. Because
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  // the interpreter want to have the locals completely contiguous generate_fixed_frame
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  // will adjust the caller's sp for the "extra locals" (max_locals - parameter_size).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  // Now in generate_fixed_frame the extension of the caller's sp happens in the callee.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  // In this code the opposite occurs the caller adjusts it's own stack base on the callee.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  // This is mostly ok but it does cause a problem when we get to the initial frame (the oldest)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  // because the oldest frame would have adjust its callers frame and yet that frame
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // already exists and isn't part of this array of frames we are unpacking. So at first
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // glance this would seem to mess up that frame. However Deoptimization::fetch_unroll_info_helper()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  // will after it calculates all of the frame's on_stack_size()'s will then figure out the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  // amount to adjust the caller of the initial (oldest) frame and the calculation will all
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  // add up. It does seem like it simpler to account for the adjustment here (and remove the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  // callee... parameters here). However this would mean that this routine would have to take
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  // the caller frame as input so we could adjust its sp (and set it's interpreter_sp_adjustment)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  // and run the calling loop in the reverse order. This would also would appear to mean making
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // this code aware of what the interactions are when that initial caller fram was an osr or
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  // other adapter frame. deoptimization is complicated enough and  hard enough to debug that
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  // there is no sense in messing working code.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   151
  int rounded_cls = round_to((callee_locals - callee_params), WordsPerLong);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  assert(rounded_cls == round_to(rounded_cls, WordsPerLong), "must align");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   154
  int raw_frame_size = size_activation_helper(rounded_cls, max_stack, monitor_size);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   156
  return raw_frame_size;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   157
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   159
void AbstractInterpreter::layout_activation(Method* method,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   160
                                            int tempcount,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   161
                                            int popframe_extra_args,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   162
                                            int moncount,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   163
                                            int caller_actual_parameters,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   164
                                            int callee_param_count,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   165
                                            int callee_local_count,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   166
                                            frame* caller,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   167
                                            frame* interpreter_frame,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   168
                                            bool is_top_frame,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   169
                                            bool is_bottom_frame) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   170
  // Set up the following variables:
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   171
  //   - Lmethod
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   172
  //   - Llocals
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   173
  //   - Lmonitors (to the indicated number of monitors)
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   174
  //   - Lesp (to the indicated number of temps)
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   175
  // The frame caller on entry is a description of the caller of the
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   176
  // frame we are about to layout. We are guaranteed that we will be
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   177
  // able to fill in a new interpreter frame as its callee (i.e. the
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   178
  // stack space is allocated and the amount was determined by an
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   179
  // earlier call to the size_activation() method).  On return caller
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   180
  // while describe the interpreter frame we just layed out.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   182
  // The skeleton frame must already look like an interpreter frame
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   183
  // even if not fully filled out.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   184
  assert(interpreter_frame->is_interpreted_frame(), "Must be interpreted frame");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   185
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   186
  int rounded_vm_local_words = round_to(frame::interpreter_frame_vm_local_words,WordsPerLong);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   187
  int monitor_size           = moncount * frame::interpreter_frame_monitor_size();
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   188
  assert(monitor_size == round_to(monitor_size, WordsPerLong), "must align");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   189
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   190
  intptr_t* fp = interpreter_frame->fp();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   192
  JavaThread* thread = JavaThread::current();
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   193
  RegisterMap map(thread, false);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   194
  // More verification that skeleton frame is properly walkable
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   195
  assert(fp == caller->sp(), "fp must match");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   196
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   197
  intptr_t* montop     = fp - rounded_vm_local_words;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   198
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   199
  // preallocate monitors (cf. __ add_monitor_to_stack)
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   200
  intptr_t* monitors = montop - monitor_size;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   201
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   202
  // preallocate stack space
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   203
  intptr_t*  esp = monitors - 1 -
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   204
    (tempcount * Interpreter::stackElementWords) -
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   205
    popframe_extra_args;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   207
  int local_words = method->max_locals() * Interpreter::stackElementWords;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   208
  NEEDS_CLEANUP;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   209
  intptr_t* locals;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   210
  if (caller->is_interpreted_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   211
    // Can force the locals area to end up properly overlapping the top of the expression stack.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   212
    intptr_t* Lesp_ptr = caller->interpreter_frame_tos_address() - 1;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   213
    // Note that this computation means we replace size_of_parameters() values from the caller
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   214
    // interpreter frame's expression stack with our argument locals
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   215
    int parm_words  = caller_actual_parameters * Interpreter::stackElementWords;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   216
    locals = Lesp_ptr + parm_words;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   217
    int delta = local_words - parm_words;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   218
    int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   219
    *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   220
    if (!is_bottom_frame) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   221
      // Llast_SP is set below for the current frame to SP (with the
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   222
      // extra space for the callee's locals). Here we adjust
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   223
      // Llast_SP for the caller's frame, removing the extra space
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   224
      // for the current method's locals.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   225
      *caller->register_addr(Llast_SP) = *interpreter_frame->register_addr(I5_savedSP);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    } else {
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   227
      assert(*caller->register_addr(Llast_SP) >= *interpreter_frame->register_addr(I5_savedSP), "strange Llast_SP");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   228
    }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   229
  } else {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   230
    assert(caller->is_compiled_frame() || caller->is_entry_frame(), "only possible cases");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   231
    // Don't have Lesp available; lay out locals block in the caller
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   232
    // adjacent to the register window save area.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   233
    //
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   234
    // Compiled frames do not allocate a varargs area which is why this if
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   235
    // statement is needed.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   236
    //
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   237
    if (caller->is_compiled_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   238
      locals = fp + frame::register_save_words + local_words - 1;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   239
    } else {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   240
      locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   241
    }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   242
    if (!caller->is_entry_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   243
      // Caller wants his own SP back
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   244
      int caller_frame_size = caller->cb()->frame_size();
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   245
      *interpreter_frame->register_addr(I5_savedSP) = (intptr_t)(caller->fp() - caller_frame_size) - STACK_BIAS;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   246
    }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   247
  }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   248
  if (TraceDeoptimization) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   249
    if (caller->is_entry_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   250
      // make sure I5_savedSP and the entry frames notion of saved SP
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   251
      // agree.  This assertion duplicate a check in entry frame code
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   252
      // but catches the failure earlier.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   253
      assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   254
             "would change callers SP");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   255
    }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   256
    if (caller->is_entry_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   257
      tty->print("entry ");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   258
    }
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   259
    if (caller->is_compiled_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   260
      tty->print("compiled ");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   261
      if (caller->is_deoptimized_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   262
        tty->print("(deopt) ");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    }
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   265
    if (caller->is_interpreted_frame()) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   266
      tty->print("interpreted ");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
    }
24917
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   268
    tty->print_cr("caller fp=" INTPTR_FORMAT " sp=" INTPTR_FORMAT, p2i(caller->fp()), p2i(caller->sp()));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   269
    tty->print_cr("save area = " INTPTR_FORMAT ", " INTPTR_FORMAT, p2i(caller->sp()), p2i(caller->sp() + 16));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   270
    tty->print_cr("save area = " INTPTR_FORMAT ", " INTPTR_FORMAT, p2i(caller->fp()), p2i(caller->fp() + 16));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   271
    tty->print_cr("interpreter fp=" INTPTR_FORMAT ", " INTPTR_FORMAT, p2i(interpreter_frame->fp()), p2i(interpreter_frame->sp()));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   272
    tty->print_cr("save area = " INTPTR_FORMAT ", " INTPTR_FORMAT, p2i(interpreter_frame->sp()), p2i(interpreter_frame->sp() + 16));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   273
    tty->print_cr("save area = " INTPTR_FORMAT ", " INTPTR_FORMAT, p2i(interpreter_frame->fp()), p2i(interpreter_frame->fp() + 16));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   274
    tty->print_cr("Llocals = " INTPTR_FORMAT, p2i(locals));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   275
    tty->print_cr("Lesp = " INTPTR_FORMAT, p2i(esp));
bf961166fa07 8044071: Print format/argument warnings
mikael
parents: 24322
diff changeset
   276
    tty->print_cr("Lmonitors = " INTPTR_FORMAT, p2i(monitors));
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   277
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   279
  if (method->max_locals() > 0) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   280
    assert(locals < caller->sp() || locals >= (caller->sp() + 16), "locals in save area");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   281
    assert(locals < caller->fp() || locals > (caller->fp() + 16), "locals in save area");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   282
    assert(locals < interpreter_frame->sp() || locals > (interpreter_frame->sp() + 16), "locals in save area");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   283
    assert(locals < interpreter_frame->fp() || locals >= (interpreter_frame->fp() + 16), "locals in save area");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   284
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
#ifdef _LP64
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   286
  assert(*interpreter_frame->register_addr(I5_savedSP) & 1, "must be odd");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   289
  *interpreter_frame->register_addr(Lmethod)     = (intptr_t) method;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   290
  *interpreter_frame->register_addr(Llocals)     = (intptr_t) locals;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   291
  *interpreter_frame->register_addr(Lmonitors)   = (intptr_t) monitors;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   292
  *interpreter_frame->register_addr(Lesp)        = (intptr_t) esp;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   293
  // Llast_SP will be same as SP as there is no adapter space
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   294
  *interpreter_frame->register_addr(Llast_SP)    = (intptr_t) interpreter_frame->sp() - STACK_BIAS;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   295
  *interpreter_frame->register_addr(LcpoolCache) = (intptr_t) method->constants()->cache();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
#ifdef FAST_DISPATCH
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   297
  *interpreter_frame->register_addr(IdispatchTables) = (intptr_t) Interpreter::dispatch_table();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
#ifdef ASSERT
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   302
  BasicObjectLock* mp = (BasicObjectLock*)monitors;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   304
  assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   305
  assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   306
  assert(interpreter_frame->interpreter_frame_monitor_end()   == mp, "monitor_end matches");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   307
  assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   308
  assert(interpreter_frame->interpreter_frame_tos_address()-1 == esp, "esp matches");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   309
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   310
  // check bounds
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   311
  intptr_t* lo = interpreter_frame->sp() + (frame::memory_parameter_word_sp_offset - 1);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   312
  intptr_t* hi = interpreter_frame->fp() - rounded_vm_local_words;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   313
  assert(lo < monitors && montop <= hi, "monitors in bounds");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23844
diff changeset
   314
  assert(lo <= esp && esp < monitors, "esp in bounds");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
#endif // ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
}