hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp
author goetz
Thu, 21 Jan 2016 12:37:47 +0100
changeset 35594 cc13089c6327
parent 35232 76aed99c0ddd
permissions -rw-r--r--
8147937: Adapt SAP copyrights to new company name. Reviewed-by: simonis, stuefe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     1
/*
30303
c703c89fddbf 8077838: Recent developments for ppc.
goetz
parents: 28472
diff changeset
     2
 * Copyright (c) 2014, 2015, 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) 2015 SAP SE. All rights reserved.
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     5
 *
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     6
 * This code is free software; you can redistribute it and/or modify it
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     7
 * under the terms of the GNU General Public License version 2 only, as
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     8
 * published by the Free Software Foundation.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
     9
 *
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    14
 * accompanied this code).
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    15
 *
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    19
 *
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    22
 * questions.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    23
 *
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    24
 */
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    25
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    26
#include "precompiled.hpp"
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    27
#include "interpreter/interpreter.hpp"
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    28
#include "oops/constMethod.hpp"
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    29
#include "oops/method.hpp"
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    30
#include "runtime/frame.inline.hpp"
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    31
#include "utilities/debug.hpp"
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    32
#include "utilities/macros.hpp"
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
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
int TemplateInterpreter::InterpreterCodeSize = 230*K;
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    40
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    41
int AbstractInterpreter::BasicType_as_index(BasicType type) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    42
  int i = 0;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    43
  switch (type) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    44
    case T_BOOLEAN: i = 0; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    45
    case T_CHAR   : i = 1; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    46
    case T_BYTE   : i = 2; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    47
    case T_SHORT  : i = 3; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    48
    case T_INT    : i = 4; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    49
    case T_LONG   : i = 5; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    50
    case T_VOID   : i = 6; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    51
    case T_FLOAT  : i = 7; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    52
    case T_DOUBLE : i = 8; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    53
    case T_OBJECT : i = 9; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    54
    case T_ARRAY  : i = 9; break;
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    55
    default       : ShouldNotReachHere();
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    56
  }
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    57
  assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds");
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    58
  return i;
31861
7efea6fae96b 8131048: ppc: implement CRC32 intrinsic
goetz
parents: 30303
diff changeset
    59
}
7efea6fae96b 8131048: ppc: implement CRC32 intrinsic
goetz
parents: 30303
diff changeset
    60
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    61
// These should never be compiled since the interpreter will prefer
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    62
// the compiled version to the intrinsic version.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    63
bool AbstractInterpreter::can_be_compiled(methodHandle m) {
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
    64
  return !TemplateInterpreter::math_entry_available(method_kind(m));
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    65
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    66
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    67
// How much stack a method activation needs in stack slots.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    68
// We must calc this exactly like in generate_fixed_frame.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    69
// Note: This returns the conservative size assuming maximum alignment.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    70
int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    71
  const int max_alignment_size = 2;
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    72
  const int abi_scratch = frame::abi_reg_args_size;
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    73
  return method->max_locals() + method->max_stack() +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    74
         frame::interpreter_frame_monitor_size() + max_alignment_size + abi_scratch;
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    75
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
    76
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    77
// Returns number of stackElementWords needed for the interpreter frame with the
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    78
// given sections.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    79
// This overestimates the stack by one slot in case of alignments.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    80
int AbstractInterpreter::size_activation(int max_stack,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    81
                                         int temps,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    82
                                         int extra_args,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    83
                                         int monitors,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    84
                                         int callee_params,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    85
                                         int callee_locals,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    86
                                         bool is_top_frame) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    87
  // Note: This calculation must exactly parallel the frame setup
35214
d86005e0b4c2 8074457: Remove the non-Zero CPP Interpreter
coleenp
parents: 34651
diff changeset
    88
  // in TemplateInterpreterGenerator::generate_fixed_frame.
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    89
  assert(Interpreter::stackElementWords == 1, "sanity");
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    90
  const int max_alignment_space = StackAlignmentInBytes / Interpreter::stackElementSize;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    91
  const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    92
                                         (frame::abi_minframe_size / Interpreter::stackElementSize);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    93
  const int size =
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    94
    max_stack                                                +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    95
    (callee_locals - callee_params)                          +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    96
    monitors * frame::interpreter_frame_monitor_size()       +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    97
    max_alignment_space                                      +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    98
    abi_scratch                                              +
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
    99
    frame::ijava_state_size / Interpreter::stackElementSize;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   100
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   101
  // Fixed size of an interpreter frame, align to 16-byte.
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   102
  return (size & -2);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   103
}
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   104
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   105
// Fills a sceletal interpreter frame generated during deoptimizations.
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   106
//
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   107
// Parameters:
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   108
//
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   109
// interpreter_frame != NULL:
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   110
//   set up the method, locals, and monitors.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   111
//   The frame interpreter_frame, if not NULL, is guaranteed to be the
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   112
//   right size, as determined by a previous call to this method.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   113
//   It is also guaranteed to be walkable even though it is in a skeletal state
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   114
//
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   115
// is_top_frame == true:
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   116
//   We're processing the *oldest* interpreter frame!
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   117
//
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   118
// pop_frame_extra_args:
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   119
//   If this is != 0 we are returning to a deoptimized frame by popping
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   120
//   off the callee frame. We want to re-execute the call that called the
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   121
//   callee interpreted, but since the return to the interpreter would pop
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   122
//   the arguments off advance the esp by dummy popframe_extra_args slots.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   123
//   Popping off those will establish the stack layout as it was before the call.
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   124
//
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   125
void AbstractInterpreter::layout_activation(Method* method,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   126
                                            int tempcount,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   127
                                            int popframe_extra_args,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   128
                                            int moncount,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   129
                                            int caller_actual_parameters,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   130
                                            int callee_param_count,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   131
                                            int callee_locals_count,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   132
                                            frame* caller,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   133
                                            frame* interpreter_frame,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   134
                                            bool is_top_frame,
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   135
                                            bool is_bottom_frame) {
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   136
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   137
  const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) :
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   138
                                         (frame::abi_minframe_size / Interpreter::stackElementSize);
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   139
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   140
  intptr_t* locals_base  = (caller->is_interpreted_frame()) ?
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   141
    caller->interpreter_frame_esp() + caller_actual_parameters :
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents: 33070
diff changeset
   142
    caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize);
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   143
35085
839c8ba29724 8144019: PPC64 C1: Introduce Client Compiler
mdoerr
parents: 33070
diff changeset
   144
  intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize;
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   145
  intptr_t* monitor      = monitor_base - (moncount * frame::interpreter_frame_monitor_size());
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   146
  intptr_t* esp_base     = monitor - 1;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   147
  intptr_t* esp          = esp_base - tempcount - popframe_extra_args;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   148
  intptr_t* sp           = (intptr_t *) (((intptr_t) (esp_base - callee_locals_count + callee_param_count - method->max_stack()- abi_scratch)) & -StackAlignmentInBytes);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   149
  intptr_t* sender_sp    = caller->sp() + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   150
  intptr_t* top_frame_sp = is_top_frame ? sp : sp + (frame::abi_minframe_size - frame::abi_reg_args_size) / Interpreter::stackElementSize;
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   151
24018
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   152
  interpreter_frame->interpreter_frame_set_method(method);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   153
  interpreter_frame->interpreter_frame_set_locals(locals_base);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   154
  interpreter_frame->interpreter_frame_set_cpcache(method->constants()->cache());
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   155
  interpreter_frame->interpreter_frame_set_esp(esp);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   156
  interpreter_frame->interpreter_frame_set_monitor_end((BasicObjectLock *)monitor);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   157
  interpreter_frame->interpreter_frame_set_top_frame_sp(top_frame_sp);
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   158
  if (!is_bottom_frame) {
77b156916bab 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents: 23522
diff changeset
   159
    interpreter_frame->interpreter_frame_set_sender_sp(sender_sp);
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   160
  }
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   161
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   162
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   163
// Support abs and sqrt like in compiler.
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   164
// For others we can use a normal (native) entry.
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   165
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   166
bool TemplateInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) {
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   167
  if (!InlineIntrinsics) return false;
24349
d8f40e5b392d 8042309: Some bugfixes for the ppc64 port.
goetz
parents: 24018
diff changeset
   168
34651
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   169
  return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) ||
07b1cc0f6040 8144534: Refactor templateInterpreter and templateInterpreterGenerator functions
coleenp
parents: 33070
diff changeset
   170
          (kind==Interpreter::java_lang_math_abs));
23221
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   171
}
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   172
b70675ece1ce 8036976: PPC64: implement the template interpreter
goetz
parents:
diff changeset
   173