1 /*
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
131 // arraycopy operands aligned on zero'th element boundary
132 // These are identical to the ones aligned aligned on an
133 // element type boundary, except that they assume that both
134 // source and destination are HeapWord aligned.
135 static address _arrayof_jbyte_arraycopy;
136 static address _arrayof_jshort_arraycopy;
137 static address _arrayof_jint_arraycopy;
138 static address _arrayof_jlong_arraycopy;
139 static address _arrayof_oop_arraycopy;
140 static address _arrayof_jbyte_disjoint_arraycopy;
141 static address _arrayof_jshort_disjoint_arraycopy;
142 static address _arrayof_jint_disjoint_arraycopy;
143 static address _arrayof_jlong_disjoint_arraycopy;
144 static address _arrayof_oop_disjoint_arraycopy;
145
146 // these are recommended but optional:
147 static address _checkcast_arraycopy;
148 static address _unsafe_arraycopy;
149 static address _generic_arraycopy;
150
151 public:
152 // Initialization/Testing
153 static void initialize1(); // must happen before universe::genesis
154 static void initialize2(); // must happen after universe::genesis
155
156 static bool contains(address addr) {
157 return
158 (_code1 != NULL && _code1->blob_contains(addr)) ||
159 (_code2 != NULL && _code2->blob_contains(addr)) ;
160 }
161
162 // Debugging
163 static jint verify_oop_count() { return _verify_oop_count; }
164 static jint* verify_oop_count_addr() { return &_verify_oop_count; }
165 // a subroutine for debugging the GC
166 static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; }
167
168 static address catch_exception_entry() { return _catch_exception_entry; }
169
170 // Calls to Java
228 static address jint_disjoint_arraycopy() { return _jint_disjoint_arraycopy; }
229 static address jlong_disjoint_arraycopy() { return _jlong_disjoint_arraycopy; }
230 static address oop_disjoint_arraycopy() { return _oop_disjoint_arraycopy; }
231
232 static address arrayof_jbyte_arraycopy() { return _arrayof_jbyte_arraycopy; }
233 static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
234 static address arrayof_jint_arraycopy() { return _arrayof_jint_arraycopy; }
235 static address arrayof_jlong_arraycopy() { return _arrayof_jlong_arraycopy; }
236 static address arrayof_oop_arraycopy() { return _arrayof_oop_arraycopy; }
237
238 static address arrayof_jbyte_disjoint_arraycopy() { return _arrayof_jbyte_disjoint_arraycopy; }
239 static address arrayof_jshort_disjoint_arraycopy() { return _arrayof_jshort_disjoint_arraycopy; }
240 static address arrayof_jint_disjoint_arraycopy() { return _arrayof_jint_disjoint_arraycopy; }
241 static address arrayof_jlong_disjoint_arraycopy() { return _arrayof_jlong_disjoint_arraycopy; }
242 static address arrayof_oop_disjoint_arraycopy() { return _arrayof_oop_disjoint_arraycopy; }
243
244 static address checkcast_arraycopy() { return _checkcast_arraycopy; }
245 static address unsafe_arraycopy() { return _unsafe_arraycopy; }
246 static address generic_arraycopy() { return _generic_arraycopy; }
247
248 //
249 // Default versions of the above arraycopy functions for platforms which do
250 // not have specialized versions
251 //
252 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count);
253 static void jshort_copy(jshort* src, jshort* dest, size_t count);
254 static void jint_copy (jint* src, jint* dest, size_t count);
255 static void jlong_copy (jlong* src, jlong* dest, size_t count);
256 static void oop_copy (oop* src, oop* dest, size_t count);
257
258 static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
259 static void arrayof_jshort_copy(HeapWord* src, HeapWord* dest, size_t count);
260 static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count);
261 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
262 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count);
263 };
|
1 /*
2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
131 // arraycopy operands aligned on zero'th element boundary
132 // These are identical to the ones aligned aligned on an
133 // element type boundary, except that they assume that both
134 // source and destination are HeapWord aligned.
135 static address _arrayof_jbyte_arraycopy;
136 static address _arrayof_jshort_arraycopy;
137 static address _arrayof_jint_arraycopy;
138 static address _arrayof_jlong_arraycopy;
139 static address _arrayof_oop_arraycopy;
140 static address _arrayof_jbyte_disjoint_arraycopy;
141 static address _arrayof_jshort_disjoint_arraycopy;
142 static address _arrayof_jint_disjoint_arraycopy;
143 static address _arrayof_jlong_disjoint_arraycopy;
144 static address _arrayof_oop_disjoint_arraycopy;
145
146 // these are recommended but optional:
147 static address _checkcast_arraycopy;
148 static address _unsafe_arraycopy;
149 static address _generic_arraycopy;
150
151 // These are versions of the java.lang.Math methods which perform
152 // the same operations as the intrinsic version. They are used for
153 // constant folding in the compiler to ensure equivalence. If the
154 // intrinsic version returns the same result as the strict version
155 // then they can be set to the appropriate function from
156 // SharedRuntime.
157 static double (*_intrinsic_log)(double);
158 static double (*_intrinsic_log10)(double);
159 static double (*_intrinsic_exp)(double);
160 static double (*_intrinsic_pow)(double, double);
161 static double (*_intrinsic_sin)(double);
162 static double (*_intrinsic_cos)(double);
163 static double (*_intrinsic_tan)(double);
164
165 public:
166 // Initialization/Testing
167 static void initialize1(); // must happen before universe::genesis
168 static void initialize2(); // must happen after universe::genesis
169
170 static bool contains(address addr) {
171 return
172 (_code1 != NULL && _code1->blob_contains(addr)) ||
173 (_code2 != NULL && _code2->blob_contains(addr)) ;
174 }
175
176 // Debugging
177 static jint verify_oop_count() { return _verify_oop_count; }
178 static jint* verify_oop_count_addr() { return &_verify_oop_count; }
179 // a subroutine for debugging the GC
180 static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; }
181
182 static address catch_exception_entry() { return _catch_exception_entry; }
183
184 // Calls to Java
242 static address jint_disjoint_arraycopy() { return _jint_disjoint_arraycopy; }
243 static address jlong_disjoint_arraycopy() { return _jlong_disjoint_arraycopy; }
244 static address oop_disjoint_arraycopy() { return _oop_disjoint_arraycopy; }
245
246 static address arrayof_jbyte_arraycopy() { return _arrayof_jbyte_arraycopy; }
247 static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
248 static address arrayof_jint_arraycopy() { return _arrayof_jint_arraycopy; }
249 static address arrayof_jlong_arraycopy() { return _arrayof_jlong_arraycopy; }
250 static address arrayof_oop_arraycopy() { return _arrayof_oop_arraycopy; }
251
252 static address arrayof_jbyte_disjoint_arraycopy() { return _arrayof_jbyte_disjoint_arraycopy; }
253 static address arrayof_jshort_disjoint_arraycopy() { return _arrayof_jshort_disjoint_arraycopy; }
254 static address arrayof_jint_disjoint_arraycopy() { return _arrayof_jint_disjoint_arraycopy; }
255 static address arrayof_jlong_disjoint_arraycopy() { return _arrayof_jlong_disjoint_arraycopy; }
256 static address arrayof_oop_disjoint_arraycopy() { return _arrayof_oop_disjoint_arraycopy; }
257
258 static address checkcast_arraycopy() { return _checkcast_arraycopy; }
259 static address unsafe_arraycopy() { return _unsafe_arraycopy; }
260 static address generic_arraycopy() { return _generic_arraycopy; }
261
262 static double intrinsic_log(double d) {
263 assert(_intrinsic_log != NULL, "must be defined");
264 return _intrinsic_log(d);
265 }
266 static double intrinsic_log10(double d) {
267 assert(_intrinsic_log != NULL, "must be defined");
268 return _intrinsic_log10(d);
269 }
270 static double intrinsic_exp(double d) {
271 assert(_intrinsic_exp != NULL, "must be defined");
272 return _intrinsic_exp(d);
273 }
274 static double intrinsic_pow(double d, double d2) {
275 assert(_intrinsic_pow != NULL, "must be defined");
276 return _intrinsic_pow(d, d2);
277 }
278 static double intrinsic_sin(double d) {
279 assert(_intrinsic_sin != NULL, "must be defined");
280 return _intrinsic_sin(d);
281 }
282 static double intrinsic_cos(double d) {
283 assert(_intrinsic_cos != NULL, "must be defined");
284 return _intrinsic_cos(d);
285 }
286 static double intrinsic_tan(double d) {
287 assert(_intrinsic_tan != NULL, "must be defined");
288 return _intrinsic_tan(d);
289 }
290
291 //
292 // Default versions of the above arraycopy functions for platforms which do
293 // not have specialized versions
294 //
295 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count);
296 static void jshort_copy(jshort* src, jshort* dest, size_t count);
297 static void jint_copy (jint* src, jint* dest, size_t count);
298 static void jlong_copy (jlong* src, jlong* dest, size_t count);
299 static void oop_copy (oop* src, oop* dest, size_t count);
300
301 static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
302 static void arrayof_jshort_copy(HeapWord* src, HeapWord* dest, size_t count);
303 static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count);
304 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
305 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count);
306 };
|