hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
changeset 5419 f2e8cc8c12ea
parent 1 489c9b5090e2
child 5547 f4b087cbb361
equal deleted inserted replaced
5418:c4955cb6ed33 5419:f2e8cc8c12ea
     1 /*
     1 /*
     2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25  public:
    25  public:
    26 
    26 
    27   // Support for Tagged Stacks
    27   static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; }
    28 
    28 
    29   // Stack index relative to tos (which points at value)
    29   // Stack index relative to tos (which points at value)
    30   static int expr_index_at(int i)     {
    30   static int expr_index_at(int i)        { return stackElementWords * i; }
    31     return stackElementWords() * i;
       
    32   }
       
    33 
       
    34   static int expr_tag_index_at(int i) {
       
    35     assert(TaggedStackInterpreter, "should not call this");
       
    36     // tag is one word above java stack element
       
    37     return stackElementWords() * i + 1;
       
    38   }
       
    39 
       
    40   static int expr_offset_in_bytes(int i) { return stackElementSize()*i + wordSize; }
       
    41   static int expr_tag_offset_in_bytes (int i) {
       
    42     assert(TaggedStackInterpreter, "should not call this");
       
    43     return expr_offset_in_bytes(i) + wordSize;
       
    44   }
       
    45 
    31 
    46   // Already negated by c++ interpreter
    32   // Already negated by c++ interpreter
    47   static int local_index_at(int i)     {
    33   static int local_index_at(int i) {
    48     assert(i<=0, "local direction already negated");
    34     assert(i <= 0, "local direction already negated");
    49     return stackElementWords() * i + (value_offset_in_bytes()/wordSize);
    35     return stackElementWords * i;
    50   }
    36   }
    51 
       
    52   static int local_tag_index_at(int i) {
       
    53     assert(i<=0, "local direction already negated");
       
    54     assert(TaggedStackInterpreter, "should not call this");
       
    55     return stackElementWords() * i + (tag_offset_in_bytes()/wordSize);
       
    56   }