mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
7010618: C1: array length should be treated at int on 64bit during array allocation
Sign-extend the length argument during array allocation Reviewed-by: never, kvn
This commit is contained in:
parent
34b0ff28e8
commit
c6f34365c2
2 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -2358,6 +2358,8 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
||||||
op->tmp3()->as_register() == G4 &&
|
op->tmp3()->as_register() == G4 &&
|
||||||
op->tmp4()->as_register() == O1 &&
|
op->tmp4()->as_register() == O1 &&
|
||||||
op->klass()->as_register() == G5, "must be");
|
op->klass()->as_register() == G5, "must be");
|
||||||
|
|
||||||
|
LP64_ONLY( __ signx(op->len()->as_register()); )
|
||||||
if (UseSlowPath ||
|
if (UseSlowPath ||
|
||||||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
|
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
|
||||||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
|
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1641,12 +1641,14 @@ void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
||||||
|
Register len = op->len()->as_register();
|
||||||
|
LP64_ONLY( __ movslq(len, len); )
|
||||||
|
|
||||||
if (UseSlowPath ||
|
if (UseSlowPath ||
|
||||||
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
|
(!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
|
||||||
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
|
(!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
|
||||||
__ jmp(*op->stub()->entry());
|
__ jmp(*op->stub()->entry());
|
||||||
} else {
|
} else {
|
||||||
Register len = op->len()->as_register();
|
|
||||||
Register tmp1 = op->tmp1()->as_register();
|
Register tmp1 = op->tmp1()->as_register();
|
||||||
Register tmp2 = op->tmp2()->as_register();
|
Register tmp2 = op->tmp2()->as_register();
|
||||||
Register tmp3 = op->tmp3()->as_register();
|
Register tmp3 = op->tmp3()->as_register();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue