1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)c1_MacroAssembler_sparc.cpp 1.65 07/06/18 14:25:23 JVM"
3 #endif
4 /*
5 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
222 if (!is_simm13(obj_size * wordSize)) {
223 // would need to use extra register to load
224 // object size => go the slow case for now
225 br(Assembler::always, false, Assembler::pt, slow_case);
226 delayed()->nop();
227 return;
228 }
229 try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case);
230
231 initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2);
232 }
233
234 void C1_MacroAssembler::initialize_object(
235 Register obj, // result: pointer to object after successful allocation
236 Register klass, // object klass
237 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
238 int con_size_in_bytes, // object size in bytes if known at compile time
239 Register t1, // temp register
240 Register t2 // temp register
241 ) {
242 const int hdr_size_in_bytes = oopDesc::header_size_in_bytes();
243
244 initialize_header(obj, klass, noreg, t1, t2);
245
246 #ifdef ASSERT
247 {
248 Label ok;
249 ld(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), t1);
250 if (var_size_in_bytes != noreg) {
251 cmp(t1, var_size_in_bytes);
252 } else {
253 cmp(t1, con_size_in_bytes);
254 }
255 brx(Assembler::equal, false, Assembler::pt, ok);
256 delayed()->nop();
257 stop("bad size in initialize_object");
258 should_not_reach_here();
259
260 bind(ok);
261 }
262
|
1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)c1_MacroAssembler_sparc.cpp 1.65 07/06/18 14:25:23 JVM"
3 #endif
4 /*
5 * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
222 if (!is_simm13(obj_size * wordSize)) {
223 // would need to use extra register to load
224 // object size => go the slow case for now
225 br(Assembler::always, false, Assembler::pt, slow_case);
226 delayed()->nop();
227 return;
228 }
229 try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case);
230
231 initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2);
232 }
233
234 void C1_MacroAssembler::initialize_object(
235 Register obj, // result: pointer to object after successful allocation
236 Register klass, // object klass
237 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
238 int con_size_in_bytes, // object size in bytes if known at compile time
239 Register t1, // temp register
240 Register t2 // temp register
241 ) {
242 const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes();
243
244 initialize_header(obj, klass, noreg, t1, t2);
245
246 #ifdef ASSERT
247 {
248 Label ok;
249 ld(klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), t1);
250 if (var_size_in_bytes != noreg) {
251 cmp(t1, var_size_in_bytes);
252 } else {
253 cmp(t1, con_size_in_bytes);
254 }
255 brx(Assembler::equal, false, Assembler::pt, ok);
256 delayed()->nop();
257 stop("bad size in initialize_object");
258 should_not_reach_here();
259
260 bind(ok);
261 }
262
|