hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp
author bdelsart
Tue, 24 Jan 2012 15:41:17 +0100
changeset 11565 713a0398ca58
parent 10983 9ab65f4cec18
child 11571 23f825a42a85
permissions -rw-r--r--
7120450: complete information dumped by frame_describe Summary: improvements of frame_describe Reviewed-by: never, twisti
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     1
/*
11565
713a0398ca58 7120450: complete information dumped by frame_describe
bdelsart
parents: 10983
diff changeset
     2
 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     4
 *
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     8
 *
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    13
 * accompanied this code).
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    14
 *
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    18
 *
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    21
 * questions.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    22
 *
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    23
 */
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    24
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    25
// Platform-specific definitions for method handles.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    26
// These definitions are inlined into class MethodHandles.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    27
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    28
// Adapters
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    29
enum /* platform_dependent_constants */ {
10983
9ab65f4cec18 7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents: 10031
diff changeset
    30
  adapter_code_size = NOT_LP64(23000 DEBUG_ONLY(+ 40000)) LP64_ONLY(35000 DEBUG_ONLY(+ 50000))
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    31
};
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    32
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    33
public:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    34
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    35
class RicochetFrame : public ResourceObj {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    36
  friend class MethodHandles;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    37
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    38
 private:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    39
  /*
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    40
    RF field            x86                 SPARC
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    41
    sender_pc           *(rsp+0)            I7-0x8
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    42
    sender_link         rbp                 I6+BIAS
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    43
    exact_sender_sp     rsi/r13             I5_savedSP
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    44
    conversion          *(rcx+&amh_conv)    L5_conv
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    45
    saved_args_base     rax                 L4_sab (cf. Gargs = G4)
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    46
    saved_args_layout   #NULL               L3_sal
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    47
    saved_target        *(rcx+&mh_vmtgt)    L2_stgt
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    48
    continuation        #STUB_CON           L1_cont
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    49
   */
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    50
  static const Register L1_continuation     ;  // what to do when control gets back here
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    51
  static const Register L2_saved_target     ;  // target method handle to invoke on saved_args
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    52
  static const Register L3_saved_args_layout;  // caching point for MethodTypeForm.vmlayout cookie
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    53
  static const Register L4_saved_args_base  ;  // base of pushed arguments (slot 0, arg N) (-3)
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    54
  static const Register L5_conversion       ;  // misc. information from original AdapterMethodHandle (-2)
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    55
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    56
  frame _fr;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    57
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    58
  RicochetFrame(const frame& fr) : _fr(fr) { }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    59
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    60
  intptr_t* register_addr(Register reg) const  {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    61
    assert((_fr.sp() + reg->sp_offset_in_saved_window()) == _fr.register_addr(reg), "must agree");
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    62
    return _fr.register_addr(reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    63
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    64
  intptr_t  register_value(Register reg) const { return *register_addr(reg); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    65
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    66
 public:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    67
  intptr_t* continuation() const        { return (intptr_t*) register_value(L1_continuation); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    68
  oop       saved_target() const        { return (oop)       register_value(L2_saved_target); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    69
  oop       saved_args_layout() const   { return (oop)       register_value(L3_saved_args_layout); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    70
  intptr_t* saved_args_base() const     { return (intptr_t*) register_value(L4_saved_args_base); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    71
  intptr_t  conversion() const          { return             register_value(L5_conversion); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    72
  intptr_t* exact_sender_sp() const     { return (intptr_t*) register_value(I5_savedSP); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    73
  intptr_t* sender_link() const         { return _fr.sender_sp(); }  // XXX
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    74
  address   sender_pc() const           { return _fr.sender_pc(); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    75
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    76
  // This value is not used for much, but it apparently must be nonzero.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    77
  static int frame_size_in_bytes()              { return wordSize * 4; }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    78
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    79
  intptr_t* extended_sender_sp() const  { return saved_args_base(); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    80
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    81
  intptr_t  return_value_slot_number() const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    82
    return adapter_conversion_vminfo(conversion());
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    83
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    84
  BasicType return_value_type() const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    85
    return adapter_conversion_dest_type(conversion());
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    86
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    87
  bool has_return_value_slot() const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    88
    return return_value_type() != T_VOID;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    89
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    90
  intptr_t* return_value_slot_addr() const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    91
    assert(has_return_value_slot(), "");
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    92
    return saved_arg_slot_addr(return_value_slot_number());
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    93
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    94
  intptr_t* saved_target_slot_addr() const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    95
    return saved_arg_slot_addr(saved_args_length());
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    96
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    97
  intptr_t* saved_arg_slot_addr(int slot) const {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    98
    assert(slot >= 0, "");
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
    99
    return (intptr_t*)( (address)saved_args_base() + (slot * Interpreter::stackElementSize) );
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   100
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   101
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   102
  jint      saved_args_length() const;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   103
  jint      saved_arg_offset(int arg) const;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   104
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   105
  // GC interface
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   106
  oop*  saved_target_addr()                     { return (oop*)register_addr(L2_saved_target); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   107
  oop*  saved_args_layout_addr()                { return (oop*)register_addr(L3_saved_args_layout); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   108
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   109
  oop  compute_saved_args_layout(bool read_cache, bool write_cache);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   110
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   111
#ifdef ASSERT
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   112
  // The magic number is supposed to help find ricochet frames within the bytes of stack dumps.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   113
  enum { MAGIC_NUMBER_1 = 0xFEED03E, MAGIC_NUMBER_2 = 0xBEEF03E };
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   114
  static const Register L0_magic_number_1   ;  // cookie for debugging, at start of RSA
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   115
  static Address magic_number_2_addr()  { return Address(L4_saved_args_base, -wordSize); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   116
  intptr_t magic_number_1() const       { return register_value(L0_magic_number_1); }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   117
  intptr_t magic_number_2() const       { return saved_args_base()[-1]; }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   118
#endif //ASSERT
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   119
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   120
 public:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   121
  enum { RETURN_VALUE_PLACEHOLDER = (NOT_DEBUG(0) DEBUG_ONLY(42)) };
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   122
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   123
  void verify() const NOT_DEBUG_RETURN; // check for MAGIC_NUMBER, etc.
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   124
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   125
  static void generate_ricochet_blob(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   126
                                     // output params:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   127
                                     int* bounce_offset,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   128
                                     int* exception_offset,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   129
                                     int* frame_size_in_words);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   130
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   131
  static void enter_ricochet_frame(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   132
                                   Register recv_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   133
                                   Register argv_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   134
                                   address return_handler);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   135
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   136
  static void leave_ricochet_frame(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   137
                                   Register recv_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   138
                                   Register new_sp_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   139
                                   Register sender_pc_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   140
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   141
  static RicochetFrame* from_frame(const frame& fr) {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   142
    RicochetFrame* rf = new RicochetFrame(fr);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   143
    rf->verify();
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   144
    return rf;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   145
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   146
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   147
  static void verify_clean(MacroAssembler* _masm) NOT_DEBUG_RETURN;
11565
713a0398ca58 7120450: complete information dumped by frame_describe
bdelsart
parents: 10983
diff changeset
   148
713a0398ca58 7120450: complete information dumped by frame_describe
bdelsart
parents: 10983
diff changeset
   149
  static void describe(const frame* fr, FrameValues& values, int frame_no) NOT_DEBUG_RETURN;
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   150
};
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   151
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   152
// Additional helper methods for MethodHandles code generation:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   153
public:
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   154
  static void load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   155
  static void load_conversion_vminfo(MacroAssembler* _masm, Address conversion_field_addr, Register reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   156
  static void extract_conversion_vminfo(MacroAssembler* _masm, Register conversion_field_reg, Register reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   157
  static void extract_conversion_dest_type(MacroAssembler* _masm, Register conversion_field_reg, Register reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   158
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   159
  static void load_stack_move(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   160
                              Address G3_amh_conversion,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   161
                              Register G5_stack_move);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   162
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   163
  static void insert_arg_slots(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   164
                               RegisterOrConstant arg_slots,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   165
                               Register argslot_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   166
                               Register temp_reg, Register temp2_reg, Register temp3_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   167
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   168
  static void remove_arg_slots(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   169
                               RegisterOrConstant arg_slots,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   170
                               Register argslot_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   171
                               Register temp_reg, Register temp2_reg, Register temp3_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   172
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   173
  static void push_arg_slots(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   174
                             Register argslot_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   175
                             RegisterOrConstant slot_count,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   176
                             Register temp_reg, Register temp2_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   177
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   178
  static void move_arg_slots_up(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   179
                                Register bottom_reg,  // invariant
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   180
                                Address  top_addr,    // can use temp_reg
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   181
                                RegisterOrConstant positive_distance_in_slots,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   182
                                Register temp_reg, Register temp2_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   183
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   184
  static void move_arg_slots_down(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   185
                                  Address  bottom_addr,  // can use temp_reg
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   186
                                  Register top_reg,      // invariant
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   187
                                  RegisterOrConstant negative_distance_in_slots,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   188
                                  Register temp_reg, Register temp2_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   189
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   190
  static void move_typed_arg(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   191
                             BasicType type, bool is_element,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   192
                             Address value_src, Address slot_dest,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   193
                             Register temp_reg);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   194
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   195
  static void move_return_value(MacroAssembler* _masm, BasicType type,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   196
                                Address return_slot);
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   197
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   198
  static void verify_argslot(MacroAssembler* _masm, Register argslot_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   199
                             Register temp_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   200
                             const char* error_message) NOT_DEBUG_RETURN;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   201
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   202
  static void verify_argslots(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   203
                              RegisterOrConstant argslot_count,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   204
                              Register argslot_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   205
                              Register temp_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   206
                              Register temp2_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   207
                              bool negate_argslot,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   208
                              const char* error_message) NOT_DEBUG_RETURN;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   209
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   210
  static void verify_stack_move(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   211
                                RegisterOrConstant arg_slots,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   212
                                int direction) NOT_DEBUG_RETURN;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   213
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   214
  static void verify_klass(MacroAssembler* _masm,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   215
                           Register obj_reg, KlassHandle klass,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   216
                           Register temp_reg, Register temp2_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   217
                           const char* error_message = "wrong klass") NOT_DEBUG_RETURN;
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   218
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   219
  static void verify_method_handle(MacroAssembler* _masm, Register mh_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   220
                                   Register temp_reg, Register temp2_reg) {
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   221
    verify_klass(_masm, mh_reg, SystemDictionaryHandles::MethodHandle_klass(),
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   222
                 temp_reg, temp2_reg,
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   223
                 "reference is a MH");
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   224
  }
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   225
10031
e81ae8b523dc 6990212: JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods
never
parents: 9976
diff changeset
   226
  // Similar to InterpreterMacroAssembler::jump_from_interpreted.
e81ae8b523dc 6990212: JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods
never
parents: 9976
diff changeset
   227
  // Takes care of special dispatch from single stepping too.
e81ae8b523dc 6990212: JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods
never
parents: 9976
diff changeset
   228
  static void jump_from_method_handle(MacroAssembler* _masm, Register method, Register temp, Register temp2);
e81ae8b523dc 6990212: JSR 292 JVMTI MethodEnter hook is not called for JSR 292 bootstrap and target methods
never
parents: 9976
diff changeset
   229
9976
6fef34e63df1 7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
diff changeset
   230
  static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;