1 /*
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2341 }
2342 __ allocate_object(op->obj()->as_register(),
2343 op->tmp1()->as_register(),
2344 op->tmp2()->as_register(),
2345 op->tmp3()->as_register(),
2346 op->header_size(),
2347 op->object_size(),
2348 op->klass()->as_register(),
2349 *op->stub()->entry());
2350 __ bind(*op->stub()->continuation());
2351 __ verify_oop(op->obj()->as_register());
2352 }
2353
2354
2355 void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
2356 assert(op->tmp1()->as_register() == G1 &&
2357 op->tmp2()->as_register() == G3 &&
2358 op->tmp3()->as_register() == G4 &&
2359 op->tmp4()->as_register() == O1 &&
2360 op->klass()->as_register() == G5, "must be");
2361 if (UseSlowPath ||
2362 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
2363 (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
2364 __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
2365 __ delayed()->nop();
2366 } else {
2367 __ allocate_array(op->obj()->as_register(),
2368 op->len()->as_register(),
2369 op->tmp1()->as_register(),
2370 op->tmp2()->as_register(),
2371 op->tmp3()->as_register(),
2372 arrayOopDesc::header_size(op->type()),
2373 type2aelembytes(op->type()),
2374 op->klass()->as_register(),
2375 *op->stub()->entry());
2376 }
2377 __ bind(*op->stub()->continuation());
2378 }
2379
2380
|
1 /*
2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
2341 }
2342 __ allocate_object(op->obj()->as_register(),
2343 op->tmp1()->as_register(),
2344 op->tmp2()->as_register(),
2345 op->tmp3()->as_register(),
2346 op->header_size(),
2347 op->object_size(),
2348 op->klass()->as_register(),
2349 *op->stub()->entry());
2350 __ bind(*op->stub()->continuation());
2351 __ verify_oop(op->obj()->as_register());
2352 }
2353
2354
2355 void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
2356 assert(op->tmp1()->as_register() == G1 &&
2357 op->tmp2()->as_register() == G3 &&
2358 op->tmp3()->as_register() == G4 &&
2359 op->tmp4()->as_register() == O1 &&
2360 op->klass()->as_register() == G5, "must be");
2361
2362 LP64_ONLY( __ signx(op->len()->as_register()); )
2363 if (UseSlowPath ||
2364 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
2365 (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
2366 __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
2367 __ delayed()->nop();
2368 } else {
2369 __ allocate_array(op->obj()->as_register(),
2370 op->len()->as_register(),
2371 op->tmp1()->as_register(),
2372 op->tmp2()->as_register(),
2373 op->tmp3()->as_register(),
2374 arrayOopDesc::header_size(op->type()),
2375 type2aelembytes(op->type()),
2376 op->klass()->as_register(),
2377 *op->stub()->entry());
2378 }
2379 __ bind(*op->stub()->continuation());
2380 }
2381
2382
|