Mercurial > hg > graal-jvmci-8
comparison src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @ 2112:55f868e91c3b
7010618: C1: array length should be treated at int on 64bit during array allocation
Summary: Sign-extend the length argument during array allocation
Reviewed-by: never, kvn
author | iveresov |
---|---|
date | Thu, 06 Jan 2011 16:03:20 -0800 |
parents | 037c727f35fb |
children | 1b4e6a5d98e0 |
comparison
equal
deleted
inserted
replaced
2093:7514897db238 | 2112:55f868e91c3b |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. | 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. | 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. |
1639 *op->stub()->entry()); | 1639 *op->stub()->entry()); |
1640 __ bind(*op->stub()->continuation()); | 1640 __ bind(*op->stub()->continuation()); |
1641 } | 1641 } |
1642 | 1642 |
1643 void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { | 1643 void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { |
1644 Register len = op->len()->as_register(); | |
1645 LP64_ONLY( __ movslq(len, len); ) | |
1646 | |
1644 if (UseSlowPath || | 1647 if (UseSlowPath || |
1645 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || | 1648 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || |
1646 (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { | 1649 (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { |
1647 __ jmp(*op->stub()->entry()); | 1650 __ jmp(*op->stub()->entry()); |
1648 } else { | 1651 } else { |
1649 Register len = op->len()->as_register(); | |
1650 Register tmp1 = op->tmp1()->as_register(); | 1652 Register tmp1 = op->tmp1()->as_register(); |
1651 Register tmp2 = op->tmp2()->as_register(); | 1653 Register tmp2 = op->tmp2()->as_register(); |
1652 Register tmp3 = op->tmp3()->as_register(); | 1654 Register tmp3 = op->tmp3()->as_register(); |
1653 if (len == tmp1) { | 1655 if (len == tmp1) { |
1654 tmp1 = tmp3; | 1656 tmp1 = tmp3; |