6932536: JSR 292 modified JDK MethodHandlesTest fails on x86_64

Mon, 08 Mar 2010 04:46:30 -0800

author
twisti
date
Mon, 08 Mar 2010 04:46:30 -0800
changeset 1728
51db1e4b379d
parent 1723
c76ca382971b
child 1729
7de45b5044c3
child 1730
3cf667df43ef

6932536: JSR 292 modified JDK MethodHandlesTest fails on x86_64
Summary: A modified MethodHandlesTest revealed two bugs on x86_64.
Reviewed-by: never, jrose

src/cpu/x86/vm/methodHandles_x86.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Mar 02 13:59:37 2010 -0800
     1.2 +++ b/src/cpu/x86/vm/methodHandles_x86.cpp	Mon Mar 08 04:46:30 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -715,9 +715,14 @@
    1.11        switch (ek) {
    1.12        case _adapter_opt_i2l:
    1.13          {
    1.14 +#ifdef _LP64
    1.15 +          __ movslq(rdx_temp, vmarg1);  // Load sign-extended
    1.16 +          __ movq(vmarg1, rdx_temp);    // Store into first slot
    1.17 +#else
    1.18            __ movl(rdx_temp, vmarg1);
    1.19 -          __ sarl(rdx_temp, 31);  // __ extend_sign()
    1.20 +          __ sarl(rdx_temp, BitsPerInt - 1);  // __ extend_sign()
    1.21            __ movl(vmarg2, rdx_temp); // store second word
    1.22 +#endif
    1.23          }
    1.24          break;
    1.25        case _adapter_opt_unboxl:
    1.26 @@ -727,10 +732,15 @@
    1.27            int value_offset = java_lang_boxing_object::value_offset_in_bytes(T_LONG);
    1.28            assert(value_offset == java_lang_boxing_object::value_offset_in_bytes(T_DOUBLE), "");
    1.29            __ null_check(rdx_temp, value_offset);
    1.30 +#ifdef _LP64
    1.31 +          __ movq(rbx_temp, Address(rdx_temp, value_offset));
    1.32 +          __ movq(vmarg1, rbx_temp);
    1.33 +#else
    1.34            __ movl(rbx_temp, Address(rdx_temp, value_offset + 0*BytesPerInt));
    1.35            __ movl(rdx_temp, Address(rdx_temp, value_offset + 1*BytesPerInt));
    1.36            __ movl(vmarg1, rbx_temp);
    1.37            __ movl(vmarg2, rdx_temp);
    1.38 +#endif
    1.39          }
    1.40          break;
    1.41        default:
    1.42 @@ -925,8 +935,8 @@
    1.43  
    1.44        // 'stack_move' is negative number of words to duplicate
    1.45        Register rdx_stack_move = rdx_temp;
    1.46 -      __ movl(rdx_stack_move, rcx_amh_conversion);
    1.47 -      __ sarl(rdx_stack_move, CONV_STACK_MOVE_SHIFT);
    1.48 +      __ movl2ptr(rdx_stack_move, rcx_amh_conversion);
    1.49 +      __ sarptr(rdx_stack_move, CONV_STACK_MOVE_SHIFT);
    1.50  
    1.51        int argslot0_num = 0;
    1.52        Address argslot0 = __ argument_address(RegisterOrConstant(argslot0_num));
    1.53 @@ -988,8 +998,8 @@
    1.54  
    1.55        // 'stack_move' is number of words to drop
    1.56        Register rdi_stack_move = rdi;
    1.57 -      __ movl(rdi_stack_move, rcx_amh_conversion);
    1.58 -      __ sarl(rdi_stack_move, CONV_STACK_MOVE_SHIFT);
    1.59 +      __ movl2ptr(rdi_stack_move, rcx_amh_conversion);
    1.60 +      __ sarptr(rdi_stack_move, CONV_STACK_MOVE_SHIFT);
    1.61        remove_arg_slots(_masm, rdi_stack_move,
    1.62                         rax_argslot, rbx_temp, rdx_temp);
    1.63  
    1.64 @@ -1079,8 +1089,8 @@
    1.65          __ lea(rdx_argslot_limit, Address(rax_argslot, Interpreter::stackElementSize()));
    1.66          // 'stack_move' is negative number of words to insert
    1.67          Register rdi_stack_move = rdi;
    1.68 -        __ movl(rdi_stack_move, rcx_amh_conversion);
    1.69 -        __ sarl(rdi_stack_move, CONV_STACK_MOVE_SHIFT);
    1.70 +        __ movl2ptr(rdi_stack_move, rcx_amh_conversion);
    1.71 +        __ sarptr(rdi_stack_move, CONV_STACK_MOVE_SHIFT);
    1.72          Register rsi_temp = rsi_array;  // spill this
    1.73          insert_arg_slots(_masm, rdi_stack_move, -1,
    1.74                           rax_argslot, rbx_temp, rsi_temp);

mercurial