Print this page


Split Close
Expand all
Collapse all
          --- old/src/cpu/x86/vm/assembler_x86.cpp
          +++ new/src/cpu/x86/vm/assembler_x86.cpp
   1    1  /*
   2      - * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
        2 + * Copyright 1997-2010 Sun Microsystems, Inc.  All Rights Reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 6473 lines elided ↑ open up ↑
6486 6486    } else {
6487 6487      xorl(dst, dst);
6488 6488      off = offset();
6489 6489      movw(dst, src);
6490 6490    }
6491 6491    return off;
6492 6492  }
6493 6493  
6494 6494  void MacroAssembler::load_sized_value(Register dst, Address src,
6495 6495                                        int size_in_bytes, bool is_signed) {
6496      -  switch (size_in_bytes ^ (is_signed ? -1 : 0)) {
     6496 +  switch (size_in_bytes) {
6497 6497  #ifndef _LP64
6498 6498    // For case 8, caller is responsible for manually loading
6499 6499    // the second word into another register.
6500      -  case ~8:  // fall through:
6501      -  case  8:  movl(                dst, src ); break;
     6500 +  case  8: movl(dst, src); break;
6502 6501  #else
6503      -  case ~8:  // fall through:
6504      -  case  8:  movq(                dst, src ); break;
     6502 +  case  8: movq(dst, src); break;
6505 6503  #endif
6506      -  case ~4:  // fall through:
6507      -  case  4:  movl(                dst, src ); break;
6508      -  case ~2:  load_signed_short(   dst, src ); break;
6509      -  case  2:  load_unsigned_short( dst, src ); break;
6510      -  case ~1:  load_signed_byte(    dst, src ); break;
6511      -  case  1:  load_unsigned_byte(  dst, src ); break;
6512      -  default:  ShouldNotReachHere();
     6504 +  case  4: movl(dst, src); break;
     6505 +  case  2: is_signed ? load_signed_short(dst, src) : load_unsigned_short(dst, src); break;
     6506 +  case  1: is_signed ? load_signed_byte( dst, src) : load_unsigned_byte( dst, src); break;
     6507 +  default: ShouldNotReachHere();
6513 6508    }
6514 6509  }
6515 6510  
6516 6511  void MacroAssembler::mov32(AddressLiteral dst, Register src) {
6517 6512    if (reachable(dst)) {
6518 6513      movl(as_Address(dst), src);
6519 6514    } else {
6520 6515      lea(rscratch1, dst);
6521 6516      movl(Address(rscratch1, 0), src);
6522 6517    }
↓ open down ↓ 1176 lines elided ↑ open up ↑
7699 7694    jcc(Assembler::notEqual, wrong_method_type);
7700 7695  }
7701 7696  
7702 7697  
7703 7698  // A method handle has a "vmslots" field which gives the size of its
7704 7699  // argument list in JVM stack slots.  This field is either located directly
7705 7700  // in every method handle, or else is indirectly accessed through the
7706 7701  // method handle's MethodType.  This macro hides the distinction.
7707 7702  void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
7708 7703                                                  Register temp_reg) {
     7704 +  assert_different_registers(vmslots_reg, mh_reg, temp_reg);
7709 7705    if (UseCompressedOops)  unimplemented();  // field accesses must decode
7710 7706    // load mh.type.form.vmslots
7711 7707    if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
7712 7708      // hoist vmslots into every mh to avoid dependent load chain
7713 7709      movl(vmslots_reg, Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)));
7714 7710    } else {
7715 7711      Register temp2_reg = vmslots_reg;
7716 7712      movptr(temp2_reg, Address(mh_reg,    delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)));
7717 7713      movptr(temp2_reg, Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)));
7718 7714      movl(vmslots_reg, Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)));
↓ open down ↓ 1072 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX