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 } |
|