hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp
changeset 35214 d86005e0b4c2
parent 30552 ff209a4a81b5
child 37466 287c4ebd11b0
equal deleted inserted replaced
35211:3771329165d4 35214:d86005e0b4c2
    61 
    61 
    62 //    [locals and parameters ]
    62 //    [locals and parameters ]
    63 //                               <- sender sp
    63 //                               <- sender sp
    64 // ------------------------------ Asm interpreter ----------------------------------------
    64 // ------------------------------ Asm interpreter ----------------------------------------
    65 
    65 
    66 // ------------------------------ C++ interpreter ----------------------------------------
       
    67 //
       
    68 // Layout of C++ interpreter frame: (While executing in BytecodeInterpreter::run)
       
    69 //
       
    70 //                             <- SP (current esp/rsp)
       
    71 //    [local variables         ] BytecodeInterpreter::run local variables
       
    72 //    ...                        BytecodeInterpreter::run local variables
       
    73 //    [local variables         ] BytecodeInterpreter::run local variables
       
    74 //    [old frame pointer       ]   fp [ BytecodeInterpreter::run's ebp/rbp ]
       
    75 //    [return pc               ]  (return to frame manager)
       
    76 //    [interpreter_state*      ]  (arg to BytecodeInterpreter::run)   --------------
       
    77 //    [expression stack        ] <- last_Java_sp                           |
       
    78 //    [...                     ] * <- interpreter_state.stack              |
       
    79 //    [expression stack        ] * <- interpreter_state.stack_base         |
       
    80 //    [monitors                ]   \                                       |
       
    81 //     ...                          | monitor block size                   |
       
    82 //    [monitors                ]   / <- interpreter_state.monitor_base     |
       
    83 //    [struct interpretState   ] <-----------------------------------------|
       
    84 //    [return pc               ] (return to callee of frame manager [1]
       
    85 //    [locals and parameters   ]
       
    86 //                               <- sender sp
       
    87 
       
    88 // [1] When the c++ interpreter calls a new method it returns to the frame
       
    89 //     manager which allocates a new frame on the stack. In that case there
       
    90 //     is no real callee of this newly allocated frame. The frame manager is
       
    91 //     aware of the  additional frame(s) and will pop them as nested calls
       
    92 //     complete. Howevers tTo make it look good in the debugger the frame
       
    93 //     manager actually installs a dummy pc pointing to RecursiveInterpreterActivation
       
    94 //     with a fake interpreter_state* parameter to make it easy to debug
       
    95 //     nested calls.
       
    96 
       
    97 // Note that contrary to the layout for the assembly interpreter the
       
    98 // expression stack allocated for the C++ interpreter is full sized.
       
    99 // However this is not as bad as it seems as the interpreter frame_manager
       
   100 // will truncate the unused space on succesive method calls.
       
   101 //
       
   102 // ------------------------------ C++ interpreter ----------------------------------------
       
   103 
       
   104  public:
    66  public:
   105   enum {
    67   enum {
   106     pc_return_offset                                 =  0,
    68     pc_return_offset                                 =  0,
   107     // All frames
    69     // All frames
   108     link_offset                                      =  0,
    70     link_offset                                      =  0,
   109     return_addr_offset                               =  1,
    71     return_addr_offset                               =  1,
   110     sender_sp_offset                                 =  2,
    72     sender_sp_offset                                 =  2,
   111 
       
   112 #ifndef CC_INTERP
       
   113 
    73 
   114     // Interpreter frames
    74     // Interpreter frames
   115     interpreter_frame_oop_temp_offset                =  3, // for native calls only
    75     interpreter_frame_oop_temp_offset                =  3, // for native calls only
   116 
    76 
   117     interpreter_frame_sender_sp_offset               = -1,
    77     interpreter_frame_sender_sp_offset               = -1,
   124     interpreter_frame_bcp_offset                     = interpreter_frame_locals_offset - 1,
    84     interpreter_frame_bcp_offset                     = interpreter_frame_locals_offset - 1,
   125     interpreter_frame_initial_sp_offset              = interpreter_frame_bcp_offset - 1,
    85     interpreter_frame_initial_sp_offset              = interpreter_frame_bcp_offset - 1,
   126 
    86 
   127     interpreter_frame_monitor_block_top_offset       = interpreter_frame_initial_sp_offset,
    87     interpreter_frame_monitor_block_top_offset       = interpreter_frame_initial_sp_offset,
   128     interpreter_frame_monitor_block_bottom_offset    = interpreter_frame_initial_sp_offset,
    88     interpreter_frame_monitor_block_bottom_offset    = interpreter_frame_initial_sp_offset,
   129 
       
   130 #endif // CC_INTERP
       
   131 
    89 
   132     // Entry frames
    90     // Entry frames
   133     // n.b. these values are determined by the layout defined in
    91     // n.b. these values are determined by the layout defined in
   134     // stubGenerator for the Java call stub
    92     // stubGenerator for the Java call stub
   135     entry_frame_after_call_words                     = 27,
    93     entry_frame_after_call_words                     = 27,
   191   intptr_t* interpreter_frame_last_sp() const;
   149   intptr_t* interpreter_frame_last_sp() const;
   192 
   150 
   193   // helper to update a map with callee-saved RBP
   151   // helper to update a map with callee-saved RBP
   194   static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);
   152   static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr);
   195 
   153 
   196 #ifndef CC_INTERP
       
   197   // deoptimization support
   154   // deoptimization support
   198   void interpreter_frame_set_last_sp(intptr_t* sp);
   155   void interpreter_frame_set_last_sp(intptr_t* sp);
   199 #endif // CC_INTERP
       
   200 
       
   201 #ifdef CC_INTERP
       
   202   inline interpreterState get_interpreterState() const;
       
   203 #endif // CC_INTERP
       
   204 
   156 
   205 #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP
   157 #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP