1 /* |
1 /* |
2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 1998-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. |
84 class SlowSignatureHandler: public NativeSignatureIterator { |
84 class SlowSignatureHandler: public NativeSignatureIterator { |
85 private: |
85 private: |
86 address _from; |
86 address _from; |
87 intptr_t* _to; |
87 intptr_t* _to; |
88 |
88 |
89 #ifdef ASSERT |
|
90 void verify_tag(frame::Tag t) { |
|
91 assert(!TaggedStackInterpreter || |
|
92 *(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag"); |
|
93 } |
|
94 #endif // ASSERT |
|
95 |
|
96 virtual void pass_int() { |
89 virtual void pass_int() { |
97 *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); |
90 *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); |
98 debug_only(verify_tag(frame::TagValue)); |
91 _from -= Interpreter::stackElementSize; |
99 _from -= Interpreter::stackElementSize(); |
|
100 } |
92 } |
101 |
93 |
102 virtual void pass_long() { |
94 virtual void pass_long() { |
103 _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); |
95 _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); |
104 _to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0)); |
96 _to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0)); |
105 debug_only(verify_tag(frame::TagValue)); |
|
106 _to += 2; |
97 _to += 2; |
107 _from -= 2*Interpreter::stackElementSize(); |
98 _from -= 2*Interpreter::stackElementSize; |
108 } |
99 } |
109 |
100 |
110 virtual void pass_object() { |
101 virtual void pass_object() { |
111 // pass address of from |
102 // pass address of from |
112 intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0)); |
103 intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0)); |
113 *_to++ = (*(intptr_t*)from_addr == 0) ? NULL_WORD : from_addr; |
104 *_to++ = (*(intptr_t*)from_addr == 0) ? NULL_WORD : from_addr; |
114 debug_only(verify_tag(frame::TagReference)); |
105 _from -= Interpreter::stackElementSize; |
115 _from -= Interpreter::stackElementSize(); |
|
116 } |
106 } |
117 |
107 |
118 public: |
108 public: |
119 SlowSignatureHandler(methodHandle method, address from, intptr_t* to) : |
109 SlowSignatureHandler(methodHandle method, address from, intptr_t* to) : |
120 NativeSignatureIterator(method) { |
110 NativeSignatureIterator(method) { |