src/cpu/zero/vm/frame_zero.inline.hpp

Fri, 12 Feb 2010 10:34:11 -0800

author
kvn
date
Fri, 12 Feb 2010 10:34:11 -0800
changeset 1691
c09ee209b65c
parent 1445
354d3184f6b2
child 1860
0c5b3cf3c1f5
permissions
-rw-r--r--

6926048: Improve Zero performance
Summary: Make Zero figure out result types in a similar way to C++ interpreter implementation.
Reviewed-by: kvn
Contributed-by: gbenson@redhat.com

     1 /*
     2  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
     3  * Copyright 2007, 2008, 2009 Red Hat, Inc.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     8  * published by the Free Software Foundation.
     9  *
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    13  * version 2 for more details (a copy is included in the LICENSE file that
    14  * accompanied this code).
    15  *
    16  * You should have received a copy of the GNU General Public License version
    17  * 2 along with this work; if not, write to the Free Software Foundation,
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    19  *
    20  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    21  * CA 95054 USA or visit www.sun.com if you need additional information or
    22  * have any questions.
    23  *
    24  */
    26 // Constructors
    28 inline frame::frame() {
    29   _sp = NULL;
    30   _fp = NULL;
    31   _pc = NULL;
    32   _cb = NULL;
    33   _deopt_state = unknown;
    34 }
    36 inline frame::frame(intptr_t* sp, intptr_t* fp) {
    37   _sp = sp;
    38   _fp = fp;
    39   switch (zeroframe()->type()) {
    40   case ZeroFrame::ENTRY_FRAME:
    41     _pc = StubRoutines::call_stub_return_pc();
    42     _cb = NULL;
    43     break;
    45   case ZeroFrame::INTERPRETER_FRAME:
    46     _pc = NULL;
    47     _cb = NULL;
    48     break;
    50   case ZeroFrame::SHARK_FRAME:
    51     _pc = zero_sharkframe()->pc();
    52     _cb = CodeCache::find_blob_unsafe(pc());
    53     break;
    55   case ZeroFrame::FAKE_STUB_FRAME:
    56     _pc = NULL;
    57     _cb = NULL;
    58     break;
    60   default:
    61     ShouldNotReachHere();
    62   }
    63   _deopt_state = not_deoptimized;
    64 }
    66 // Accessors
    68 inline intptr_t* frame::sender_sp() const {
    69   return (intptr_t *) zeroframe()->next();
    70 }
    72 inline intptr_t* frame::link() const {
    73   ShouldNotCallThis();
    74 }
    76 #ifdef CC_INTERP
    77 inline interpreterState frame::get_interpreterState() const {
    78   return zero_interpreterframe()->interpreter_state();
    79 }
    81 inline intptr_t** frame::interpreter_frame_locals_addr() const {
    82   return &(get_interpreterState()->_locals);
    83 }
    85 inline intptr_t* frame::interpreter_frame_bcx_addr() const {
    86   return (intptr_t*) &(get_interpreterState()->_bcp);
    87 }
    89 inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
    90   return &(get_interpreterState()->_constants);
    91 }
    93 inline methodOop* frame::interpreter_frame_method_addr() const {
    94   return &(get_interpreterState()->_method);
    95 }
    97 inline intptr_t* frame::interpreter_frame_mdx_addr() const {
    98   return (intptr_t*) &(get_interpreterState()->_mdx);
    99 }
   101 inline intptr_t* frame::interpreter_frame_tos_address() const {
   102   return get_interpreterState()->_stack + 1;
   103 }
   104 #endif // CC_INTERP
   106 inline int frame::interpreter_frame_monitor_size() {
   107   return BasicObjectLock::size();
   108 }
   110 inline intptr_t* frame::interpreter_frame_expression_stack() const {
   111   intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
   112   return monitor_end - 1;
   113 }
   115 inline jint frame::interpreter_frame_expression_stack_direction() {
   116   return -1;
   117 }
   119 // Return a unique id for this frame. The id must have a value where
   120 // we can distinguish identity and younger/older relationship. NULL
   121 // represents an invalid (incomparable) frame.
   122 inline intptr_t* frame::id() const {
   123   return sp();
   124 }
   126 inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
   127   return zero_entryframe()->call_wrapper();
   128 }
   130 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
   131   ShouldNotCallThis();
   132 }
   134 inline oop frame::saved_oop_result(RegisterMap* map) const {
   135   ShouldNotCallThis();
   136 }
   138 inline bool frame::is_older(intptr_t* id) const {
   139   ShouldNotCallThis();
   140 }
   142 inline intptr_t* frame::entry_frame_argument_at(int offset) const {
   143   ShouldNotCallThis();
   144 }
   146 inline intptr_t* frame::unextended_sp() const {
   147   if (zeroframe()->is_shark_frame())
   148     return zero_sharkframe()->unextended_sp();
   149   else
   150     return (intptr_t *) -1;
   151 }

mercurial