Mercurial > hg > graal-compiler
comparison src/cpu/sparc/vm/interpreterRT_sparc.cpp @ 727:6b2273dd6fa9
6822110: Add AddressLiteral class on SPARC
Summary: The Address class on SPARC currently handles both, addresses and address literals, what makes the Address class more complicated than it has to be.
Reviewed-by: never, kvn
author | twisti |
---|---|
date | Tue, 21 Apr 2009 11:16:30 -0700 |
parents | a61af66fc99e |
children | 2338d41fbd81 |
comparison
equal
deleted
inserted
replaced
725:928912ce8438 | 727:6b2273dd6fa9 |
---|---|
1 /* | 1 /* |
2 * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1998-2009 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. |
103 Register Rtmp3 = G3_scratch; | 103 Register Rtmp3 = G3_scratch; |
104 | 104 |
105 // the handle for a receiver will never be null | 105 // the handle for a receiver will never be null |
106 bool do_NULL_check = offset() != 0 || is_static(); | 106 bool do_NULL_check = offset() != 0 || is_static(); |
107 | 107 |
108 Address h_arg = Address(Llocals, 0, Interpreter::local_offset_in_bytes(offset())); | 108 Address h_arg = Address(Llocals, Interpreter::local_offset_in_bytes(offset())); |
109 __ ld_ptr(h_arg, Rtmp1); | 109 __ ld_ptr(h_arg, Rtmp1); |
110 #ifdef ASSERT | 110 #ifdef ASSERT |
111 if (TaggedStackInterpreter) { | 111 if (TaggedStackInterpreter) { |
112 // check we have the obj and not the tag | 112 // check we have the obj and not the tag |
113 Label ok; | 113 Label ok; |
118 __ stop("Native object passed tag by mistake"); | 118 __ stop("Native object passed tag by mistake"); |
119 __ bind(ok); | 119 __ bind(ok); |
120 } | 120 } |
121 #endif // ASSERT | 121 #endif // ASSERT |
122 if (!do_NULL_check) { | 122 if (!do_NULL_check) { |
123 __ add(h_arg, Rtmp2); | 123 __ add(h_arg.base(), h_arg.disp(), Rtmp2); |
124 } else { | 124 } else { |
125 if (Rtmp1 == Rtmp2) | 125 if (Rtmp1 == Rtmp2) |
126 __ tst(Rtmp1); | 126 __ tst(Rtmp1); |
127 else __ addcc(G0, Rtmp1, Rtmp2); // optimize mov/test pair | 127 else __ addcc(G0, Rtmp1, Rtmp2); // optimize mov/test pair |
128 Label L; | 128 Label L; |
129 __ brx(Assembler::notZero, true, Assembler::pt, L); | 129 __ brx(Assembler::notZero, true, Assembler::pt, L); |
130 __ delayed()->add(h_arg, Rtmp2); | 130 __ delayed()->add(h_arg.base(), h_arg.disp(), Rtmp2); |
131 __ bind(L); | 131 __ bind(L); |
132 } | 132 } |
133 __ store_ptr_argument(Rtmp2, jni_arg); // this is often a no-op | 133 __ store_ptr_argument(Rtmp2, jni_arg); // this is often a no-op |
134 } | 134 } |
135 | 135 |
138 | 138 |
139 // generate code to handle arguments | 139 // generate code to handle arguments |
140 iterate(fingerprint); | 140 iterate(fingerprint); |
141 | 141 |
142 // return result handler | 142 // return result handler |
143 Address result_handler(Lscratch, Interpreter::result_handler(method()->result_type())); | 143 AddressLiteral result_handler(Interpreter::result_handler(method()->result_type())); |
144 __ sethi(result_handler); | 144 __ sethi(result_handler, Lscratch); |
145 __ retl(); | 145 __ retl(); |
146 __ delayed()->add(result_handler, result_handler.base()); | 146 __ delayed()->add(Lscratch, result_handler.low10(), Lscratch); |
147 | 147 |
148 __ flush(); | 148 __ flush(); |
149 } | 149 } |
150 | 150 |
151 | 151 |