Ignore:
Timestamp:
Mar 26, 2011, 8:39:20 PM (15 years ago)
Author:
dmik
Message:

trunk: Merged in openjdk6 b22 from branches/vendor/oracle.

Location:
trunk/openjdk
Files:
84 edited

Legend:

Unmodified
Added
Removed
  • trunk/openjdk

  • trunk/openjdk/hotspot/src/cpu/sparc/vm/args.cc

    r2 r278  
    11/*
    2  * Copyright 2002-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 * 
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    627627
    628628// This code sequence is relocatable to any address, even on LP64.
    629 void MacroAssembler::jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) {
     629void MacroAssembler::jumpl(const AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) {
    630630  assert_not_delayed();
    631631  // Force fixed length sethi because NativeJump and NativeFarCall don't handle
     
    673673}
    674674
    675 void MacroAssembler::jump(AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
     675void MacroAssembler::jump(const AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {
    676676  jumpl(addrlit, temp, G0, offset, file, line);
    677677}
     
    23342334
    23352335
     2336void MacroAssembler::load_sized_value(Address src, Register dst,
     2337                                      size_t size_in_bytes, bool is_signed) {
     2338  switch (size_in_bytes) {
     2339  case  8: ldx(src, dst); break;
     2340  case  4: ld( src, dst); break;
     2341  case  2: is_signed ? ldsh(src, dst) : lduh(src, dst); break;
     2342  case  1: is_signed ? ldsb(src, dst) : ldub(src, dst); break;
     2343  default: ShouldNotReachHere();
     2344  }
     2345}
     2346
     2347
    23362348void MacroAssembler::float_cmp( bool is_float, int unordered_result,
    23372349                                FloatRegister Fa, FloatRegister Fb,
     
    26262638
    26272639
    2628 void MacroAssembler::regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstant src, Register temp ) {
    2629   assert(dest.register_or_noreg() != G0, "lost side effect");
    2630   if ((src.is_constant() && src.as_constant() == 0) ||
    2631       (src.is_register() && src.as_register() == G0)) {
    2632     // do nothing
    2633   } else if (dest.is_register()) {
    2634     add(dest.as_register(), ensure_rs2(src, temp), dest.as_register());
    2635   } else if (src.is_constant()) {
    2636     intptr_t res = dest.as_constant() + src.as_constant();
    2637     dest = RegisterOrConstant(res); // side effect seen by caller
     2640RegisterOrConstant MacroAssembler::regcon_andn_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
     2641  assert(d.register_or_noreg() != G0, "lost side effect");
     2642  if ((s2.is_constant() && s2.as_constant() == 0) ||
     2643      (s2.is_register() && s2.as_register() == G0)) {
     2644    // Do nothing, just move value.
     2645    if (s1.is_register()) {
     2646      if (d.is_constant())  d = temp;
     2647      mov(s1.as_register(), d.as_register());
     2648      return d;
     2649    } else {
     2650      return s1;
     2651    }
     2652  }
     2653
     2654  if (s1.is_register()) {
     2655    assert_different_registers(s1.as_register(), temp);
     2656    if (d.is_constant())  d = temp;
     2657    andn(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
     2658    return d;
    26382659  } else {
    2639     assert(temp != noreg, "cannot handle constant += register");
    2640     add(src.as_register(), ensure_rs2(dest, temp), temp);
    2641     dest = RegisterOrConstant(temp); // side effect seen by caller
    2642   }
    2643 }
    2644 
    2645 void MacroAssembler::regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src, Register temp ) {
    2646   assert(dest.register_or_noreg() != G0, "lost side effect");
    2647   if (!is_simm13(src.constant_or_zero()))
    2648     src = (src.as_constant() & 0xFF);
    2649   if ((src.is_constant() && src.as_constant() == 0) ||
    2650       (src.is_register() && src.as_register() == G0)) {
    2651     // do nothing
    2652   } else if (dest.is_register()) {
    2653     sll_ptr(dest.as_register(), src, dest.as_register());
    2654   } else if (src.is_constant()) {
    2655     intptr_t res = dest.as_constant() << src.as_constant();
    2656     dest = RegisterOrConstant(res); // side effect seen by caller
     2660    if (s2.is_register()) {
     2661      assert_different_registers(s2.as_register(), temp);
     2662      if (d.is_constant())  d = temp;
     2663      set(s1.as_constant(), temp);
     2664      andn(temp, s2.as_register(), d.as_register());
     2665      return d;
     2666    } else {
     2667      intptr_t res = s1.as_constant() & ~s2.as_constant();
     2668      return res;
     2669    }
     2670  }
     2671}
     2672
     2673RegisterOrConstant MacroAssembler::regcon_inc_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
     2674  assert(d.register_or_noreg() != G0, "lost side effect");
     2675  if ((s2.is_constant() && s2.as_constant() == 0) ||
     2676      (s2.is_register() && s2.as_register() == G0)) {
     2677    // Do nothing, just move value.
     2678    if (s1.is_register()) {
     2679      if (d.is_constant())  d = temp;
     2680      mov(s1.as_register(), d.as_register());
     2681      return d;
     2682    } else {
     2683      return s1;
     2684    }
     2685  }
     2686
     2687  if (s1.is_register()) {
     2688    assert_different_registers(s1.as_register(), temp);
     2689    if (d.is_constant())  d = temp;
     2690    add(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
     2691    return d;
    26572692  } else {
    2658     assert(temp != noreg, "cannot handle constant <<= register");
    2659     set(dest.as_constant(), temp);
    2660     sll_ptr(temp, src, temp);
    2661     dest = RegisterOrConstant(temp); // side effect seen by caller
     2693    if (s2.is_register()) {
     2694      assert_different_registers(s2.as_register(), temp);
     2695      if (d.is_constant())  d = temp;
     2696      add(s2.as_register(), ensure_simm13_or_reg(s1, temp), d.as_register());
     2697      return d;
     2698    } else {
     2699      intptr_t res = s1.as_constant() + s2.as_constant();
     2700      return res;
     2701    }
     2702  }
     2703}
     2704
     2705RegisterOrConstant MacroAssembler::regcon_sll_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp) {
     2706  assert(d.register_or_noreg() != G0, "lost side effect");
     2707  if (!is_simm13(s2.constant_or_zero()))
     2708    s2 = (s2.as_constant() & 0xFF);
     2709  if ((s2.is_constant() && s2.as_constant() == 0) ||
     2710      (s2.is_register() && s2.as_register() == G0)) {
     2711    // Do nothing, just move value.
     2712    if (s1.is_register()) {
     2713      if (d.is_constant())  d = temp;
     2714      mov(s1.as_register(), d.as_register());
     2715      return d;
     2716    } else {
     2717      return s1;
     2718    }
     2719  }
     2720
     2721  if (s1.is_register()) {
     2722    assert_different_registers(s1.as_register(), temp);
     2723    if (d.is_constant())  d = temp;
     2724    sll_ptr(s1.as_register(), ensure_simm13_or_reg(s2, temp), d.as_register());
     2725    return d;
     2726  } else {
     2727    if (s2.is_register()) {
     2728      assert_different_registers(s2.as_register(), temp);
     2729      if (d.is_constant())  d = temp;
     2730      set(s1.as_constant(), temp);
     2731      sll_ptr(temp, s2.as_register(), d.as_register());
     2732      return d;
     2733    } else {
     2734      intptr_t res = s1.as_constant() << s2.as_constant();
     2735      return res;
     2736    }
    26622737  }
    26632738}
     
    27092784  // Adjust recv_klass by scaled itable_index, so we can free itable_index.
    27102785  RegisterOrConstant itable_offset = itable_index;
    2711   regcon_sll_ptr(itable_offset, exact_log2(itableMethodEntry::size() * wordSize));
    2712   regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes());
    2713   add(recv_klass, ensure_rs2(itable_offset, sethi_temp), recv_klass);
     2786  itable_offset = regcon_sll_ptr(itable_index, exact_log2(itableMethodEntry::size() * wordSize), itable_offset);
     2787  itable_offset = regcon_inc_ptr(itable_offset, itableMethodEntry::method_offset_in_bytes(), itable_offset);
     2788  add(recv_klass, ensure_simm13_or_reg(itable_offset, sethi_temp), recv_klass);
    27142789
    27152790  // for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) {
     
    28062881  assert_different_registers(sub_klass, super_klass, temp_reg);
    28072882  if (super_check_offset.is_register()) {
    2808     assert_different_registers(sub_klass, super_klass,
     2883    assert_different_registers(sub_klass, super_klass, temp_reg,
    28092884                               super_check_offset.as_register());
    28102885  } else if (must_load_sco) {
     
    28562931    lduw(super_klass, sco_offset, temp2_reg);
    28572932    super_check_offset = RegisterOrConstant(temp2_reg);
     2933    // super_check_offset is register.
     2934    assert_different_registers(sub_klass, super_klass, temp_reg, super_check_offset.as_register());
    28582935  }
    28592936  ld_ptr(sub_klass, super_check_offset, temp_reg);
     
    30153092
    30163093
    3017 
    3018 
    30193094void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg,
    30203095                                              Register temp_reg,
    30213096                                              Label& wrong_method_type) {
     3097  if (UseCompressedOops)  unimplemented("coop");  // field accesses must decode
    30223098  assert_different_registers(mtype_reg, mh_reg, temp_reg);
    30233099  // compare method type against that of the receiver
     
    30303106
    30313107
    3032 void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_reg) {
     3108// A method handle has a "vmslots" field which gives the size of its
     3109// argument list in JVM stack slots.  This field is either located directly
     3110// in every method handle, or else is indirectly accessed through the
     3111// method handle's MethodType.  This macro hides the distinction.
     3112void MacroAssembler::load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
     3113                                                Register temp_reg) {
     3114  assert_different_registers(vmslots_reg, mh_reg, temp_reg);
     3115  if (UseCompressedOops)  unimplemented("coop");  // field accesses must decode
     3116  // load mh.type.form.vmslots
     3117  if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) {
     3118    // hoist vmslots into every mh to avoid dependent load chain
     3119    ld(    Address(mh_reg,    delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)),   vmslots_reg);
     3120  } else {
     3121    Register temp2_reg = vmslots_reg;
     3122    ld_ptr(Address(mh_reg,    delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)),      temp2_reg);
     3123    ld_ptr(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)),        temp2_reg);
     3124    ld(    Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg);
     3125  }
     3126}
     3127
     3128
     3129void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop) {
    30333130  assert(mh_reg == G3_method_handle, "caller must put MH object in G3");
    30343131  assert_different_registers(mh_reg, temp_reg);
     3132
     3133  if (UseCompressedOops)  unimplemented("coop");  // field accesses must decode
    30353134
    30363135  // pick out the interpreted side of the handler
     
    30443143  // see MethodHandles::generate_method_handle_stub
    30453144
    3046   // (Can any caller use this delay slot?  If so, add an option for supression.)
    3047   delayed()->nop();
    3048 }
     3145  // Some callers can fill the delay slot.
     3146  if (emit_delayed_nop) {
     3147    delayed()->nop();
     3148  }
     3149}
     3150
    30493151
    30503152RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot,
    30513153                                                   int extra_slot_offset) {
    30523154  // cf. TemplateTable::prepare_invoke(), if (load_receiver).
    3053   int stackElementSize = Interpreter::stackElementWords() * wordSize;
    3054   int offset = Interpreter::expr_offset_in_bytes(extra_slot_offset+0);
    3055   int offset1 = Interpreter::expr_offset_in_bytes(extra_slot_offset+1);
    3056   assert(offset1 - offset == stackElementSize, "correct arithmetic");
     3155  int stackElementSize = Interpreter::stackElementSize;
     3156  int offset = extra_slot_offset * stackElementSize;
    30573157  if (arg_slot.is_constant()) {
    30583158    offset += arg_slot.as_constant() * stackElementSize;
     
    30673167}
    30683168
     3169
     3170Address MacroAssembler::argument_address(RegisterOrConstant arg_slot,
     3171                                         int extra_slot_offset) {
     3172  return Address(Gargs, argument_offset(arg_slot, extra_slot_offset));
     3173}
    30693174
    30703175
     
    40834188static void check_index(int ind) {
    40844189  assert(0 <= ind && ind <= 64*K && ((ind % oopSize) == 0),
    4085          "Invariants.")
     4190         "Invariants.");
    40864191}
    40874192
     
    46774782  }
    46784783}
     4784
     4785// Compare char[] arrays aligned to 4 bytes.
     4786void MacroAssembler::char_arrays_equals(Register ary1, Register ary2,
     4787                                        Register limit, Register result,
     4788                                        Register chr1, Register chr2, Label& Ldone) {
     4789  Label Lvector, Lloop;
     4790  assert(chr1 == result, "should be the same");
     4791
     4792  // Note: limit contains number of bytes (2*char_elements) != 0.
     4793  andcc(limit, 0x2, chr1); // trailing character ?
     4794  br(Assembler::zero, false, Assembler::pt, Lvector);
     4795  delayed()->nop();
     4796
     4797  // compare the trailing char
     4798  sub(limit, sizeof(jchar), limit);
     4799  lduh(ary1, limit, chr1);
     4800  lduh(ary2, limit, chr2);
     4801  cmp(chr1, chr2);
     4802  br(Assembler::notEqual, true, Assembler::pt, Ldone);
     4803  delayed()->mov(G0, result);     // not equal
     4804
     4805  // only one char ?
     4806  br_on_reg_cond(rc_z, true, Assembler::pn, limit, Ldone);
     4807  delayed()->add(G0, 1, result); // zero-length arrays are equal
     4808
     4809  // word by word compare, dont't need alignment check
     4810  bind(Lvector);
     4811  // Shift ary1 and ary2 to the end of the arrays, negate limit
     4812  add(ary1, limit, ary1);
     4813  add(ary2, limit, ary2);
     4814  neg(limit, limit);
     4815
     4816  lduw(ary1, limit, chr1);
     4817  bind(Lloop);
     4818  lduw(ary2, limit, chr2);
     4819  cmp(chr1, chr2);
     4820  br(Assembler::notEqual, true, Assembler::pt, Ldone);
     4821  delayed()->mov(G0, result);     // not equal
     4822  inccc(limit, 2*sizeof(jchar));
     4823  // annul LDUW if branch is not taken to prevent access past end of array
     4824  br(Assembler::notZero, true, Assembler::pt, Lloop);
     4825  delayed()->lduw(ary1, limit, chr1); // hoisted
     4826
     4827  // Caller should set it:
     4828  // add(G0, 1, result); // equals
     4829}
     4830
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    8888REGISTER_DECLARATION(Register, G5_method_type        , G5);
    8989REGISTER_DECLARATION(Register, G3_method_handle      , G3);
     90REGISTER_DECLARATION(Register, L7_mh_SP_save         , L7);
    9091
    9192// The compiler requires that G5_megamorphic_method is G5_inline_cache_klass,
     
    662663    swap_op3     = 0x0f,
    663664
    664     lduwa_op3    = 0x10,
    665     ldxa_op3     = 0x1b,
    666 
    667665    stwa_op3     = 0x14,
    668666    stxa_op3     = 0x1e,
     
    10661064  void assert_not_delayed(const char* msg) {
    10671065#ifdef CHECK_DELAY
    1068     assert_msg ( delay_state == no_delay, msg);
     1066    assert(delay_state == no_delay, msg);
    10691067#endif
    10701068  }
     
    12801278  // 171
    12811279
     1280  inline void ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d);
    12821281  inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
    12831282  inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder());
     
    13831382  // pp 181
    13841383
    1385   void and3(     Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3               ) | rs1(s1) | rs2(s2) ); }
    1386   void and3(     Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     1384  void and3(    Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | rs2(s2) ); }
     1385  void and3(    Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    13871386  void andcc(   Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    13881387  void andcc(   Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(and_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    13891388  void andn(    Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | rs2(s2) ); }
    13901389  void andn(    Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3             ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     1390  void andn(    Register s1, RegisterOrConstant s2, Register d);
    13911391  void andncc(  Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    13921392  void andncc(  Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    1393   void or3(      Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | rs2(s2) ); }
    1394   void or3(      Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     1393  void or3(     Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | rs2(s2) ); }
     1394  void or3(     Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3               ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    13951395  void orcc(    Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    13961396  void orcc(    Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(or_op3   | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     
    13991399  void orncc(   Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    14001400  void orncc(   Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(orn_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    1401   void xor3(     Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | rs2(s2) ); }
    1402   void xor3(     Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     1401  void xor3(    Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | rs2(s2) ); }
     1402  void xor3(    Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3              ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
    14031403  void xorcc(   Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
    14041404  void xorcc(   Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(xor_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
     
    15361536  // pp 222
    15371537
    1538   inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2 );
     1538  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, RegisterOrConstant s2);
     1539  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2);
    15391540  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a);
    15401541  inline void stf(    FloatRegisterImpl::Width w, FloatRegister d, const Address& a, int offset = 0);
     
    19741975  // address pseudos: make these names unlike instruction names to avoid confusion
    19751976  inline intptr_t load_pc_address( Register reg, int bytes_to_skip );
    1976   inline void load_contents(AddressLiteral& addrlit, Register d, int offset = 0);
    1977   inline void load_ptr_contents(AddressLiteral& addrlit, Register d, int offset = 0);
    1978   inline void store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
    1979   inline void store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
    1980   inline void jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
    1981   inline void jump_to(AddressLiteral& addrlit, Register temp, int offset = 0);
     1977  inline void load_contents(const AddressLiteral& addrlit, Register d, int offset = 0);
     1978  inline void load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset = 0);
     1979  inline void store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset = 0);
     1980  inline void store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset = 0);
     1981  inline void jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
     1982  inline void jump_to(const AddressLiteral& addrlit, Register temp, int offset = 0);
    19821983  inline void jump_indirect_to(Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0);
    19831984
     
    19871988  void jmp ( Register r1, int offset,  const char* file, int line );
    19881989
    1989   void jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
    1990   void jump (AddressLiteral& addrlit, Register temp,             int offset, const char* file, int line);
     1990  void jumpl(const AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
     1991  void jump (const AddressLiteral& addrlit, Register temp,             int offset, const char* file, int line);
    19911992
    19921993
     
    20282029#endif
    20292030
    2030   // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's
    2031   // st_long will perform st for 32 bit VM's and stx for 64 bit VM's
     2031  // ld_long will perform ldd for 32 bit VM's and ldx for 64 bit VM's
     2032  // st_long will perform std for 32 bit VM's and stx for 64 bit VM's
    20322033  inline void ld_long(Register s1, Register s2, Register d);
    20332034  inline void ld_long(Register s1, int simm13a, Register d);
     
    20402041
    20412042  // Helpers for address formation.
    2042   // They update the dest in place, whether it is a register or constant.
    2043   // They emit no code at all if src is a constant zero.
    2044   // If dest is a constant and src is a register, the temp argument
    2045   // is required, and becomes the result.
    2046   // If dest is a register and src is a non-simm13 constant,
    2047   // the temp argument is required, and is used to materialize the constant.
    2048   void regcon_inc_ptr( RegisterOrConstant& dest, RegisterOrConstant src,
    2049                        Register temp = noreg );
    2050   void regcon_sll_ptr( RegisterOrConstant& dest, RegisterOrConstant src,
    2051                        Register temp = noreg );
    2052   RegisterOrConstant ensure_rs2(RegisterOrConstant rs2, Register sethi_temp) {
    2053     guarantee(sethi_temp != noreg, "constant offset overflow");
    2054     if (is_simm13(rs2.constant_or_zero()))
    2055       return rs2;               // register or short constant
    2056     set(rs2.as_constant(), sethi_temp);
    2057     return sethi_temp;
     2043  // - They emit only a move if s2 is a constant zero.
     2044  // - If dest is a constant and either s1 or s2 is a register, the temp argument is required and becomes the result.
     2045  // - If dest is a register and either s1 or s2 is a non-simm13 constant, the temp argument is required and used to materialize the constant.
     2046  RegisterOrConstant regcon_andn_ptr(RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
     2047  RegisterOrConstant regcon_inc_ptr( RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
     2048  RegisterOrConstant regcon_sll_ptr( RegisterOrConstant s1, RegisterOrConstant s2, RegisterOrConstant d, Register temp = noreg);
     2049
     2050  RegisterOrConstant ensure_simm13_or_reg(RegisterOrConstant src, Register temp) {
     2051    if (is_simm13(src.constant_or_zero()))
     2052      return src;               // register or short constant
     2053    guarantee(temp != noreg, "constant offset overflow");
     2054    set(src.as_constant(), temp);
     2055    return temp;
    20582056  }
    20592057
     
    22372235  inline void    set_oop             (jobject obj, Register d);              // uses allocate_oop_address
    22382236  inline void    set_oop_constant    (jobject obj, Register d);              // uses constant_oop_address
    2239   inline void    set_oop             (AddressLiteral& obj_addr, Register d); // same as load_address
     2237  inline void    set_oop             (const AddressLiteral& obj_addr, Register d); // same as load_address
    22402238
    22412239  void set_narrow_oop( jobject obj, Register d );
     
    23032301  void lcmp( Register Ra, Register Rb, Register Rresult);
    23042302#endif
     2303
     2304  // Loading values by size and signed-ness
     2305  void load_sized_value(Address src, Register dst, size_t size_in_bytes, bool is_signed);
    23052306
    23062307  void float_cmp( bool is_float, int unordered_result,
     
    24222423                                Register temp_reg,
    24232424                                Label& wrong_method_type);
    2424   void jump_to_method_handle_entry(Register mh_reg, Register temp_reg);
     2425  void load_method_handle_vmslots(Register vmslots_reg, Register mh_reg,
     2426                                  Register temp_reg);
     2427  void jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop = true);
    24252428  // offset relative to Gargs of argument at tos[arg_slot].
    24262429  // (arg_slot == 0 means the last argument, not the first).
    24272430  RegisterOrConstant argument_offset(RegisterOrConstant arg_slot,
    24282431                                     int extra_slot_offset = 0);
    2429 
     2432  // Address of Gargs and argument_offset.
     2433  Address            argument_address(RegisterOrConstant arg_slot,
     2434                                      int extra_slot_offset = 0);
    24302435
    24312436  // Stack overflow checking
     
    24552460  void inc_counter(address counter_addr, Register Rtmp1, Register Rtmp2);
    24562461  void inc_counter(int*    counter_addr, Register Rtmp1, Register Rtmp2);
     2462
     2463  // Compare char[] arrays aligned to 4 bytes.
     2464  void char_arrays_equals(Register ary1, Register ary2,
     2465                          Register limit, Register result,
     2466                          Register chr1, Register chr2, Label& Ldone);
    24572467
    24582468#undef VIRTUAL
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    9999inline void Assembler::jmpl( Register s1, Register s2, Register d                          ) { emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2));  has_delay_slot(); }
    100100inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec);  has_delay_slot(); }
     101
     102inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d) {
     103  if (s2.is_register()) ldf(w, s1, s2.as_register(), d);
     104  else                  ldf(w, s1, s2.as_constant(), d);
     105}
    101106
    102107inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); }
     
    202207
    203208// form effective addresses this way:
    204 inline void Assembler::add(   Register s1, RegisterOrConstant s2, Register d, int offset) {
    205   if (s2.is_register())  add(s1, s2.as_register(), d);
     209inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) {
     210  if (s2.is_register())  add(s1, s2.as_register(),          d);
    206211  else                 { add(s1, s2.as_constant() + offset, d); offset = 0; }
    207212  if (offset != 0)       add(d,  offset,                    d);
    208213}
    209214
     215inline void Assembler::andn(Register s1, RegisterOrConstant s2, Register d) {
     216  if (s2.is_register())  andn(s1, s2.as_register(), d);
     217  else                   andn(s1, s2.as_constant(), d);
     218}
     219
    210220inline void Assembler::ldstub(  Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); }
    211221inline void Assembler::ldstub(  Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
     
    224234
    225235  // pp 222
     236
     237inline void Assembler::stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, RegisterOrConstant s2) {
     238  if (s2.is_register()) stf(w, d, s1, s2.as_register());
     239  else                  stf(w, d, s1, s2.as_constant());
     240}
    226241
    227242inline void Assembler::stf(    FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); }
     
    285300inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); }
    286301inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); }
     302inline void Assembler::stw(Register d, Register s1, RegisterOrConstant s2) { stw(d, Address(s1, s2)); }
    287303inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); }
    288304inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); }
     
    635651
    636652
    637 inline void MacroAssembler::load_contents(AddressLiteral& addrlit, Register d, int offset) {
     653inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) {
    638654  assert_not_delayed();
    639655  sethi(addrlit, d);
     
    642658
    643659
    644 inline void MacroAssembler::load_ptr_contents(AddressLiteral& addrlit, Register d, int offset) {
     660inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) {
    645661  assert_not_delayed();
    646662  sethi(addrlit, d);
     
    649665
    650666
    651 inline void MacroAssembler::store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
     667inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) {
    652668  assert_not_delayed();
    653669  sethi(addrlit, temp);
     
    656672
    657673
    658 inline void MacroAssembler::store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {
     674inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) {
    659675  assert_not_delayed();
    660676  sethi(addrlit, temp);
     
    664680
    665681// This code sequence is relocatable to any address, even on LP64.
    666 inline void MacroAssembler::jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset) {
     682inline void MacroAssembler::jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset) {
    667683  assert_not_delayed();
    668684  // Force fixed length sethi because NativeJump and NativeFarCall don't handle
     
    673689
    674690
    675 inline void MacroAssembler::jump_to(AddressLiteral& addrlit, Register temp, int offset) {
     691inline void MacroAssembler::jump_to(const AddressLiteral& addrlit, Register temp, int offset) {
    676692  jumpl_to(addrlit, temp, G0, offset);
    677693}
     
    697713
    698714
    699 inline void MacroAssembler::set_oop(AddressLiteral& obj_addr, Register d) {
     715inline void MacroAssembler::set_oop(const AddressLiteral& obj_addr, Register d) {
    700716  assert(obj_addr.rspec().type() == relocInfo::oop_type, "must be an oop reloc");
    701717  set(obj_addr, d);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp

    r2 r278  
    11/*
    2  * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    237237
    238238inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
    239   return op1 <<  op2;
     239  return op1 << (op2 & 0x1f);
    240240}
    241241
    242242inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
    243   return op1 >>  op2; // QQ op2 & 0x1f??
     243  return op1 >> (op2 & 0x1f);
    244244}
    245245
     
    248248}
    249249
    250 inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
    251   return ((juint) op1) >> op2; // QQ op2 & 0x1f??
     250inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
     251  return ((juint) op1) >> (op2 & 0x1f);
    252252}
    253253
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    378378}
    379379
     380
     381void DeoptimizeStub::emit_code(LIR_Assembler* ce) {
     382  __ bind(_entry);
     383  __ call(SharedRuntime::deopt_blob()->unpack_with_reexecution());
     384  __ delayed()->nop();
     385  ce->add_call_info_here(_info);
     386  debug_only(__ should_not_reach_here());
     387}
     388
     389
    380390void ArrayCopyStub::emit_code(LIR_Assembler* ce) {
    381391  //---------------slow case: call to native-----------------
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    182182
    183183
    184 void FrameMap::init () {
    185   if (_init_done) return;
     184void FrameMap::initialize() {
     185  assert(!_init_done, "once");
    186186
    187187  int i=0;
     
    346346
    347347
     348// JSR 292
     349LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() {
     350  assert(L7 == L7_mh_SP_save, "must be same register");
     351  return L7_opr;
     352}
     353
     354
    348355bool FrameMap::validate_frame() {
    349356  int max_offset = in_bytes(framesize_in_bytes());
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    190190  { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below");
    191191    int monitor_offset = BytesPerWord * method()->max_locals() +
    192       (BasicObjectLock::size() * BytesPerWord) * (number_of_locks - 1);
     192      (2 * BytesPerWord) * (number_of_locks - 1);
     193    // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
     194    // the OSR buffer using 2 word entries: first the lock and then
     195    // the oop.
    193196    for (int i = 0; i < number_of_locks; i++) {
    194       int slot_offset = monitor_offset - ((i * BasicObjectLock::size()) * BytesPerWord);
     197      int slot_offset = monitor_offset - ((i * 2) * BytesPerWord);
    195198#ifdef ASSERT
    196199      // verify the interpreter's monitor has a non-null object
    197200      {
    198201        Label L;
    199         __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7);
     202        __ ld_ptr(OSR_buf, slot_offset + 1*BytesPerWord, O7);
    200203        __ cmp(G0, O7);
    201204        __ br(Assembler::notEqual, false, Assembler::pt, L);
     
    206209#endif // ASSERT
    207210      // Copy the lock field into the compiled activation.
    208       __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::lock_offset_in_bytes(), O7);
     211      __ ld_ptr(OSR_buf, slot_offset + 0, O7);
    209212      __ st_ptr(O7, frame_map()->address_for_monitor_lock(i));
    210       __ ld_ptr(OSR_buf, slot_offset + BasicObjectLock::obj_offset_in_bytes(), O7);
     213      __ ld_ptr(OSR_buf, slot_offset + 1*BytesPerWord, O7);
    211214      __ st_ptr(O7, frame_map()->address_for_monitor_object(i));
    212215    }
     
    355358
    356359
    357 void LIR_Assembler::emit_exception_handler() {
     360int LIR_Assembler::emit_exception_handler() {
    358361  // if the last instruction is a call (typically to do a throw which
    359362  // is coming at the end after block reordering) the return address
     
    371374    // not enough space left for the handler
    372375    bailout("exception handler overflow");
    373     return;
    374   }
    375 #ifdef ASSERT
     376    return -1;
     377  }
     378
    376379  int offset = code_offset();
    377 #endif // ASSERT
    378   compilation()->offsets()->set_value(CodeOffsets::Exceptions, code_offset());
    379 
    380 
    381   if (compilation()->has_exception_handlers() || compilation()->env()->jvmti_can_post_exceptions()) {
    382     __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
    383     __ delayed()->nop();
    384   }
    385 
    386   __ call(Runtime1::entry_for(Runtime1::unwind_exception_id), relocInfo::runtime_call_type);
     380
     381  __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
    387382  __ delayed()->nop();
    388383  debug_only(__ stop("should have gone to the caller");)
    389384  assert(code_offset() - offset <= exception_handler_size, "overflow");
    390 
    391385  __ end_a_stub();
    392 }
    393 
    394 void LIR_Assembler::emit_deopt_handler() {
     386
     387  return offset;
     388}
     389
     390
     391// Emit the code to remove the frame from the stack in the exception
     392// unwind path.
     393int LIR_Assembler::emit_unwind_handler() {
     394#ifndef PRODUCT
     395  if (CommentedAssembly) {
     396    _masm->block_comment("Unwind handler");
     397  }
     398#endif
     399
     400  int offset = code_offset();
     401
     402  // Fetch the exception from TLS and clear out exception related thread state
     403  __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), O0);
     404  __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
     405  __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_pc_offset()));
     406
     407  __ bind(_unwind_handler_entry);
     408  __ verify_not_null_oop(O0);
     409  if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
     410    __ mov(O0, I0);  // Preserve the exception
     411  }
     412
     413  // Preform needed unlocking
     414  MonitorExitStub* stub = NULL;
     415  if (method()->is_synchronized()) {
     416    monitor_address(0, FrameMap::I1_opr);
     417    stub = new MonitorExitStub(FrameMap::I1_opr, true, 0);
     418    __ unlock_object(I3, I2, I1, *stub->entry());
     419    __ bind(*stub->continuation());
     420  }
     421
     422  if (compilation()->env()->dtrace_method_probes()) {
     423    __ mov(G2_thread, O0);
     424    jobject2reg(method()->constant_encoding(), O1);
     425    __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), relocInfo::runtime_call_type);
     426    __ delayed()->nop();
     427  }
     428
     429  if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
     430    __ mov(I0, O0);  // Restore the exception
     431  }
     432
     433  // dispatch to the unwind logic
     434  __ call(Runtime1::entry_for(Runtime1::unwind_exception_id), relocInfo::runtime_call_type);
     435  __ delayed()->nop();
     436
     437  // Emit the slow path assembly
     438  if (stub != NULL) {
     439    stub->emit_code(this);
     440  }
     441
     442  return offset;
     443}
     444
     445
     446int LIR_Assembler::emit_deopt_handler() {
    395447  // if the last instruction is a call (typically to do a throw which
    396448  // is coming at the end after block reordering) the return address
     
    406458    // not enough space left for the handler
    407459    bailout("deopt handler overflow");
    408     return;
    409   }
    410 #ifdef ASSERT
     460    return -1;
     461  }
     462
    411463  int offset = code_offset();
    412 #endif // ASSERT
    413   compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset());
    414 
    415464  AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack());
    416 
    417465  __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp
    418466  __ delayed()->nop();
    419 
    420467  assert(code_offset() - offset <= deopt_handler_size, "overflow");
    421 
    422468  debug_only(__ stop("should have gone to the caller");)
    423 
    424469  __ end_a_stub();
     470
     471  return offset;
    425472}
    426473
     
    689736
    690737
    691 void LIR_Assembler::call(address entry, relocInfo::relocType rtype, CodeEmitInfo* info) {
    692   __ call(entry, rtype);
    693   // the peephole pass fills the delay slot
    694 }
    695 
    696 
    697 void LIR_Assembler::ic_call(address entry, CodeEmitInfo* info) {
     738void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) {
     739  __ call(op->addr(), rtype);
     740  // The peephole pass fills the delay slot, add_call_info is done in
     741  // LIR_Assembler::emit_delay.
     742}
     743
     744
     745void LIR_Assembler::ic_call(LIR_OpJavaCall* op) {
    698746  RelocationHolder rspec = virtual_call_Relocation::spec(pc());
    699747  __ set_oop((jobject)Universe::non_oop_word(), G5_inline_cache_reg);
    700748  __ relocate(rspec);
    701   __ call(entry, relocInfo::none);
    702   // the peephole pass fills the delay slot
    703 }
    704 
    705 
    706 void LIR_Assembler::vtable_call(int vtable_offset, CodeEmitInfo* info) {
    707   add_debug_info_for_null_check_here(info);
     749  __ call(op->addr(), relocInfo::none);
     750  // The peephole pass fills the delay slot, add_call_info is done in
     751  // LIR_Assembler::emit_delay.
     752}
     753
     754
     755void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) {
     756  add_debug_info_for_null_check_here(op->info());
    708757  __ ld_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch);
    709   if (__ is_simm13(vtable_offset) ) {
    710     __ ld_ptr(G3_scratch, vtable_offset, G5_method);
     758  if (__ is_simm13(op->vtable_offset())) {
     759    __ ld_ptr(G3_scratch, op->vtable_offset(), G5_method);
    711760  } else {
    712761    // This will generate 2 instructions
    713     __ set(vtable_offset, G5_method);
     762    __ set(op->vtable_offset(), G5_method);
    714763    // ld_ptr, set_hi, set
    715764    __ ld_ptr(G3_scratch, G5_method, G5_method);
     
    9541003#ifdef _LP64
    9551004          assert(base != to_reg->as_register_lo(), "can't handle this");
     1005          assert(O7 != to_reg->as_register_lo(), "can't handle this");
    9561006          __ ld(base, offset + hi_word_offset_in_bytes, to_reg->as_register_lo());
     1007          __ lduw(base, offset + lo_word_offset_in_bytes, O7); // in case O7 is base or offset, use it last
    9571008          __ sllx(to_reg->as_register_lo(), 32, to_reg->as_register_lo());
    958           __ ld(base, offset + lo_word_offset_in_bytes, to_reg->as_register_lo());
     1009          __ or3(to_reg->as_register_lo(), O7, to_reg->as_register_lo());
    9591010#else
    9601011          if (base == to_reg->as_register_lo()) {
     
    9771028          // split unaligned loads
    9781029          if (unaligned || PatchALot) {
    979             __ ldf(FloatRegisterImpl::S, base, offset + BytesPerWord, reg->successor());
    980             __ ldf(FloatRegisterImpl::S, base, offset,                reg);
     1030            __ ldf(FloatRegisterImpl::S, base, offset + 4, reg->successor());
     1031            __ ldf(FloatRegisterImpl::S, base, offset,     reg);
    9811032          } else {
    9821033            __ ldf(FloatRegisterImpl::D, base, offset, to_reg->as_double_reg());
     
    10691120  switch (c->type()) {
    10701121    case T_INT:
    1071     case T_FLOAT: {
     1122    case T_FLOAT:
     1123    case T_ADDRESS: {
    10721124      Register src_reg = O7;
    10731125      int value = c->as_jint_bits();
     
    11251177  switch (c->type()) {
    11261178    case T_INT:
    1127     case T_FLOAT: {
     1179    case T_FLOAT:
     1180    case T_ADDRESS: {
    11281181      LIR_Opr tmp = FrameMap::O7_opr;
    11291182      int value = c->as_jint_bits();
     
    11971250  switch (c->type()) {
    11981251    case T_INT:
     1252    case T_ADDRESS:
    11991253      {
    12001254        jint con = c->as_jint();
     
    17221776    }
    17231777  } else if (code == lir_cmp_l2i) {
     1778#ifdef _LP64
     1779    __ lcmp(left->as_register_lo(), right->as_register_lo(), dst->as_register());
     1780#else
    17241781    __ lcmp(left->as_register_hi(),  left->as_register_lo(),
    17251782            right->as_register_hi(), right->as_register_lo(),
    17261783            dst->as_register());
     1784#endif
    17271785  } else {
    17281786    ShouldNotReachHere();
     
    20402098
    20412099
    2042 void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info, bool unwind) {
     2100void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) {
    20432101  assert(exceptionOop->as_register() == Oexception, "should match");
    2044   assert(unwind || exceptionPC->as_register() == Oissuing_pc, "should match");
     2102  assert(exceptionPC->as_register() == Oissuing_pc, "should match");
    20452103
    20462104  info->add_register_oop(exceptionOop);
    20472105
    2048   if (unwind) {
    2049     __ call(Runtime1::entry_for(Runtime1::unwind_exception_id), relocInfo::runtime_call_type);
    2050     __ delayed()->nop();
    2051   } else {
    2052     // reuse the debug info from the safepoint poll for the throw op itself
    2053     address pc_for_athrow  = __ pc();
    2054     int pc_for_athrow_offset = __ offset();
    2055     RelocationHolder rspec = internal_word_Relocation::spec(pc_for_athrow);
    2056     __ set(pc_for_athrow, Oissuing_pc, rspec);
    2057     add_call_info(pc_for_athrow_offset, info); // for exception handler
    2058 
    2059     __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
    2060     __ delayed()->nop();
    2061   }
     2106  // reuse the debug info from the safepoint poll for the throw op itself
     2107  address pc_for_athrow  = __ pc();
     2108  int pc_for_athrow_offset = __ offset();
     2109  RelocationHolder rspec = internal_word_Relocation::spec(pc_for_athrow);
     2110  __ set(pc_for_athrow, Oissuing_pc, rspec);
     2111  add_call_info(pc_for_athrow_offset, info); // for exception handler
     2112
     2113  __ call(Runtime1::entry_for(Runtime1::handle_exception_id), relocInfo::runtime_call_type);
     2114  __ delayed()->nop();
     2115}
     2116
     2117
     2118void LIR_Assembler::unwind_op(LIR_Opr exceptionOop) {
     2119  assert(exceptionOop->as_register() == Oexception, "should match");
     2120
     2121  __ br(Assembler::always, false, Assembler::pt, _unwind_handler_entry);
     2122  __ delayed()->nop();
    20622123}
    20632124
     
    21722233    // but not necessarily exactly of type default_type.
    21732234    Label known_ok, halt;
    2174     jobject2reg(op->expected_type()->encoding(), tmp);
     2235    jobject2reg(op->expected_type()->constant_encoding(), tmp);
    21752236    __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2);
    21762237    if (basic_type != T_OBJECT) {
     
    22012262
    22022263  __ add(src, arrayOopDesc::base_offset_in_bytes(basic_type), src_ptr);
     2264  LP64_ONLY(__ sra(src_pos, 0, src_pos);) //higher 32bits must be null
    22032265  if (shift == 0) {
    22042266    __ add(src_ptr, src_pos, src_ptr);
     
    22092271
    22102272  __ add(dst, arrayOopDesc::base_offset_in_bytes(basic_type), dst_ptr);
     2273  LP64_ONLY(__ sra(dst_pos, 0, dst_pos);) //higher 32bits must be null
    22112274  if (shift == 0) {
    22122275    __ add(dst_ptr, dst_pos, dst_ptr);
     
    23462409      (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) ||
    23472410      (!UseFastNewTypeArray   && (op->type() != T_OBJECT && op->type() != T_ARRAY))) {
    2348     __ br(Assembler::always, false, Assembler::pn, *op->stub()->entry());
     2411    __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry());
    23492412    __ delayed()->nop();
    23502413  } else {
     
    24302493      Register mdo      = k_RInfo;
    24312494      Register data_val = Rtmp1;
    2432       jobject2reg(md->encoding(), mdo);
     2495      jobject2reg(md->constant_encoding(), mdo);
    24332496
    24342497      int mdo_offset_bias = 0;
     
    24532516    // so let's do it before loading the class
    24542517    if (k->is_loaded()) {
    2455       jobject2reg(k->encoding(), k_RInfo);
     2518      jobject2reg(k->constant_encoding(), k_RInfo);
    24562519    } else {
    24572520      jobject2reg_with_patching(k_RInfo, op->info_for_patch());
     
    25142577    // so let's do it before loading the class
    25152578    if (k->is_loaded()) {
    2516       jobject2reg(k->encoding(), k_RInfo);
     2579      jobject2reg(k->constant_encoding(), k_RInfo);
    25172580    } else {
    25182581      jobject2reg_with_patching(k_RInfo, op->info_for_patch());
     
    27182781  Register mdo  = op->mdo()->as_register();
    27192782  Register tmp1 = op->tmp1()->as_register();
    2720   jobject2reg(md->encoding(), mdo);
     2783  jobject2reg(md->constant_encoding(), mdo);
    27212784  int mdo_offset_bias = 0;
    27222785  if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) +
     
    27302793
    27312794  Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
    2732   __ lduw(counter_addr, tmp1);
    2733   __ add(tmp1, DataLayout::counter_increment, tmp1);
    2734   __ stw(tmp1, counter_addr);
    27352795  Bytecodes::Code bc = method->java_code_at_bci(bci);
    27362796  // Perform additional virtual call profiling for invokevirtual and
     
    27752835          Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) -
    27762836                            mdo_offset_bias);
    2777           jobject2reg(known_klass->encoding(), tmp1);
     2837          jobject2reg(known_klass->constant_encoding(), tmp1);
    27782838          __ st_ptr(tmp1, recv_addr);
    27792839          Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
     
    28222882        __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) -
    28232883                  mdo_offset_bias);
    2824         if (i < (VirtualCallData::row_limit() - 1)) {
    2825           __ br(Assembler::always, false, Assembler::pt, update_done);
    2826           __ delayed()->nop();
    2827         }
     2884        __ br(Assembler::always, false, Assembler::pt, update_done);
     2885        __ delayed()->nop();
    28282886        __ bind(next_test);
    28292887      }
     2888      // Receiver did not match any saved receiver and there is no empty row for it.
     2889      // Increment total counter to indicate polymorphic case.
     2890      __ lduw(counter_addr, tmp1);
     2891      __ add(tmp1, DataLayout::counter_increment, tmp1);
     2892      __ stw(tmp1, counter_addr);
    28302893
    28312894      __ bind(update_done);
    28322895    }
     2896  } else {
     2897    // Static call
     2898    __ lduw(counter_addr, tmp1);
     2899    __ add(tmp1, DataLayout::counter_increment, tmp1);
     2900    __ stw(tmp1, counter_addr);
    28332901  }
    28342902}
     
    28362904
    28372905void LIR_Assembler::align_backward_branch_target() {
    2838   __ align(16);
     2906  __ align(OptoLoopAlignment);
    28392907}
    28402908
     
    28602928  // we may also be emitting the call info for the instruction
    28612929  // which we are the delay slot of.
    2862   CodeEmitInfo * call_info = op->call_info();
     2930  CodeEmitInfo* call_info = op->call_info();
    28632931  if (call_info) {
    28642932    add_call_info(code_offset(), call_info);
     
    30853153              inst->at(i - 1)->print();
    30863154              inst->at(i)->print();
     3155              tty->cr();
    30873156            }
    30883157#endif
     
    31003169      case lir_virtual_call:
    31013170      case lir_icvirtual_call:
    3102       case lir_optvirtual_call: {
    3103         LIR_Op* delay_op = NULL;
     3171      case lir_optvirtual_call:
     3172      case lir_dynamic_call: {
    31043173        LIR_Op* prev = inst->at(i - 1);
    31053174        if (LIRFillDelaySlots && prev && prev->code() == lir_move && prev->info() == NULL &&
     
    31183187            inst->at(i - 1)->print();
    31193188            inst->at(i)->print();
     3189            tty->cr();
    31203190          }
    31213191#endif
     
    31233193        }
    31243194
    3125         if (!delay_op) {
    3126           delay_op = new LIR_OpDelay(new LIR_Op0(lir_nop), op->as_OpJavaCall()->info());
    3127           inst->insert_before(i + 1, delay_op);
    3128         }
     3195        LIR_Op* delay_op = new LIR_OpDelay(new LIR_Op0(lir_nop), op->as_OpJavaCall()->info());
     3196        inst->insert_before(i + 1, delay_op);
    31293197        break;
    31303198      }
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    145145    // apply the shift and accumulate the displacement
    146146    if (shift > 0) {
    147       LIR_Opr tmp = new_register(T_INT);
     147      LIR_Opr tmp = new_pointer_register();
    148148      __ shift_left(index, shift, tmp);
    149149      index = tmp;
    150150    }
    151151    if (disp != 0) {
    152       LIR_Opr tmp = new_register(T_INT);
     152      LIR_Opr tmp = new_pointer_register();
    153153      if (Assembler::is_simm13(disp)) {
    154         __ add(tmp, LIR_OprFact::intConst(disp), tmp);
     154        __ add(tmp, LIR_OprFact::intptrConst(disp), tmp);
    155155        index = tmp;
    156156      } else {
    157         __ move(LIR_OprFact::intConst(disp), tmp);
     157        __ move(LIR_OprFact::intptrConst(disp), tmp);
    158158        __ add(tmp, index, tmp);
    159159        index = tmp;
     
    163163  } else if (disp != 0 && !Assembler::is_simm13(disp)) {
    164164    // index is illegal so replace it with the displacement loaded into a register
    165     index = new_register(T_INT);
    166     __ move(LIR_OprFact::intConst(disp), index);
     165    index = new_pointer_register();
     166    __ move(LIR_OprFact::intptrConst(disp), index);
    167167    disp = 0;
    168168  }
     
    222222    LIR_Opr ptr = new_pointer_register();
    223223    __ add(base_opr, LIR_OprFact::intptrConst(offset), ptr);
    224     return new LIR_Address(ptr, 0, type);
     224    return new LIR_Address(ptr, type);
    225225  } else {
    226226    return new LIR_Address(base_opr, offset, type);
     
    232232  LIR_Opr pointer = new_pointer_register();
    233233  __ move(LIR_OprFact::intptrConst(counter), pointer);
    234   LIR_Address* addr = new LIR_Address(pointer, 0, T_INT);
     234  LIR_Address* addr = new LIR_Address(pointer, T_INT);
    235235  increment_counter(addr, step);
    236236}
     
    410410  LIR_Opr hdr       = FrameMap::G3_opr;
    411411  LIR_Opr obj_temp  = FrameMap::G4_opr;
    412   monitor_exit(obj_temp, lock, hdr, x->monitor_no());
     412  monitor_exit(obj_temp, lock, hdr, LIR_OprFact::illegalOpr, x->monitor_no());
    413413}
    414414
     
    897897  BasicType elem_type = x->elt_type();
    898898
    899   __ oop2reg(ciTypeArrayKlass::make(elem_type)->encoding(), klass_reg);
     899  __ oop2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg);
    900900
    901901  CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info);
     
    11601160        LIR_Opr tmp = new_pointer_register();
    11611161        __ add(base_op, index_op, tmp);
    1162         addr = new LIR_Address(tmp, 0, type);
     1162        addr = new LIR_Address(tmp, type);
    11631163      } else {
    11641164        addr = new LIR_Address(base_op, index_op, type);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    4040  align(CodeEntryAlignment);
    4141  bind(L);
    42 }
    43 
    44 
    45 void C1_MacroAssembler::method_exit(bool restore_frame) {
    46   // this code must be structured this way so that the return
    47   // instruction can be a safepoint.
    48   if (restore_frame) {
    49     restore();
    50   }
    51   retl();
    52   delayed()->nop();
    5342}
    5443
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1999-2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    678678
    679679        __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address),
    680                         Oissuing_pc->after_save());
     680                        G2_thread, Oissuing_pc->after_save());
    681681        __ verify_not_null_oop(Oexception->after_save());
    682         __ jmp(O0, 0);
    683         __ delayed()->restore();
     682
     683        // Restore SP from L7 if the exception PC is a MethodHandle call site.
     684        __ mov(O0, G5);  // Save the target address.
     685        __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), L0);
     686        __ tst(L0);  // Condition codes are preserved over the restore.
     687        __ restore();
     688
     689        __ jmp(G5, 0);
     690        __ delayed()->movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP);  // Restore SP if required.
    684691      }
    685692      break;
     
    986993void Runtime1::generate_handle_exception(StubAssembler* sasm, OopMapSet* oop_maps, OopMap* oop_map, bool) {
    987994  Label no_deopt;
    988   Label no_handler;
    989995
    990996  __ verify_not_null_oop(Oexception);
     
    10041010  // by entering the deopt blob with a pending exception.
    10051011
     1012#ifdef ASSERT
     1013  Label done;
    10061014  __ tst(O0);
    1007   __ br(Assembler::zero, false, Assembler::pn, no_handler);
     1015  __ br(Assembler::notZero, false, Assembler::pn, done);
    10081016  __ delayed()->nop();
     1017  __ stop("should have found address");
     1018  __ bind(done);
     1019#endif
    10091020
    10101021  // restore the registers that were saved at the beginning and jump to the exception handler.
     
    10141025  __ delayed()->restore();
    10151026
    1016   __ bind(no_handler);
    1017   __ mov(L0, I7); // restore return address
    1018 
    1019   // restore exception oop
    1020   __ ld_ptr(G2_thread, in_bytes(JavaThread::exception_oop_offset()), Oexception->after_save());
    1021   __ st_ptr(G0, G2_thread, in_bytes(JavaThread::exception_oop_offset()));
    1022 
    1023   __ restore();
    1024 
    1025   AddressLiteral exc(Runtime1::entry_for(Runtime1::unwind_exception_id));
    1026   __ jump_to(exc, G4);
    1027   __ delayed()->nop();
    1028 
    1029 
    10301027  oop_maps->add_gc_map(call_offset, oop_map);
    10311028}
     
    10351032
    10361033#define __ masm->
     1034
     1035const char *Runtime1::pd_name_for_address(address entry) {
     1036  return "<unknown function>";
     1037}
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    6161define_pd_global(intx, InteriorEntryAlignment,       16);  // = CodeEntryAlignment
    6262define_pd_global(intx, NewSizeThreadIncrease, ScaleForWordSize(4*K));
    63 // The default setting 16/16 seems to work best.
    64 // (For _228_jack 16/16 is 2% better than 4/4, 16/4, 32/32, 32/16, or 16/32.)
    65 define_pd_global(intx, OptoLoopAlignment,            16);  // = 4*wordSize
    6663define_pd_global(intx, RegisterCostAreaRatio,        12000);
    6764define_pd_global(bool, UseTLAB,                      true);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2000 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002-2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/copy_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    155155
    156156static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
    157   assert(MinObjAlignmentInBytes == BytesPerLong, "need alternate implementation");
     157  assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation");
    158158
    159159   julong* to = (julong*)tohw;
     
    163163   size_t odd = count % (BytesPerLong / HeapWordSize) ;
    164164
    165    size_t aligned_count = align_object_size(count - odd) / HeapWordsPerLong;
     165   size_t aligned_count = align_object_offset(count - odd) / HeapWordsPerLong;
    166166   julong* end = ((julong*)tohw) + aligned_count - 1;
    167167   while (to <= end) {
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2007-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    2727  // if too small.
    2828  // Run with +PrintInterpreter to get the VM to print out the size.
    29   // Max size with JVMTI and TaggedStackInterpreter
     29  // Max size with JVMTI
    3030
    3131  // QQQ this is proably way too large for c++ interpreter
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/debug_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1999-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/dump_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2004-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    337337}
    338338
    339 frame::frame(intptr_t* sp, intptr_t* younger_sp, bool younger_frame_adjusted_stack) {
    340   _sp = sp;
    341   _younger_sp = younger_sp;
     339frame::frame(intptr_t* sp, intptr_t* younger_sp, bool younger_frame_is_interpreted) :
     340  _sp(sp),
     341  _younger_sp(younger_sp),
     342  _deopt_state(unknown),
     343  _sp_adjustment_by_callee(0) {
    342344  if (younger_sp == NULL) {
    343345    // make a deficient frame which doesn't know where its PC is
     
    353355    // So do not put add any asserts on the _pc here.
    354356  }
    355   if (younger_frame_adjusted_stack) {
     357
     358  if (_pc != NULL)
     359    _cb = CodeCache::find_blob(_pc);
     360
     361  // Check for MethodHandle call sites.
     362  if (_cb != NULL) {
     363    nmethod* nm = _cb->as_nmethod_or_null();
     364    if (nm != NULL) {
     365      if (nm->is_deopt_mh_entry(_pc) || nm->is_method_handle_return(_pc)) {
     366        _sp_adjustment_by_callee = (intptr_t*) ((intptr_t) sp[L7_mh_SP_save->sp_offset_in_saved_window()] + STACK_BIAS) - sp;
     367        // The SP is already adjusted by this MH call site, don't
     368        // overwrite this value with the wrong interpreter value.
     369        younger_frame_is_interpreted = false;
     370      }
     371    }
     372  }
     373
     374  if (younger_frame_is_interpreted) {
    356375    // compute adjustment to this frame's SP made by its interpreted callee
    357     _sp_adjustment_by_callee = (intptr_t*)((intptr_t)younger_sp[I5_savedSP->sp_offset_in_saved_window()] +
    358                                              STACK_BIAS) - sp;
    359   } else {
    360     _sp_adjustment_by_callee = 0;
    361   }
    362 
    363   _deopt_state = unknown;
    364 
    365   // It is important that frame be fully construct when we do this lookup
    366   // as get_original_pc() needs correct value for unextended_sp()
     376    _sp_adjustment_by_callee = (intptr_t*) ((intptr_t) younger_sp[I5_savedSP->sp_offset_in_saved_window()] + STACK_BIAS) - sp;
     377  }
     378
     379  // It is important that the frame is fully constructed when we do
     380  // this lookup as get_deopt_original_pc() needs a correct value for
     381  // unextended_sp() which uses _sp_adjustment_by_callee.
    367382  if (_pc != NULL) {
    368     _cb = CodeCache::find_blob(_pc);
    369     if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
    370       _pc = ((nmethod*)_cb)->get_original_pc(this);
     383    address original_pc = nmethod::get_deopt_original_pc(this);
     384    if (original_pc != NULL) {
     385      _pc = original_pc;
    371386      _deopt_state = is_deoptimized;
    372387    } else {
     
    462477  if (is_entry_frame()) return sender_for_entry_frame(map);
    463478
    464   intptr_t* younger_sp     = sp();
    465   intptr_t* sp             = sender_sp();
    466   bool      adjusted_stack = false;
     479  intptr_t* younger_sp = sp();
     480  intptr_t* sp         = sender_sp();
    467481
    468482  // Note:  The version of this operation on any platform with callee-save
     
    483497  // explicitly recognized.
    484498
    485   adjusted_stack = is_interpreted_frame();
    486   if (adjusted_stack) {
     499  bool frame_is_interpreted = is_interpreted_frame();
     500  if (frame_is_interpreted) {
    487501    map->make_integer_regs_unsaved();
    488502    map->shift_window(sp, younger_sp);
     
    503517    }
    504518  }
    505   return frame(sp, younger_sp, adjusted_stack);
     519  return frame(sp, younger_sp, frame_is_interpreted);
    506520}
    507521
     
    520534  *O7_addr() = pc - pc_return_offset;
    521535  _cb = CodeCache::find_blob(_pc);
    522   if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) {
    523     address orig = ((nmethod*)_cb)->get_original_pc(this);
    524     assert(orig == _pc, "expected original to be stored before patching");
     536  address original_pc = nmethod::get_deopt_original_pc(this);
     537  if (original_pc != NULL) {
     538    assert(original_pc == _pc, "expected original to be stored before patching");
    525539    _deopt_state = is_deoptimized;
    526540  } else {
     
    620634  // stack frames shouldn't be much larger than max_stack elements
    621635
    622   if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize()) {
     636  if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
    623637    return false;
    624638  }
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1999-2004 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/globals_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    4141
    4242define_pd_global(intx, CodeEntryAlignment,    32);
     43// The default setting 16/16 seems to work best.
     44// (For _228_jack 16/16 is 2% better than 4/4, 16/4, 32/32, 32/16, or 16/32.)
     45define_pd_global(intx, OptoLoopAlignment,     16);  // = 4*wordSize
    4346define_pd_global(intx, InlineFrequencyCount,  50);  // we can use more inlining on the SPARC
    4447define_pd_global(intx, InlineSmallCode,       1500);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    5151  assert_different_registers(args_size, locals_size);
    5252  // max_locals*2 for TAGS.  Assumes that args_size has already been adjusted.
    53   if (TaggedStackInterpreter) sll(locals_size, 1, locals_size);
    5453  subcc(locals_size, args_size, delta);// extra space for non-arguments locals in words
    5554  // Use br/mov combination because it works on both V8 and V9 and is
     
    245244
    246245
    247 void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1) {
     246void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2) {
    248247  mov(arg_1, O0);
    249   MacroAssembler::call_VM_leaf_base(thread_cache, entry_point, 1);
     248  mov(arg_2, O1);
     249  MacroAssembler::call_VM_leaf_base(thread_cache, entry_point, 2);
    250250}
    251251#endif /* CC_INTERP */
     
    319319#else
    320320  ldf(FloatRegisterImpl::S, r1, offset, d);
    321   ldf(FloatRegisterImpl::S, r1, offset + Interpreter::stackElementSize(), d->successor());
     321  ldf(FloatRegisterImpl::S, r1, offset + Interpreter::stackElementSize, d->successor());
    322322#endif
    323323}
     
    330330  stf(FloatRegisterImpl::D, d, r1, offset);
    331331  // store something more useful here
    332   debug_only(stx(G0, r1, offset+Interpreter::stackElementSize());)
     332  debug_only(stx(G0, r1, offset+Interpreter::stackElementSize);)
    333333#else
    334334  stf(FloatRegisterImpl::S, d, r1, offset);
    335   stf(FloatRegisterImpl::S, d->successor(), r1, offset + Interpreter::stackElementSize());
     335  stf(FloatRegisterImpl::S, d->successor(), r1, offset + Interpreter::stackElementSize);
    336336#endif
    337337}
     
    345345#else
    346346  ld(r1, offset, rd);
    347   ld(r1, offset + Interpreter::stackElementSize(), rd->successor());
     347  ld(r1, offset + Interpreter::stackElementSize, rd->successor());
    348348#endif
    349349}
     
    356356  stx(l, r1, offset);
    357357  // store something more useful here
    358   debug_only(stx(G0, r1, offset+Interpreter::stackElementSize());)
     358  debug_only(stx(G0, r1, offset+Interpreter::stackElementSize);)
    359359#else
    360360  st(l, r1, offset);
    361   st(l->successor(), r1, offset + Interpreter::stackElementSize());
    362 #endif
    363 }
    364 
    365 #ifdef ASSERT
    366 void InterpreterMacroAssembler::verify_stack_tag(frame::Tag t,
    367                                                  Register r,
    368                                                  Register scratch) {
    369   if (TaggedStackInterpreter) {
    370     Label ok, long_ok;
    371     ld_ptr(Lesp, Interpreter::expr_tag_offset_in_bytes(0), r);
    372     if (t == frame::TagCategory2) {
    373       cmp(r, G0);
    374       brx(Assembler::equal, false, Assembler::pt, long_ok);
    375       delayed()->ld_ptr(Lesp, Interpreter::expr_tag_offset_in_bytes(1), r);
    376       stop("stack long/double tag value bad");
    377       bind(long_ok);
    378       cmp(r, G0);
    379     } else if (t == frame::TagValue) {
    380       cmp(r, G0);
    381     } else {
    382       assert_different_registers(r, scratch);
    383       mov(t, scratch);
    384       cmp(r, scratch);
    385     }
    386     brx(Assembler::equal, false, Assembler::pt, ok);
    387     delayed()->nop();
    388     // Also compare if the stack value is zero, then the tag might
    389     // not have been set coming from deopt.
    390     ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(0), r);
    391     cmp(r, G0);
    392     brx(Assembler::equal, false, Assembler::pt, ok);
    393     delayed()->nop();
    394     stop("Stack tag value is bad");
    395     bind(ok);
    396   }
    397 }
    398 #endif // ASSERT
     361  st(l->successor(), r1, offset + Interpreter::stackElementSize);
     362#endif
     363}
    399364
    400365void InterpreterMacroAssembler::pop_i(Register r) {
    401366  assert_not_delayed();
    402   // Uses destination register r for scratch
    403   debug_only(verify_stack_tag(frame::TagValue, r));
    404367  ld(Lesp, Interpreter::expr_offset_in_bytes(0), r);
    405   inc(Lesp, Interpreter::stackElementSize());
     368  inc(Lesp, Interpreter::stackElementSize);
    406369  debug_only(verify_esp(Lesp));
    407370}
     
    409372void InterpreterMacroAssembler::pop_ptr(Register r, Register scratch) {
    410373  assert_not_delayed();
    411   // Uses destination register r for scratch
    412   debug_only(verify_stack_tag(frame::TagReference, r, scratch));
    413374  ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(0), r);
    414   inc(Lesp, Interpreter::stackElementSize());
     375  inc(Lesp, Interpreter::stackElementSize);
    415376  debug_only(verify_esp(Lesp));
    416377}
     
    418379void InterpreterMacroAssembler::pop_l(Register r) {
    419380  assert_not_delayed();
    420   // Uses destination register r for scratch
    421   debug_only(verify_stack_tag(frame::TagCategory2, r));
    422381  load_unaligned_long(Lesp, Interpreter::expr_offset_in_bytes(0), r);
    423   inc(Lesp, 2*Interpreter::stackElementSize());
     382  inc(Lesp, 2*Interpreter::stackElementSize);
    424383  debug_only(verify_esp(Lesp));
    425384}
     
    428387void InterpreterMacroAssembler::pop_f(FloatRegister f, Register scratch) {
    429388  assert_not_delayed();
    430   debug_only(verify_stack_tag(frame::TagValue, scratch));
    431389  ldf(FloatRegisterImpl::S, Lesp, Interpreter::expr_offset_in_bytes(0), f);
    432   inc(Lesp, Interpreter::stackElementSize());
     390  inc(Lesp, Interpreter::stackElementSize);
    433391  debug_only(verify_esp(Lesp));
    434392}
     
    437395void InterpreterMacroAssembler::pop_d(FloatRegister f, Register scratch) {
    438396  assert_not_delayed();
    439   debug_only(verify_stack_tag(frame::TagCategory2, scratch));
    440397  load_unaligned_double(Lesp, Interpreter::expr_offset_in_bytes(0), f);
    441   inc(Lesp, 2*Interpreter::stackElementSize());
     398  inc(Lesp, 2*Interpreter::stackElementSize);
    442399  debug_only(verify_esp(Lesp));
    443400}
    444401
    445402
    446 // (Note use register first, then decrement so dec can be done during store stall)
    447 void InterpreterMacroAssembler::tag_stack(Register r) {
    448   if (TaggedStackInterpreter) {
    449     st_ptr(r, Lesp, Interpreter::tag_offset_in_bytes());
    450   }
    451 }
    452 
    453 void InterpreterMacroAssembler::tag_stack(frame::Tag t, Register r) {
    454   if (TaggedStackInterpreter) {
    455     assert (frame::TagValue == 0, "TagValue must be zero");
    456     if (t == frame::TagValue) {
    457       st_ptr(G0, Lesp, Interpreter::tag_offset_in_bytes());
    458     } else if (t == frame::TagCategory2) {
    459       st_ptr(G0, Lesp, Interpreter::tag_offset_in_bytes());
    460       // Tag next slot down too
    461       st_ptr(G0, Lesp, -Interpreter::stackElementSize() + Interpreter::tag_offset_in_bytes());
    462     } else {
    463       assert_different_registers(r, O3);
    464       mov(t, O3);
    465       st_ptr(O3, Lesp, Interpreter::tag_offset_in_bytes());
    466     }
    467   }
    468 }
    469 
    470403void InterpreterMacroAssembler::push_i(Register r) {
    471404  assert_not_delayed();
    472405  debug_only(verify_esp(Lesp));
    473   tag_stack(frame::TagValue, r);
    474   st(  r,    Lesp, Interpreter::value_offset_in_bytes());
    475   dec( Lesp, Interpreter::stackElementSize());
     406  st(r, Lesp, 0);
     407  dec(Lesp, Interpreter::stackElementSize);
    476408}
    477409
    478410void InterpreterMacroAssembler::push_ptr(Register r) {
    479411  assert_not_delayed();
    480   tag_stack(frame::TagReference, r);
    481   st_ptr(  r,    Lesp, Interpreter::value_offset_in_bytes());
    482   dec( Lesp, Interpreter::stackElementSize());
    483 }
    484 
    485 void InterpreterMacroAssembler::push_ptr(Register r, Register tag) {
    486   assert_not_delayed();
    487   tag_stack(tag);
    488   st_ptr(r, Lesp, Interpreter::value_offset_in_bytes());
    489   dec( Lesp, Interpreter::stackElementSize());
     412  st_ptr(r, Lesp, 0);
     413  dec(Lesp, Interpreter::stackElementSize);
    490414}
    491415
     
    497421  assert_not_delayed();
    498422  debug_only(verify_esp(Lesp));
    499   tag_stack(frame::TagCategory2, r);
    500   // Longs are in stored in memory-correct order, even if unaligned.
    501   // and may be separated by stack tags.
    502   int offset = -Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes();
     423  // Longs are stored in memory-correct order, even if unaligned.
     424  int offset = -Interpreter::stackElementSize;
    503425  store_unaligned_long(r, Lesp, offset);
    504   dec(Lesp, 2 * Interpreter::stackElementSize());
     426  dec(Lesp, 2 * Interpreter::stackElementSize);
    505427}
    506428
     
    509431  assert_not_delayed();
    510432  debug_only(verify_esp(Lesp));
    511   tag_stack(frame::TagValue, Otos_i);
    512   stf(FloatRegisterImpl::S, f, Lesp, Interpreter::value_offset_in_bytes());
    513   dec(Lesp, Interpreter::stackElementSize());
     433  stf(FloatRegisterImpl::S, f, Lesp, 0);
     434  dec(Lesp, Interpreter::stackElementSize);
    514435}
    515436
     
    518439  assert_not_delayed();
    519440  debug_only(verify_esp(Lesp));
    520   tag_stack(frame::TagCategory2, Otos_i);
    521   // Longs are in stored in memory-correct order, even if unaligned.
    522   // and may be separated by stack tags.
    523   int offset = -Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes();
     441  // Longs are stored in memory-correct order, even if unaligned.
     442  int offset = -Interpreter::stackElementSize;
    524443  store_unaligned_double(d, Lesp, offset);
    525   dec(Lesp, 2 * Interpreter::stackElementSize());
     444  dec(Lesp, 2 * Interpreter::stackElementSize);
    526445}
    527446
     
    561480
    562481
    563 // Tagged stack helpers for swap and dup
    564 void InterpreterMacroAssembler::load_ptr_and_tag(int n, Register val,
    565                                                  Register tag) {
     482// Helpers for swap and dup
     483void InterpreterMacroAssembler::load_ptr(int n, Register val) {
    566484  ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(n), val);
    567   if (TaggedStackInterpreter) {
    568     ld_ptr(Lesp, Interpreter::expr_tag_offset_in_bytes(n), tag);
    569   }
    570 }
    571 void InterpreterMacroAssembler::store_ptr_and_tag(int n, Register val,
    572                                                   Register tag) {
     485}
     486void InterpreterMacroAssembler::store_ptr(int n, Register val) {
    573487  st_ptr(val, Lesp, Interpreter::expr_offset_in_bytes(n));
    574   if (TaggedStackInterpreter) {
    575     st_ptr(tag, Lesp, Interpreter::expr_tag_offset_in_bytes(n));
    576   }
    577488}
    578489
     
    580491void InterpreterMacroAssembler::load_receiver(Register param_count,
    581492                                              Register recv) {
    582 
    583   sll(param_count, Interpreter::logStackElementSize(), param_count);
    584   if (TaggedStackInterpreter) {
    585     add(param_count, Interpreter::value_offset_in_bytes(), param_count);  // get obj address
    586   }
     493  sll(param_count, Interpreter::logStackElementSize, param_count);
    587494  ld_ptr(Lesp, param_count, recv);                      // gets receiver Oop
    588495}
     
    605512  // Compute max expression stack+register save area
    606513  lduh(Lmethod, in_bytes(methodOopDesc::max_stack_offset()), Gframe_size);  // Load max stack.
    607   if (TaggedStackInterpreter) sll ( Gframe_size, 1, Gframe_size);  // max_stack * 2 for TAGS
    608514  add( Gframe_size, frame::memory_parameter_word_sp_offset, Gframe_size );
    609515
     
    814720
    815721
    816 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset) {
     722void InterpreterMacroAssembler::get_cache_index_at_bcp(Register cache, Register tmp,
     723                                                       int bcp_offset, size_t index_size) {
     724  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
     725  if (index_size == sizeof(u2)) {
     726    get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
     727  } else if (index_size == sizeof(u4)) {
     728    assert(EnableInvokeDynamic, "giant index used only for EnableInvokeDynamic");
     729    get_4_byte_integer_at_bcp(bcp_offset, cache, tmp);
     730    assert(constantPoolCacheOopDesc::decode_secondary_index(~123) == 123, "else change next line");
     731    xor3(tmp, -1, tmp);  // convert to plain index
     732  } else if (index_size == sizeof(u1)) {
     733    assert(EnableMethodHandles, "tiny index used only for EnableMethodHandles");
     734    ldub(Lbcp, bcp_offset, tmp);
     735  } else {
     736    ShouldNotReachHere();
     737  }
     738}
     739
     740
     741void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp,
     742                                                           int bcp_offset, size_t index_size) {
    817743  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
    818744  assert_different_registers(cache, tmp);
    819745  assert_not_delayed();
    820   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
    821               // convert from field index to ConstantPoolCacheEntry index
    822               // and from word index to byte offset
     746  get_cache_index_at_bcp(cache, tmp, bcp_offset, index_size);
     747  // convert from field index to ConstantPoolCacheEntry index and from
     748  // word index to byte offset
    823749  sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
    824750  add(LcpoolCache, tmp, cache);
     
    826752
    827753
    828 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) {
     754void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp,
     755                                                               int bcp_offset, size_t index_size) {
    829756  assert(bcp_offset > 0, "bcp is still pointing to start of bytecode");
    830757  assert_different_registers(cache, tmp);
    831758  assert_not_delayed();
    832   get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
     759  if (index_size == sizeof(u2)) {
     760    get_2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);
     761  } else {
     762    ShouldNotReachHere();  // other sizes not supported here
     763  }
    833764              // convert from field index to ConstantPoolCacheEntry index
    834765              // and from word index to byte offset
     
    16751606
    16761607void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
    1677                                                      Register scratch) {
     1608                                                     Register scratch,
     1609                                                     bool receiver_can_be_null) {
    16781610  if (ProfileInterpreter) {
    16791611    Label profile_continue;
     
    16821614    test_method_data_pointer(profile_continue);
    16831615
    1684     // We are making a call.  Increment the count.
    1685     increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
     1616
     1617    Label skip_receiver_profile;
     1618    if (receiver_can_be_null) {
     1619      Label not_null;
     1620      tst(receiver);
     1621      brx(Assembler::notZero, false, Assembler::pt, not_null);
     1622      delayed()->nop();
     1623      // We are making a call.  Increment the count for null receiver.
     1624      increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
     1625      ba(false, skip_receiver_profile);
     1626      delayed()->nop();
     1627      bind(not_null);
     1628    }
    16861629
    16871630    // Record the receiver type.
    1688     record_klass_in_profile(receiver, scratch);
     1631    record_klass_in_profile(receiver, scratch, true);
     1632    bind(skip_receiver_profile);
    16891633
    16901634    // The method data pointer needs to be updated to reflect the new target.
     
    16961640void InterpreterMacroAssembler::record_klass_in_profile_helper(
    16971641                                        Register receiver, Register scratch,
    1698                                         int start_row, Label& done) {
    1699   if (TypeProfileWidth == 0)
     1642                                        int start_row, Label& done, bool is_virtual_call) {
     1643  if (TypeProfileWidth == 0) {
     1644    if (is_virtual_call) {
     1645      increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
     1646    }
    17001647    return;
     1648  }
    17011649
    17021650  int last_row = VirtualCallData::row_limit() - 1;
     
    17151663    int recvr_offset = in_bytes(VirtualCallData::receiver_offset(row));
    17161664    test_mdp_data_at(recvr_offset, receiver, next_test, scratch);
     1665    // delayed()->tst(scratch);
    17171666
    17181667    // The receiver is receiver[n].  Increment count[n].
     
    17241673
    17251674    if (test_for_null_also) {
     1675      Label found_null;
    17261676      // Failed the equality check on receiver[n]...  Test for null.
    17271677      if (start_row == last_row) {
    17281678        // The only thing left to do is handle the null case.
    1729         brx(Assembler::notZero, false, Assembler::pt, done);
    1730         delayed()->nop();
     1679        if (is_virtual_call) {
     1680          brx(Assembler::zero, false, Assembler::pn, found_null);
     1681          delayed()->nop();
     1682          // Receiver did not match any saved receiver and there is no empty row for it.
     1683          // Increment total counter to indicate polymorphic case.
     1684          increment_mdp_data_at(in_bytes(CounterData::count_offset()), scratch);
     1685          ba(false, done);
     1686          delayed()->nop();
     1687          bind(found_null);
     1688        } else {
     1689          brx(Assembler::notZero, false, Assembler::pt, done);
     1690          delayed()->nop();
     1691        }
    17311692        break;
    17321693      }
    17331694      // Since null is rare, make it be the branch-taken case.
    1734       Label found_null;
    17351695      brx(Assembler::zero, false, Assembler::pn, found_null);
    17361696      delayed()->nop();
    17371697
    17381698      // Put all the "Case 3" tests here.
    1739       record_klass_in_profile_helper(receiver, scratch, start_row + 1, done);
     1699      record_klass_in_profile_helper(receiver, scratch, start_row + 1, done, is_virtual_call);
    17401700
    17411701      // Found a null.  Keep searching for a matching receiver,
     
    17541714  mov(DataLayout::counter_increment, scratch);
    17551715  set_mdp_data_at(count_offset, scratch);
    1756   ba(false, done);
    1757   delayed()->nop();
     1716  if (start_row > 0) {
     1717    ba(false, done);
     1718    delayed()->nop();
     1719  }
    17581720}
    17591721
    17601722void InterpreterMacroAssembler::record_klass_in_profile(Register receiver,
    1761                                                         Register scratch) {
     1723                                                        Register scratch, bool is_virtual_call) {
    17621724  assert(ProfileInterpreter, "must be profiling");
    17631725  Label done;
    17641726
    1765   record_klass_in_profile_helper(receiver, scratch, 0, done);
     1727  record_klass_in_profile_helper(receiver, scratch, 0, done, is_virtual_call);
    17661728
    17671729  bind (done);
     
    18411803
    18421804      // Record the object type.
    1843       record_klass_in_profile(klass, scratch);
     1805      record_klass_in_profile(klass, scratch, false);
    18441806    }
    18451807
     
    19701932
    19711933// Locals
    1972 #ifdef ASSERT
    1973 void InterpreterMacroAssembler::verify_local_tag(frame::Tag t,
    1974                                                  Register base,
    1975                                                  Register scratch,
    1976                                                  int n) {
    1977   if (TaggedStackInterpreter) {
    1978     Label ok, long_ok;
    1979     // Use dst for scratch
    1980     assert_different_registers(base, scratch);
    1981     ld_ptr(base, Interpreter::local_tag_offset_in_bytes(n), scratch);
    1982     if (t == frame::TagCategory2) {
    1983       cmp(scratch, G0);
    1984       brx(Assembler::equal, false, Assembler::pt, long_ok);
    1985       delayed()->ld_ptr(base, Interpreter::local_tag_offset_in_bytes(n+1), scratch);
    1986       stop("local long/double tag value bad");
    1987       bind(long_ok);
    1988       // compare second half tag
    1989       cmp(scratch, G0);
    1990     } else if (t == frame::TagValue) {
    1991       cmp(scratch, G0);
    1992     } else {
    1993       assert_different_registers(O3, base, scratch);
    1994       mov(t, O3);
    1995       cmp(scratch, O3);
    1996     }
    1997     brx(Assembler::equal, false, Assembler::pt, ok);
    1998     delayed()->nop();
    1999     // Also compare if the local value is zero, then the tag might
    2000     // not have been set coming from deopt.
    2001     ld_ptr(base, Interpreter::local_offset_in_bytes(n), scratch);
    2002     cmp(scratch, G0);
    2003     brx(Assembler::equal, false, Assembler::pt, ok);
    2004     delayed()->nop();
    2005     stop("Local tag value is bad");
    2006     bind(ok);
    2007   }
    2008 }
    2009 #endif // ASSERT
    2010 
    20111934void InterpreterMacroAssembler::access_local_ptr( Register index, Register dst ) {
    20121935  assert_not_delayed();
    2013   sll(index, Interpreter::logStackElementSize(), index);
     1936  sll(index, Interpreter::logStackElementSize, index);
    20141937  sub(Llocals, index, index);
    2015   debug_only(verify_local_tag(frame::TagReference, index, dst));
    2016   ld_ptr(index, Interpreter::value_offset_in_bytes(), dst);
     1938  ld_ptr(index, 0, dst);
    20171939  // Note:  index must hold the effective address--the iinc template uses it
    20181940}
     
    20221944                                                           Register dst ) {
    20231945  assert_not_delayed();
    2024   sll(index, Interpreter::logStackElementSize(), index);
     1946  sll(index, Interpreter::logStackElementSize, index);
    20251947  sub(Llocals, index, index);
    2026   debug_only(verify_local_tag(frame::TagValue, index, dst));
    2027   ld_ptr(index, Interpreter::value_offset_in_bytes(), dst);
     1948  ld_ptr(index, 0, dst);
    20281949}
    20291950
    20301951void InterpreterMacroAssembler::access_local_int( Register index, Register dst ) {
    20311952  assert_not_delayed();
    2032   sll(index, Interpreter::logStackElementSize(), index);
     1953  sll(index, Interpreter::logStackElementSize, index);
    20331954  sub(Llocals, index, index);
    2034   debug_only(verify_local_tag(frame::TagValue, index, dst));
    2035   ld(index, Interpreter::value_offset_in_bytes(), dst);
     1955  ld(index, 0, dst);
    20361956  // Note:  index must hold the effective address--the iinc template uses it
    20371957}
     
    20401960void InterpreterMacroAssembler::access_local_long( Register index, Register dst ) {
    20411961  assert_not_delayed();
    2042   sll(index, Interpreter::logStackElementSize(), index);
     1962  sll(index, Interpreter::logStackElementSize, index);
    20431963  sub(Llocals, index, index);
    2044   debug_only(verify_local_tag(frame::TagCategory2, index, dst));
    20451964  // First half stored at index n+1 (which grows down from Llocals[n])
    20461965  load_unaligned_long(index, Interpreter::local_offset_in_bytes(1), dst);
     
    20501969void InterpreterMacroAssembler::access_local_float( Register index, FloatRegister dst ) {
    20511970  assert_not_delayed();
    2052   sll(index, Interpreter::logStackElementSize(), index);
     1971  sll(index, Interpreter::logStackElementSize, index);
    20531972  sub(Llocals, index, index);
    2054   debug_only(verify_local_tag(frame::TagValue, index, G1_scratch));
    2055   ldf(FloatRegisterImpl::S, index, Interpreter::value_offset_in_bytes(), dst);
     1973  ldf(FloatRegisterImpl::S, index, 0, dst);
    20561974}
    20571975
     
    20591977void InterpreterMacroAssembler::access_local_double( Register index, FloatRegister dst ) {
    20601978  assert_not_delayed();
    2061   sll(index, Interpreter::logStackElementSize(), index);
     1979  sll(index, Interpreter::logStackElementSize, index);
    20621980  sub(Llocals, index, index);
    2063   debug_only(verify_local_tag(frame::TagCategory2, index, G1_scratch));
    20641981  load_unaligned_double(index, Interpreter::local_offset_in_bytes(1), dst);
    20651982}
     
    20872004#endif // ASSERT
    20882005
    2089 void InterpreterMacroAssembler::tag_local(frame::Tag t,
    2090                                           Register base,
    2091                                           Register src,
    2092                                           int n) {
    2093   if (TaggedStackInterpreter) {
    2094     // have to store zero because local slots can be reused (rats!)
    2095     if (t == frame::TagValue) {
    2096       st_ptr(G0, base, Interpreter::local_tag_offset_in_bytes(n));
    2097     } else if (t == frame::TagCategory2) {
    2098       st_ptr(G0, base, Interpreter::local_tag_offset_in_bytes(n));
    2099       st_ptr(G0, base, Interpreter::local_tag_offset_in_bytes(n+1));
    2100     } else {
    2101       // assert that we don't stomp the value in 'src'
    2102       // O3 is arbitrary because it's not used.
    2103       assert_different_registers(src, base, O3);
    2104       mov( t, O3);
    2105       st_ptr(O3, base, Interpreter::local_tag_offset_in_bytes(n));
    2106     }
    2107   }
    2108 }
    2109 
    21102006
    21112007void InterpreterMacroAssembler::store_local_int( Register index, Register src ) {
    21122008  assert_not_delayed();
    2113   sll(index, Interpreter::logStackElementSize(), index);
     2009  sll(index, Interpreter::logStackElementSize, index);
    21142010  sub(Llocals, index, index);
    2115   debug_only(check_for_regarea_stomp(index, Interpreter::value_offset_in_bytes(), FP, G1_scratch, G4_scratch);)
    2116   tag_local(frame::TagValue, index, src);
    2117   st(src, index, Interpreter::value_offset_in_bytes());
    2118 }
    2119 
    2120 void InterpreterMacroAssembler::store_local_ptr( Register index, Register src,
    2121                                                  Register tag ) {
    2122   assert_not_delayed();
    2123   sll(index, Interpreter::logStackElementSize(), index);
     2011  debug_only(check_for_regarea_stomp(index, 0, FP, G1_scratch, G4_scratch);)
     2012  st(src, index, 0);
     2013}
     2014
     2015void InterpreterMacroAssembler::store_local_ptr( Register index, Register src ) {
     2016  assert_not_delayed();
     2017  sll(index, Interpreter::logStackElementSize, index);
    21242018  sub(Llocals, index, index);
    2125   #ifdef ASSERT
    2126   check_for_regarea_stomp(index, Interpreter::value_offset_in_bytes(), FP, G1_scratch, G4_scratch);
    2127   #endif
    2128   st_ptr(src, index, Interpreter::value_offset_in_bytes());
    2129   // Store tag register directly
    2130   if (TaggedStackInterpreter) {
    2131     st_ptr(tag, index, Interpreter::tag_offset_in_bytes());
    2132   }
    2133 }
    2134 
    2135 
    2136 
    2137 void InterpreterMacroAssembler::store_local_ptr( int n, Register src,
    2138                                                  Register tag ) {
    2139   st_ptr(src,  Llocals, Interpreter::local_offset_in_bytes(n));
    2140   if (TaggedStackInterpreter) {
    2141     st_ptr(tag, Llocals, Interpreter::local_tag_offset_in_bytes(n));
    2142   }
     2019#ifdef ASSERT
     2020  check_for_regarea_stomp(index, 0, FP, G1_scratch, G4_scratch);
     2021#endif
     2022  st_ptr(src, index, 0);
     2023}
     2024
     2025
     2026
     2027void InterpreterMacroAssembler::store_local_ptr( int n, Register src ) {
     2028  st_ptr(src, Llocals, Interpreter::local_offset_in_bytes(n));
    21432029}
    21442030
    21452031void InterpreterMacroAssembler::store_local_long( Register index, Register src ) {
    21462032  assert_not_delayed();
    2147   sll(index, Interpreter::logStackElementSize(), index);
     2033  sll(index, Interpreter::logStackElementSize, index);
    21482034  sub(Llocals, index, index);
    2149   #ifdef ASSERT
     2035#ifdef ASSERT
    21502036  check_for_regarea_stomp(index, Interpreter::local_offset_in_bytes(1), FP, G1_scratch, G4_scratch);
    2151   #endif
    2152   tag_local(frame::TagCategory2, index, src);
     2037#endif
    21532038  store_unaligned_long(src, index, Interpreter::local_offset_in_bytes(1)); // which is n+1
    21542039}
     
    21572042void InterpreterMacroAssembler::store_local_float( Register index, FloatRegister src ) {
    21582043  assert_not_delayed();
    2159   sll(index, Interpreter::logStackElementSize(), index);
     2044  sll(index, Interpreter::logStackElementSize, index);
    21602045  sub(Llocals, index, index);
    2161   #ifdef ASSERT
    2162   check_for_regarea_stomp(index, Interpreter::value_offset_in_bytes(), FP, G1_scratch, G4_scratch);
    2163   #endif
    2164   tag_local(frame::TagValue, index, G1_scratch);
    2165   stf(FloatRegisterImpl::S, src, index, Interpreter::value_offset_in_bytes());
     2046#ifdef ASSERT
     2047  check_for_regarea_stomp(index, 0, FP, G1_scratch, G4_scratch);
     2048#endif
     2049  stf(FloatRegisterImpl::S, src, index, 0);
    21662050}
    21672051
     
    21692053void InterpreterMacroAssembler::store_local_double( Register index, FloatRegister src ) {
    21702054  assert_not_delayed();
    2171   sll(index, Interpreter::logStackElementSize(), index);
     2055  sll(index, Interpreter::logStackElementSize, index);
    21722056  sub(Llocals, index, index);
    2173   #ifdef ASSERT
     2057#ifdef ASSERT
    21742058  check_for_regarea_stomp(index, Interpreter::local_offset_in_bytes(1), FP, G1_scratch, G4_scratch);
    2175   #endif
    2176   tag_local(frame::TagCategory2, index, G1_scratch);
     2059#endif
    21772060  store_unaligned_double(src, index, Interpreter::local_offset_in_bytes(1));
    21782061}
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    122122
    123123#ifndef CC_INTERP
    124   void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1);
     124  void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2);
    125125
    126126  // Generate a subtype check: branch to ok_is_subtype if sub_klass is
     
    150150  void push_i(     Register r = Otos_i);
    151151  void push_ptr(   Register r = Otos_i);
    152   void push_ptr(   Register r, Register tag);
    153152  void push_l(     Register r = Otos_l1);
    154153  void push_f(FloatRegister f = Ftos_f);
     
    160159  void empty_expression_stack();       // resets both Lesp and SP
    161160
    162   // Support for Tagged Stacks
    163   void tag_stack(frame::Tag t, Register r);
    164   void tag_stack(Register tag);
    165   void tag_local(frame::Tag t, Register src, Register base, int n = 0);
    166 
    167161#ifdef ASSERT
    168162  void verify_sp(Register Rsp, Register Rtemp);
    169163  void verify_esp(Register Resp);      // verify that Lesp points to a word in the temp stack
    170 
    171   void verify_stack_tag(frame::Tag t, Register r, Register scratch = G0);
    172   void verify_local_tag(frame::Tag t, Register base, Register scr, int n = 0);
    173164#endif // ASSERT
    174165
     
    192183                                  setCCOrNot should_set_CC = dont_set_CC );
    193184
    194   void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset);
    195   void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset);
     185  void get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
     186  void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
     187  void get_cache_index_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2));
    196188
    197189
     
    242234#endif // ASSERT
    243235  void store_local_int( Register index, Register src );
    244   void store_local_ptr( Register index, Register src, Register tag = Otos_l2 );
    245   void store_local_ptr( int n, Register src, Register tag = Otos_l2 );
     236  void store_local_ptr( Register index, Register src );
     237  void store_local_ptr( int n, Register src );
    246238  void store_local_long( Register index, Register src );
    247239  void store_local_float( Register index, FloatRegister src );
    248240  void store_local_double( Register index, FloatRegister src );
    249241
    250   // Tagged stack helpers for swap and dup
    251   void load_ptr_and_tag(int n, Register val, Register tag);
    252   void store_ptr_and_tag(int n, Register val, Register tag);
    253 
    254   // Tagged stack helper for getting receiver in register.
     242  // Helpers for swap and dup
     243  void load_ptr(int n, Register val);
     244  void store_ptr(int n, Register val);
     245
     246  // Helper for getting receiver in register.
    255247  void load_receiver(Register param_count, Register recv);
    256248
     
    291283                        Register scratch);
    292284
    293   void record_klass_in_profile(Register receiver, Register scratch);
     285  void record_klass_in_profile(Register receiver, Register scratch, bool is_virtual_call);
    294286  void record_klass_in_profile_helper(Register receiver, Register scratch,
    295                                       int start_row, Label& done);
     287                                      int start_row, Label& done, bool is_virtual_call);
    296288
    297289  void update_mdp_by_offset(int offset_of_disp, Register scratch);
     
    305297  void profile_call(Register scratch);
    306298  void profile_final_call(Register scratch);
    307   void profile_virtual_call(Register receiver, Register scratch);
     299  void profile_virtual_call(Register receiver, Register scratch, bool receiver_can_be_null = false);
    308300  void profile_ret(TosState state, Register return_bci, Register scratch);
    309301  void profile_null_seen(Register scratch);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    4444  Register  Rtmp = O0;
    4545
    46 #ifdef ASSERT
    47   if (TaggedStackInterpreter) {
    48     // check at least one tag is okay
    49     Label ok;
    50     __ ld_ptr(Llocals, Interpreter::local_tag_offset_in_bytes(offset() + 1), Rtmp);
    51     __ cmp(Rtmp, G0);
    52     __ brx(Assembler::equal, false, Assembler::pt, ok);
    53     __ delayed()->nop();
    54     __ stop("Native object has bad tag value");
    55     __ bind(ok);
    56   }
    57 #endif // ASSERT
    58 
    5946#ifdef _LP64
    6047  __ ldx(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp);
     
    7057
    7158
    72 #ifdef _LP64
    7359void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
    7460  Argument  jni_arg(jni_offset(), false);
     61#ifdef _LP64
    7562  FloatRegister  Rtmp = F0;
    7663  __ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
    7764  __ store_float_argument(Rtmp, jni_arg);
    78 }
     65#else
     66  Register     Rtmp = O0;
     67  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
     68  __ store_argument(Rtmp, jni_arg);
    7969#endif
     70}
    8071
    8172
     
    10899  Address     h_arg = Address(Llocals, Interpreter::local_offset_in_bytes(offset()));
    109100  __ ld_ptr(h_arg, Rtmp1);
    110 #ifdef ASSERT
    111   if (TaggedStackInterpreter) {
    112     // check we have the obj and not the tag
    113     Label ok;
    114     __ mov(frame::TagReference, Rtmp3);
    115     __ cmp(Rtmp1, Rtmp3);
    116     __ brx(Assembler::notEqual, true, Assembler::pt, ok);
    117     __ delayed()->nop();
    118     __ stop("Native object passed tag by mistake");
    119     __ bind(ok);
    120   }
    121 #endif // ASSERT
    122101  if (!do_NULL_check) {
    123102    __ add(h_arg.base(), h_arg.disp(), Rtmp2);
     
    169148  };
    170149
    171 #ifdef ASSERT
    172   void verify_tag(frame::Tag t) {
    173     assert(!TaggedStackInterpreter ||
    174            *(intptr_t*)(_from+Interpreter::local_tag_offset_in_bytes(0)) == t, "wrong tag");
    175   }
    176 #endif // ASSERT
    177 
    178150  virtual void pass_int() {
    179151    *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
    180     debug_only(verify_tag(frame::TagValue));
    181     _from -= Interpreter::stackElementSize();
     152    _from -= Interpreter::stackElementSize;
    182153    add_signature( non_float );
    183154  }
     
    187158    intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0));
    188159    *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr;
    189     debug_only(verify_tag(frame::TagReference));
    190     _from -= Interpreter::stackElementSize();
     160    _from -= Interpreter::stackElementSize;
    191161    add_signature( non_float );
    192162   }
     
    195165  virtual void pass_float()  {
    196166    *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
    197     debug_only(verify_tag(frame::TagValue));
    198     _from -= Interpreter::stackElementSize();
     167    _from -= Interpreter::stackElementSize;
    199168    add_signature( float_sig );
    200169   }
     
    202171  virtual void pass_double() {
    203172    *_to++ = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
    204     debug_only(verify_tag(frame::TagValue));
    205     _from -= 2*Interpreter::stackElementSize();
     173    _from -= 2*Interpreter::stackElementSize;
    206174   add_signature( double_sig );
    207175   }
     
    209177  virtual void pass_long() {
    210178    _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
    211     debug_only(verify_tag(frame::TagValue));
    212179    _to += 1;
    213     _from -= 2*Interpreter::stackElementSize();
     180    _from -= 2*Interpreter::stackElementSize;
    214181    add_signature( long_sig );
    215182  }
     
    219186    _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
    220187    _to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0));
    221     debug_only(verify_tag(frame::TagValue));
    222188    _to += 2;
    223     _from -= 2*Interpreter::stackElementSize();
    224     add_signature( non_float );
    225   }
     189    _from -= 2*Interpreter::stackElementSize;
     190    add_signature( non_float );
     191  }
     192
     193  virtual void pass_float() {
     194    *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
     195    _from -= Interpreter::stackElementSize;
     196    add_signature( non_float );
     197  }
     198
    226199#endif // _LP64
    227200
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1998-2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    236236
    237237
    238 
    239238// Method handle invoker
    240239// Dispatch a method of the form java.dyn.MethodHandles::invoke(...)
     
    243242    return generate_abstract_entry();
    244243  }
    245   return generate_abstract_entry(); //6815692//
    246 }
    247 
    248 
     244
     245  return MethodHandles::generate_method_handle_interpreter_entry(_masm);
     246}
    249247
    250248
     
    395393
    396394
     395bool AbstractInterpreter::can_be_compiled(methodHandle m) {
     396  // No special entry points that preclude compilation
     397  return true;
     398}
     399
    397400// This method tells the deoptimizer how big an interpreted frame must be:
    398401int AbstractInterpreter::size_activation(methodOop method,
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    2525 public:
    2626
    27   // Support for Tagged Stacks
     27  static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; }
    2828
    2929  // Stack index relative to tos (which points at value)
    30   static int expr_index_at(int i)     {
    31     return stackElementWords() * i;
    32   }
    33 
    34   static int expr_tag_index_at(int i) {
    35     assert(TaggedStackInterpreter, "should not call this");
    36     // tag is one word above java stack element
    37     return stackElementWords() * i + 1;
    38   }
    39 
    40   static int expr_offset_in_bytes(int i) { return stackElementSize()*i + wordSize; }
    41   static int expr_tag_offset_in_bytes (int i) {
    42     assert(TaggedStackInterpreter, "should not call this");
    43     return expr_offset_in_bytes(i) + wordSize;
    44   }
     30  static int expr_index_at(int i)        { return stackElementWords * i; }
    4531
    4632  // Already negated by c++ interpreter
    47   static int local_index_at(int i)     {
    48     assert(i<=0, "local direction already negated");
    49     return stackElementWords() * i + (value_offset_in_bytes()/wordSize);
     33  static int local_index_at(int i) {
     34    assert(i <= 0, "local direction already negated");
     35    return stackElementWords * i;
    5036  }
    51 
    52   static int local_tag_index_at(int i) {
    53     assert(i<=0, "local direction already negated");
    54     assert(TaggedStackInterpreter, "should not call this");
    55     return stackElementWords() * i + (tag_offset_in_bytes()/wordSize);
    56   }
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2002-2005 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    7777  void set_last_Java_sp(intptr_t* sp)            { _last_Java_sp = sp; }
    7878
     79  address last_Java_pc(void)                     { return _last_Java_pc; }
     80
    7981  // These are only used by friends
    8082private:
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2004-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1998-2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/jni_sparc.h

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
    55 * This code is free software; you can redistribute it and/or modify it
    66 * under the terms of the GNU General Public License version 2 only, as
    7  * published by the Free Software Foundation.  Sun designates this
     7 * published by the Free Software Foundation.  Oracle designates this
    88 * particular file as subject to the "Classpath" exception as provided
    9  * by Sun in the LICENSE file that accompanied this code.
     9 * by Oracle in the LICENSE file that accompanied this code.
    1010 *
    1111 * This code is distributed in the hope that it will be useful, but WITHOUT
     
    1919 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2020 *
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
     21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22 * or visit www.oracle.com if you need additional information or have any
     23 * questions.
    2424 */
    2525
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    3030address MethodHandleEntry::start_compiled_entry(MacroAssembler* _masm,
    3131                                                address interpreted_entry) {
     32  // Just before the actual machine code entry point, allocate space
     33  // for a MethodHandleEntry::Data record, so that we can manage everything
     34  // from one base pointer.
    3235  __ align(wordSize);
    3336  address target = __ pc() + sizeof(Data);
     
    6063// Code generation
    6164address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* _masm) {
    62   ShouldNotReachHere(); //NYI, 6815692
    63   return NULL;
     65  // I5_savedSP: sender SP (must preserve)
     66  // G4 (Gargs): incoming argument list (must preserve)
     67  // G5_method:  invoke methodOop; becomes method type.
     68  // G3_method_handle: receiver method handle (must load from sp[MethodTypeForm.vmslots])
     69  // O0, O1: garbage temps, blown away
     70  Register O0_argslot = O0;
     71  Register O1_scratch = O1;
     72
     73  // emit WrongMethodType path first, to enable back-branch from main path
     74  Label wrong_method_type;
     75  __ bind(wrong_method_type);
     76  __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch);
     77  __ delayed()->nop();
     78
     79  // here's where control starts out:
     80  __ align(CodeEntryAlignment);
     81  address entry_point = __ pc();
     82
     83  // fetch the MethodType from the method handle into G5_method_type
     84  {
     85    Register tem = G5_method;
     86    assert(tem == G5_method_type, "yes, it's the same register");
     87    for (jint* pchase = methodOopDesc::method_type_offsets_chain(); (*pchase) != -1; pchase++) {
     88      __ ld_ptr(Address(tem, *pchase), G5_method_type);
     89    }
     90  }
     91
     92  // given the MethodType, find out where the MH argument is buried
     93  __ ld_ptr(Address(G5_method_type, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)),        O0_argslot);
     94  __ ldsw(  Address(O0_argslot,     __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O0_argslot);
     95  __ ld_ptr(__ argument_address(O0_argslot), G3_method_handle);
     96
     97  __ check_method_handle_type(G5_method_type, G3_method_handle, O1_scratch, wrong_method_type);
     98  __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     99
     100  return entry_point;
    64101}
    65102
     103
     104#ifdef ASSERT
     105static void verify_argslot(MacroAssembler* _masm, Register argslot_reg, Register temp_reg, const char* error_message) {
     106  // Verify that argslot lies within (Gargs, FP].
     107  Label L_ok, L_bad;
     108#ifdef _LP64
     109  __ add(FP, STACK_BIAS, temp_reg);
     110  __ cmp(argslot_reg, temp_reg);
     111#else
     112  __ cmp(argslot_reg, FP);
     113#endif
     114  __ brx(Assembler::greaterUnsigned, false, Assembler::pn, L_bad);
     115  __ delayed()->nop();
     116  __ cmp(Gargs, argslot_reg);
     117  __ brx(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok);
     118  __ delayed()->nop();
     119  __ bind(L_bad);
     120  __ stop(error_message);
     121  __ bind(L_ok);
     122}
     123#endif
     124
     125
     126// Helper to insert argument slots into the stack.
     127// arg_slots must be a multiple of stack_move_unit() and <= 0
     128void MethodHandles::insert_arg_slots(MacroAssembler* _masm,
     129                                     RegisterOrConstant arg_slots,
     130                                     int arg_mask,
     131                                     Register argslot_reg,
     132                                     Register temp_reg, Register temp2_reg, Register temp3_reg) {
     133  assert(temp3_reg != noreg, "temp3 required");
     134  assert_different_registers(argslot_reg, temp_reg, temp2_reg, temp3_reg,
     135                             (!arg_slots.is_register() ? Gargs : arg_slots.as_register()));
     136
     137#ifdef ASSERT
     138  verify_argslot(_masm, argslot_reg, temp_reg, "insertion point must fall within current frame");
     139  if (arg_slots.is_register()) {
     140    Label L_ok, L_bad;
     141    __ cmp(arg_slots.as_register(), (int32_t) NULL_WORD);
     142    __ br(Assembler::greater, false, Assembler::pn, L_bad);
     143    __ delayed()->nop();
     144    __ btst(-stack_move_unit() - 1, arg_slots.as_register());
     145    __ br(Assembler::zero, false, Assembler::pt, L_ok);
     146    __ delayed()->nop();
     147    __ bind(L_bad);
     148    __ stop("assert arg_slots <= 0 and clear low bits");
     149    __ bind(L_ok);
     150  } else {
     151    assert(arg_slots.as_constant() <= 0, "");
     152    assert(arg_slots.as_constant() % -stack_move_unit() == 0, "");
     153  }
     154#endif // ASSERT
     155
     156#ifdef _LP64
     157  if (arg_slots.is_register()) {
     158    // Was arg_slots register loaded as signed int?
     159    Label L_ok;
     160    __ sll(arg_slots.as_register(), BitsPerInt, temp_reg);
     161    __ sra(temp_reg, BitsPerInt, temp_reg);
     162    __ cmp(arg_slots.as_register(), temp_reg);
     163    __ br(Assembler::equal, false, Assembler::pt, L_ok);
     164    __ delayed()->nop();
     165    __ stop("arg_slots register not loaded as signed int");
     166    __ bind(L_ok);
     167  }
     168#endif
     169
     170  // Make space on the stack for the inserted argument(s).
     171  // Then pull down everything shallower than argslot_reg.
     172  // The stacked return address gets pulled down with everything else.
     173  // That is, copy [sp, argslot) downward by -size words.  In pseudo-code:
     174  //   sp -= size;
     175  //   for (temp = sp + size; temp < argslot; temp++)
     176  //     temp[-size] = temp[0]
     177  //   argslot -= size;
     178  RegisterOrConstant offset = __ regcon_sll_ptr(arg_slots, LogBytesPerWord, temp3_reg);
     179
     180  // Keep the stack pointer 2*wordSize aligned.
     181  const int TwoWordAlignmentMask = right_n_bits(LogBytesPerWord + 1);
     182  RegisterOrConstant masked_offset = __ regcon_andn_ptr(offset, TwoWordAlignmentMask, temp_reg);
     183  __ add(SP, masked_offset, SP);
     184
     185  __ mov(Gargs, temp_reg);  // source pointer for copy
     186  __ add(Gargs, offset, Gargs);
     187
     188  {
     189    Label loop;
     190    __ bind(loop);
     191    // pull one word down each time through the loop
     192    __ ld_ptr(Address(temp_reg, 0), temp2_reg);
     193    __ st_ptr(temp2_reg, Address(temp_reg, offset));
     194    __ add(temp_reg, wordSize, temp_reg);
     195    __ cmp(temp_reg, argslot_reg);
     196    __ brx(Assembler::less, false, Assembler::pt, loop);
     197    __ delayed()->nop();  // FILLME
     198  }
     199
     200  // Now move the argslot down, to point to the opened-up space.
     201  __ add(argslot_reg, offset, argslot_reg);
     202}
     203
     204
     205// Helper to remove argument slots from the stack.
     206// arg_slots must be a multiple of stack_move_unit() and >= 0
     207void MethodHandles::remove_arg_slots(MacroAssembler* _masm,
     208                                     RegisterOrConstant arg_slots,
     209                                     Register argslot_reg,
     210                                     Register temp_reg, Register temp2_reg, Register temp3_reg) {
     211  assert(temp3_reg != noreg, "temp3 required");
     212  assert_different_registers(argslot_reg, temp_reg, temp2_reg, temp3_reg,
     213                             (!arg_slots.is_register() ? Gargs : arg_slots.as_register()));
     214
     215  RegisterOrConstant offset = __ regcon_sll_ptr(arg_slots, LogBytesPerWord, temp3_reg);
     216
     217#ifdef ASSERT
     218  // Verify that [argslot..argslot+size) lies within (Gargs, FP).
     219  __ add(argslot_reg, offset, temp2_reg);
     220  verify_argslot(_masm, temp2_reg, temp_reg, "deleted argument(s) must fall within current frame");
     221  if (arg_slots.is_register()) {
     222    Label L_ok, L_bad;
     223    __ cmp(arg_slots.as_register(), (int32_t) NULL_WORD);
     224    __ br(Assembler::less, false, Assembler::pn, L_bad);
     225    __ delayed()->nop();
     226    __ btst(-stack_move_unit() - 1, arg_slots.as_register());
     227    __ br(Assembler::zero, false, Assembler::pt, L_ok);
     228    __ delayed()->nop();
     229    __ bind(L_bad);
     230    __ stop("assert arg_slots >= 0 and clear low bits");
     231    __ bind(L_ok);
     232  } else {
     233    assert(arg_slots.as_constant() >= 0, "");
     234    assert(arg_slots.as_constant() % -stack_move_unit() == 0, "");
     235  }
     236#endif // ASSERT
     237
     238  // Pull up everything shallower than argslot.
     239  // Then remove the excess space on the stack.
     240  // The stacked return address gets pulled up with everything else.
     241  // That is, copy [sp, argslot) upward by size words.  In pseudo-code:
     242  //   for (temp = argslot-1; temp >= sp; --temp)
     243  //     temp[size] = temp[0]
     244  //   argslot += size;
     245  //   sp += size;
     246  __ sub(argslot_reg, wordSize, temp_reg);  // source pointer for copy
     247  {
     248    Label loop;
     249    __ bind(loop);
     250    // pull one word up each time through the loop
     251    __ ld_ptr(Address(temp_reg, 0), temp2_reg);
     252    __ st_ptr(temp2_reg, Address(temp_reg, offset));
     253    __ sub(temp_reg, wordSize, temp_reg);
     254    __ cmp(temp_reg, Gargs);
     255    __ brx(Assembler::greaterEqual, false, Assembler::pt, loop);
     256    __ delayed()->nop();  // FILLME
     257  }
     258
     259  // Now move the argslot up, to point to the just-copied block.
     260  __ add(Gargs, offset, Gargs);
     261  // And adjust the argslot address to point at the deletion point.
     262  __ add(argslot_reg, offset, argslot_reg);
     263
     264  // Keep the stack pointer 2*wordSize aligned.
     265  const int TwoWordAlignmentMask = right_n_bits(LogBytesPerWord + 1);
     266  RegisterOrConstant masked_offset = __ regcon_andn_ptr(offset, TwoWordAlignmentMask, temp_reg);
     267  __ add(SP, masked_offset, SP);
     268}
     269
     270
     271#ifndef PRODUCT
     272extern "C" void print_method_handle(oop mh);
     273void trace_method_handle_stub(const char* adaptername,
     274                              oop mh) {
     275#if 0
     276                              intptr_t* entry_sp,
     277                              intptr_t* saved_sp,
     278                              intptr_t* saved_bp) {
     279  // called as a leaf from native code: do not block the JVM!
     280  intptr_t* last_sp = (intptr_t*) saved_bp[frame::interpreter_frame_last_sp_offset];
     281  intptr_t* base_sp = (intptr_t*) saved_bp[frame::interpreter_frame_monitor_block_top_offset];
     282  printf("MH %s mh="INTPTR_FORMAT" sp=("INTPTR_FORMAT"+"INTX_FORMAT") stack_size="INTX_FORMAT" bp="INTPTR_FORMAT"\n",
     283         adaptername, (intptr_t)mh, (intptr_t)entry_sp, (intptr_t)(saved_sp - entry_sp), (intptr_t)(base_sp - last_sp), (intptr_t)saved_bp);
     284  if (last_sp != saved_sp)
     285    printf("*** last_sp="INTPTR_FORMAT"\n", (intptr_t)last_sp);
     286#endif
     287
     288  printf("MH %s mh="INTPTR_FORMAT"\n", adaptername, (intptr_t) mh);
     289  print_method_handle(mh);
     290}
     291#endif // PRODUCT
     292
     293// which conversion op types are implemented here?
     294int MethodHandles::adapter_conversion_ops_supported_mask() {
     295  return ((1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_ONLY)
     296         |(1<<sun_dyn_AdapterMethodHandle::OP_RETYPE_RAW)
     297         |(1<<sun_dyn_AdapterMethodHandle::OP_CHECK_CAST)
     298         |(1<<sun_dyn_AdapterMethodHandle::OP_PRIM_TO_PRIM)
     299         |(1<<sun_dyn_AdapterMethodHandle::OP_REF_TO_PRIM)
     300         |(1<<sun_dyn_AdapterMethodHandle::OP_SWAP_ARGS)
     301         |(1<<sun_dyn_AdapterMethodHandle::OP_ROT_ARGS)
     302         |(1<<sun_dyn_AdapterMethodHandle::OP_DUP_ARGS)
     303         |(1<<sun_dyn_AdapterMethodHandle::OP_DROP_ARGS)
     304         //|(1<<sun_dyn_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
     305         );
     306  // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
     307}
     308
     309//------------------------------------------------------------------------------
     310// MethodHandles::generate_method_handle_stub
     311//
    66312// Generate an "entry" field for a method handle.
    67313// This determines how the method handle will respond to calls.
    68314void MethodHandles::generate_method_handle_stub(MacroAssembler* _masm, MethodHandles::EntryKind ek) {
    69   ShouldNotReachHere(); //NYI, 6815692
     315  // Here is the register state during an interpreted call,
     316  // as set up by generate_method_handle_interpreter_entry():
     317  // - G5: garbage temp (was MethodHandle.invoke methodOop, unused)
     318  // - G3: receiver method handle
     319  // - O5_savedSP: sender SP (must preserve)
     320
     321  Register O0_argslot = O0;
     322  Register O1_scratch = O1;
     323  Register O2_scratch = O2;
     324  Register O3_scratch = O3;
     325  Register G5_index   = G5;
     326
     327  guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets");
     328
     329  // Some handy addresses:
     330  Address G5_method_fie(    G5_method,        in_bytes(methodOopDesc::from_interpreted_offset()));
     331
     332  Address G3_mh_vmtarget(   G3_method_handle, java_dyn_MethodHandle::vmtarget_offset_in_bytes());
     333
     334  Address G3_dmh_vmindex(   G3_method_handle, sun_dyn_DirectMethodHandle::vmindex_offset_in_bytes());
     335
     336  Address G3_bmh_vmargslot( G3_method_handle, sun_dyn_BoundMethodHandle::vmargslot_offset_in_bytes());
     337  Address G3_bmh_argument(  G3_method_handle, sun_dyn_BoundMethodHandle::argument_offset_in_bytes());
     338
     339  Address G3_amh_vmargslot( G3_method_handle, sun_dyn_AdapterMethodHandle::vmargslot_offset_in_bytes());
     340  Address G3_amh_argument ( G3_method_handle, sun_dyn_AdapterMethodHandle::argument_offset_in_bytes());
     341  Address G3_amh_conversion(G3_method_handle, sun_dyn_AdapterMethodHandle::conversion_offset_in_bytes());
     342
     343  const int java_mirror_offset = klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes();
     344
     345  if (have_entry(ek)) {
     346    __ nop();  // empty stubs make SG sick
     347    return;
     348  }
     349
     350  address interp_entry = __ pc();
     351  if (UseCompressedOops)  __ unimplemented("UseCompressedOops");
     352
     353#ifndef PRODUCT
     354  if (TraceMethodHandles) {
     355    // save: Gargs, O5_savedSP
     356    __ save(SP, -16*wordSize, SP);
     357    __ set((intptr_t) entry_name(ek), O0);
     358    __ mov(G3_method_handle, O1);
     359    __ call_VM_leaf(Lscratch, CAST_FROM_FN_PTR(address, trace_method_handle_stub));
     360    __ restore(SP, 16*wordSize, SP);
     361  }
     362#endif // PRODUCT
     363
     364  switch ((int) ek) {
     365  case _raise_exception:
     366    {
     367      // Not a real MH entry, but rather shared code for raising an
     368      // exception.  Extra local arguments are passed in scratch
     369      // registers, as required type in O3, failing object (or NULL)
     370      // in O2, failing bytecode type in O1.
     371
     372      __ mov(O5_savedSP, SP);  // Cut the stack back to where the caller started.
     373
     374      // Push arguments as if coming from the interpreter.
     375      Register O0_scratch = O0_argslot;
     376      int stackElementSize = Interpreter::stackElementSize;
     377
     378      // Make space on the stack for the arguments and set Gargs
     379      // correctly.
     380      __ sub(SP, 4*stackElementSize, SP);  // Keep stack aligned.
     381      __ add(SP, (frame::varargs_offset)*wordSize - 1*Interpreter::stackElementSize + STACK_BIAS + BytesPerWord, Gargs);
     382
     383      // void raiseException(int code, Object actual, Object required)
     384      __ st(    O1_scratch, Address(Gargs, 2*stackElementSize));  // code
     385      __ st_ptr(O2_scratch, Address(Gargs, 1*stackElementSize));  // actual
     386      __ st_ptr(O3_scratch, Address(Gargs, 0*stackElementSize));  // required
     387
     388      Label no_method;
     389      // FIXME: fill in _raise_exception_method with a suitable sun.dyn method
     390      __ set(AddressLiteral((address) &_raise_exception_method), G5_method);
     391      __ ld_ptr(Address(G5_method, 0), G5_method);
     392      __ tst(G5_method);
     393      __ brx(Assembler::zero, false, Assembler::pn, no_method);
     394      __ delayed()->nop();
     395
     396      int jobject_oop_offset = 0;
     397      __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method);
     398      __ tst(G5_method);
     399      __ brx(Assembler::zero, false, Assembler::pn, no_method);
     400      __ delayed()->nop();
     401
     402      __ verify_oop(G5_method);
     403      __ jump_indirect_to(G5_method_fie, O1_scratch);
     404      __ delayed()->nop();
     405
     406      // If we get here, the Java runtime did not do its job of creating the exception.
     407      // Do something that is at least causes a valid throw from the interpreter.
     408      __ bind(no_method);
     409      __ unimplemented("_raise_exception no method");
     410    }
     411    break;
     412
     413  case _invokestatic_mh:
     414  case _invokespecial_mh:
     415    {
     416      __ ld_ptr(G3_mh_vmtarget, G5_method);  // target is a methodOop
     417      __ verify_oop(G5_method);
     418      // Same as TemplateTable::invokestatic or invokespecial,
     419      // minus the CP setup and profiling:
     420      if (ek == _invokespecial_mh) {
     421        // Must load & check the first argument before entering the target method.
     422        __ load_method_handle_vmslots(O0_argslot, G3_method_handle, O1_scratch);
     423        __ ld_ptr(__ argument_address(O0_argslot), G3_method_handle);
     424        __ null_check(G3_method_handle);
     425        __ verify_oop(G3_method_handle);
     426      }
     427      __ jump_indirect_to(G5_method_fie, O1_scratch);
     428      __ delayed()->nop();
     429    }
     430    break;
     431
     432  case _invokevirtual_mh:
     433    {
     434      // Same as TemplateTable::invokevirtual,
     435      // minus the CP setup and profiling:
     436
     437      // Pick out the vtable index and receiver offset from the MH,
     438      // and then we can discard it:
     439      __ load_method_handle_vmslots(O0_argslot, G3_method_handle, O1_scratch);
     440      __ ldsw(G3_dmh_vmindex, G5_index);
     441      // Note:  The verifier allows us to ignore G3_mh_vmtarget.
     442      __ ld_ptr(__ argument_address(O0_argslot, -1), G3_method_handle);
     443      __ null_check(G3_method_handle, oopDesc::klass_offset_in_bytes());
     444
     445      // Get receiver klass:
     446      Register O0_klass = O0_argslot;
     447      __ load_klass(G3_method_handle, O0_klass);
     448      __ verify_oop(O0_klass);
     449
     450      // Get target methodOop & entry point:
     451      const int base = instanceKlass::vtable_start_offset() * wordSize;
     452      assert(vtableEntry::size() * wordSize == wordSize, "adjust the scaling in the code below");
     453
     454      __ sll_ptr(G5_index, LogBytesPerWord, G5_index);
     455      __ add(O0_klass, G5_index, O0_klass);
     456      Address vtable_entry_addr(O0_klass, base + vtableEntry::method_offset_in_bytes());
     457      __ ld_ptr(vtable_entry_addr, G5_method);
     458
     459      __ verify_oop(G5_method);
     460      __ jump_indirect_to(G5_method_fie, O1_scratch);
     461      __ delayed()->nop();
     462    }
     463    break;
     464
     465  case _invokeinterface_mh:
     466    {
     467      // Same as TemplateTable::invokeinterface,
     468      // minus the CP setup and profiling:
     469      __ load_method_handle_vmslots(O0_argslot, G3_method_handle, O1_scratch);
     470      Register O1_intf  = O1_scratch;
     471      __ ld_ptr(G3_mh_vmtarget, O1_intf);
     472      __ ldsw(G3_dmh_vmindex, G5_index);
     473      __ ld_ptr(__ argument_address(O0_argslot, -1), G3_method_handle);
     474      __ null_check(G3_method_handle, oopDesc::klass_offset_in_bytes());
     475
     476      // Get receiver klass:
     477      Register O0_klass = O0_argslot;
     478      __ load_klass(G3_method_handle, O0_klass);
     479      __ verify_oop(O0_klass);
     480
     481      // Get interface:
     482      Label no_such_interface;
     483      __ verify_oop(O1_intf);
     484      __ lookup_interface_method(O0_klass, O1_intf,
     485                                 // Note: next two args must be the same:
     486                                 G5_index, G5_method,
     487                                 O2_scratch,
     488                                 O3_scratch,
     489                                 no_such_interface);
     490
     491      __ verify_oop(G5_method);
     492      __ jump_indirect_to(G5_method_fie, O1_scratch);
     493      __ delayed()->nop();
     494
     495      __ bind(no_such_interface);
     496      // Throw an exception.
     497      // For historical reasons, it will be IncompatibleClassChangeError.
     498      __ unimplemented("not tested yet");
     499      __ ld_ptr(Address(O1_intf, java_mirror_offset), O3_scratch);  // required interface
     500      __ mov(O0_klass, O2_scratch);  // bad receiver
     501      __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O0_argslot);
     502      __ delayed()->mov(Bytecodes::_invokeinterface, O1_scratch);  // who is complaining?
     503    }
     504    break;
     505
     506  case _bound_ref_mh:
     507  case _bound_int_mh:
     508  case _bound_long_mh:
     509  case _bound_ref_direct_mh:
     510  case _bound_int_direct_mh:
     511  case _bound_long_direct_mh:
     512    {
     513      const bool direct_to_method = (ek >= _bound_ref_direct_mh);
     514      BasicType arg_type  = T_ILLEGAL;
     515      int       arg_mask  = _INSERT_NO_MASK;
     516      int       arg_slots = -1;
     517      get_ek_bound_mh_info(ek, arg_type, arg_mask, arg_slots);
     518
     519      // Make room for the new argument:
     520      __ ldsw(G3_bmh_vmargslot, O0_argslot);
     521      __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
     522
     523      insert_arg_slots(_masm, arg_slots * stack_move_unit(), arg_mask, O0_argslot, O1_scratch, O2_scratch, G5_index);
     524
     525      // Store bound argument into the new stack slot:
     526      __ ld_ptr(G3_bmh_argument, O1_scratch);
     527      if (arg_type == T_OBJECT) {
     528        __ st_ptr(O1_scratch, Address(O0_argslot, 0));
     529      } else {
     530        Address prim_value_addr(O1_scratch, java_lang_boxing_object::value_offset_in_bytes(arg_type));
     531        __ load_sized_value(prim_value_addr, O2_scratch, type2aelembytes(arg_type), is_signed_subword_type(arg_type));
     532        if (arg_slots == 2) {
     533          __ unimplemented("not yet tested");
     534#ifndef _LP64
     535          __ signx(O2_scratch, O3_scratch);  // Sign extend
     536#endif
     537          __ st_long(O2_scratch, Address(O0_argslot, 0));  // Uses O2/O3 on !_LP64
     538        } else {
     539          __ st_ptr( O2_scratch, Address(O0_argslot, 0));
     540        }
     541      }
     542
     543      if (direct_to_method) {
     544        __ ld_ptr(G3_mh_vmtarget, G5_method);  // target is a methodOop
     545        __ verify_oop(G5_method);
     546        __ jump_indirect_to(G5_method_fie, O1_scratch);
     547        __ delayed()->nop();
     548      } else {
     549        __ ld_ptr(G3_mh_vmtarget, G3_method_handle);  // target is a methodOop
     550        __ verify_oop(G3_method_handle);
     551        __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     552      }
     553    }
     554    break;
     555
     556  case _adapter_retype_only:
     557  case _adapter_retype_raw:
     558    // Immediately jump to the next MH layer:
     559    __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     560    __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     561    // This is OK when all parameter types widen.
     562    // It is also OK when a return type narrows.
     563    break;
     564
     565  case _adapter_check_cast:
     566    {
     567      // Temps:
     568      Register G5_klass = G5_index;  // Interesting AMH data.
     569
     570      // Check a reference argument before jumping to the next layer of MH:
     571      __ ldsw(G3_amh_vmargslot, O0_argslot);
     572      Address vmarg = __ argument_address(O0_argslot);
     573
     574      // What class are we casting to?
     575      __ ld_ptr(G3_amh_argument, G5_klass);  // This is a Class object!
     576      __ ld_ptr(Address(G5_klass, java_lang_Class::klass_offset_in_bytes()), G5_klass);
     577
     578      Label done;
     579      __ ld_ptr(vmarg, O1_scratch);
     580      __ tst(O1_scratch);
     581      __ brx(Assembler::zero, false, Assembler::pn, done);  // No cast if null.
     582      __ delayed()->nop();
     583      __ load_klass(O1_scratch, O1_scratch);
     584
     585      // Live at this point:
     586      // - G5_klass        :  klass required by the target method
     587      // - O1_scratch      :  argument klass to test
     588      // - G3_method_handle:  adapter method handle
     589      __ check_klass_subtype(O1_scratch, G5_klass, O0_argslot, O2_scratch, done);
     590
     591      // If we get here, the type check failed!
     592      __ ldsw(G3_amh_vmargslot, O0_argslot);  // reload argslot field
     593      __ ld_ptr(G3_amh_argument, O3_scratch);  // required class
     594      __ ld_ptr(vmarg, O2_scratch);  // bad object
     595      __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O0_argslot);
     596      __ delayed()->mov(Bytecodes::_checkcast, O1_scratch);  // who is complaining?
     597
     598      __ bind(done);
     599      // Get the new MH:
     600      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     601      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     602    }
     603    break;
     604
     605  case _adapter_prim_to_prim:
     606  case _adapter_ref_to_prim:
     607    // Handled completely by optimized cases.
     608    __ stop("init_AdapterMethodHandle should not issue this");
     609    break;
     610
     611  case _adapter_opt_i2i:        // optimized subcase of adapt_prim_to_prim
     612//case _adapter_opt_f2i:        // optimized subcase of adapt_prim_to_prim
     613  case _adapter_opt_l2i:        // optimized subcase of adapt_prim_to_prim
     614  case _adapter_opt_unboxi:     // optimized subcase of adapt_ref_to_prim
     615    {
     616      // Perform an in-place conversion to int or an int subword.
     617      __ ldsw(G3_amh_vmargslot, O0_argslot);
     618      Address vmarg = __ argument_address(O0_argslot);
     619      Address value;
     620      bool value_left_justified = false;
     621
     622      switch (ek) {
     623      case _adapter_opt_i2i:
     624      case _adapter_opt_l2i:
     625        __ unimplemented(entry_name(ek));
     626        value = vmarg;
     627        break;
     628      case _adapter_opt_unboxi:
     629        {
     630          // Load the value up from the heap.
     631          __ ld_ptr(vmarg, O1_scratch);
     632          int value_offset = java_lang_boxing_object::value_offset_in_bytes(T_INT);
     633#ifdef ASSERT
     634          for (int bt = T_BOOLEAN; bt < T_INT; bt++) {
     635            if (is_subword_type(BasicType(bt)))
     636              assert(value_offset == java_lang_boxing_object::value_offset_in_bytes(BasicType(bt)), "");
     637          }
     638#endif
     639          __ null_check(O1_scratch, value_offset);
     640          value = Address(O1_scratch, value_offset);
     641#ifdef _BIG_ENDIAN
     642          // Values stored in objects are packed.
     643          value_left_justified = true;
     644#endif
     645        }
     646        break;
     647      default:
     648        ShouldNotReachHere();
     649      }
     650
     651      // This check is required on _BIG_ENDIAN
     652      Register G5_vminfo = G5_index;
     653      __ ldsw(G3_amh_conversion, G5_vminfo);
     654      assert(CONV_VMINFO_SHIFT == 0, "preshifted");
     655
     656      // Original 32-bit vmdata word must be of this form:
     657      // | MBZ:6 | signBitCount:8 | srcDstTypes:8 | conversionOp:8 |
     658      __ lduw(value, O1_scratch);
     659      if (!value_left_justified)
     660        __ sll(O1_scratch, G5_vminfo, O1_scratch);
     661      Label zero_extend, done;
     662      __ btst(CONV_VMINFO_SIGN_FLAG, G5_vminfo);
     663      __ br(Assembler::zero, false, Assembler::pn, zero_extend);
     664      __ delayed()->nop();
     665
     666      // this path is taken for int->byte, int->short
     667      __ sra(O1_scratch, G5_vminfo, O1_scratch);
     668      __ ba(false, done);
     669      __ delayed()->nop();
     670
     671      __ bind(zero_extend);
     672      // this is taken for int->char
     673      __ srl(O1_scratch, G5_vminfo, O1_scratch);
     674
     675      __ bind(done);
     676      __ st(O1_scratch, vmarg);
     677
     678      // Get the new MH:
     679      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     680      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     681    }
     682    break;
     683
     684  case _adapter_opt_i2l:        // optimized subcase of adapt_prim_to_prim
     685  case _adapter_opt_unboxl:     // optimized subcase of adapt_ref_to_prim
     686    {
     687      // Perform an in-place int-to-long or ref-to-long conversion.
     688      __ ldsw(G3_amh_vmargslot, O0_argslot);
     689
     690      // On big-endian machine we duplicate the slot and store the MSW
     691      // in the first slot.
     692      __ add(Gargs, __ argument_offset(O0_argslot, 1), O0_argslot);
     693
     694      insert_arg_slots(_masm, stack_move_unit(), _INSERT_INT_MASK, O0_argslot, O1_scratch, O2_scratch, G5_index);
     695
     696      Address arg_lsw(O0_argslot, 0);
     697      Address arg_msw(O0_argslot, -Interpreter::stackElementSize);
     698
     699      switch (ek) {
     700      case _adapter_opt_i2l:
     701        {
     702          __ ldsw(arg_lsw, O2_scratch);      // Load LSW
     703#ifndef _LP64
     704          __ signx(O2_scratch, O3_scratch);  // Sign extend
     705#endif
     706          __ st_long(O2_scratch, arg_msw);   // Uses O2/O3 on !_LP64
     707        }
     708        break;
     709      case _adapter_opt_unboxl:
     710        {
     711          // Load the value up from the heap.
     712          __ ld_ptr(arg_lsw, O1_scratch);
     713          int value_offset = java_lang_boxing_object::value_offset_in_bytes(T_LONG);
     714          assert(value_offset == java_lang_boxing_object::value_offset_in_bytes(T_DOUBLE), "");
     715          __ null_check(O1_scratch, value_offset);
     716          __ ld_long(Address(O1_scratch, value_offset), O2_scratch);  // Uses O2/O3 on !_LP64
     717          __ st_long(O2_scratch, arg_msw);
     718        }
     719        break;
     720      default:
     721        ShouldNotReachHere();
     722      }
     723
     724      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     725      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     726    }
     727    break;
     728
     729  case _adapter_opt_f2d:        // optimized subcase of adapt_prim_to_prim
     730  case _adapter_opt_d2f:        // optimized subcase of adapt_prim_to_prim
     731    {
     732      // perform an in-place floating primitive conversion
     733      __ unimplemented(entry_name(ek));
     734    }
     735    break;
     736
     737  case _adapter_prim_to_ref:
     738    __ unimplemented(entry_name(ek)); // %%% FIXME: NYI
     739    break;
     740
     741  case _adapter_swap_args:
     742  case _adapter_rot_args:
     743    // handled completely by optimized cases
     744    __ stop("init_AdapterMethodHandle should not issue this");
     745    break;
     746
     747  case _adapter_opt_swap_1:
     748  case _adapter_opt_swap_2:
     749  case _adapter_opt_rot_1_up:
     750  case _adapter_opt_rot_1_down:
     751  case _adapter_opt_rot_2_up:
     752  case _adapter_opt_rot_2_down:
     753    {
     754      int swap_bytes = 0, rotate = 0;
     755      get_ek_adapter_opt_swap_rot_info(ek, swap_bytes, rotate);
     756
     757      // 'argslot' is the position of the first argument to swap.
     758      __ ldsw(G3_amh_vmargslot, O0_argslot);
     759      __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
     760
     761      // 'vminfo' is the second.
     762      Register O1_destslot = O1_scratch;
     763      __ ldsw(G3_amh_conversion, O1_destslot);
     764      assert(CONV_VMINFO_SHIFT == 0, "preshifted");
     765      __ and3(O1_destslot, CONV_VMINFO_MASK, O1_destslot);
     766      __ add(Gargs, __ argument_offset(O1_destslot), O1_destslot);
     767
     768      if (!rotate) {
     769        for (int i = 0; i < swap_bytes; i += wordSize) {
     770          __ ld_ptr(Address(O0_argslot,  i), O2_scratch);
     771          __ ld_ptr(Address(O1_destslot, i), O3_scratch);
     772          __ st_ptr(O3_scratch, Address(O0_argslot,  i));
     773          __ st_ptr(O2_scratch, Address(O1_destslot, i));
     774        }
     775      } else {
     776        // Save the first chunk, which is going to get overwritten.
     777        switch (swap_bytes) {
     778        case 4 : __ lduw(Address(O0_argslot, 0), O2_scratch); break;
     779        case 16: __ ldx( Address(O0_argslot, 8), O3_scratch); //fall-thru
     780        case 8 : __ ldx( Address(O0_argslot, 0), O2_scratch); break;
     781        default: ShouldNotReachHere();
     782        }
     783
     784        if (rotate > 0) {
     785          // Rorate upward.
     786          __ sub(O0_argslot, swap_bytes, O0_argslot);
     787#if ASSERT
     788          {
     789            // Verify that argslot > destslot, by at least swap_bytes.
     790            Label L_ok;
     791            __ cmp(O0_argslot, O1_destslot);
     792            __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, L_ok);
     793            __ delayed()->nop();
     794            __ stop("source must be above destination (upward rotation)");
     795            __ bind(L_ok);
     796          }
     797#endif
     798          // Work argslot down to destslot, copying contiguous data upwards.
     799          // Pseudo-code:
     800          //   argslot  = src_addr - swap_bytes
     801          //   destslot = dest_addr
     802          //   while (argslot >= destslot) {
     803          //     *(argslot + swap_bytes) = *(argslot + 0);
     804          //     argslot--;
     805          //   }
     806          Label loop;
     807          __ bind(loop);
     808          __ ld_ptr(Address(O0_argslot, 0), G5_index);
     809          __ st_ptr(G5_index, Address(O0_argslot, swap_bytes));
     810          __ sub(O0_argslot, wordSize, O0_argslot);
     811          __ cmp(O0_argslot, O1_destslot);
     812          __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, loop);
     813          __ delayed()->nop();  // FILLME
     814        } else {
     815          __ add(O0_argslot, swap_bytes, O0_argslot);
     816#if ASSERT
     817          {
     818            // Verify that argslot < destslot, by at least swap_bytes.
     819            Label L_ok;
     820            __ cmp(O0_argslot, O1_destslot);
     821            __ brx(Assembler::lessEqualUnsigned, false, Assembler::pt, L_ok);
     822            __ delayed()->nop();
     823            __ stop("source must be above destination (upward rotation)");
     824            __ bind(L_ok);
     825          }
     826#endif
     827          // Work argslot up to destslot, copying contiguous data downwards.
     828          // Pseudo-code:
     829          //   argslot  = src_addr + swap_bytes
     830          //   destslot = dest_addr
     831          //   while (argslot >= destslot) {
     832          //     *(argslot - swap_bytes) = *(argslot + 0);
     833          //     argslot++;
     834          //   }
     835          Label loop;
     836          __ bind(loop);
     837          __ ld_ptr(Address(O0_argslot, 0), G5_index);
     838          __ st_ptr(G5_index, Address(O0_argslot, -swap_bytes));
     839          __ add(O0_argslot, wordSize, O0_argslot);
     840          __ cmp(O0_argslot, O1_destslot);
     841          __ brx(Assembler::lessEqualUnsigned, false, Assembler::pt, loop);
     842          __ delayed()->nop();  // FILLME
     843        }
     844
     845        // Store the original first chunk into the destination slot, now free.
     846        switch (swap_bytes) {
     847        case 4 : __ stw(O2_scratch, Address(O1_destslot, 0)); break;
     848        case 16: __ stx(O3_scratch, Address(O1_destslot, 8)); // fall-thru
     849        case 8 : __ stx(O2_scratch, Address(O1_destslot, 0)); break;
     850        default: ShouldNotReachHere();
     851        }
     852      }
     853
     854      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     855      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     856    }
     857    break;
     858
     859  case _adapter_dup_args:
     860    {
     861      // 'argslot' is the position of the first argument to duplicate.
     862      __ ldsw(G3_amh_vmargslot, O0_argslot);
     863      __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
     864
     865      // 'stack_move' is negative number of words to duplicate.
     866      Register G5_stack_move = G5_index;
     867      __ ldsw(G3_amh_conversion, G5_stack_move);
     868      __ sra(G5_stack_move, CONV_STACK_MOVE_SHIFT, G5_stack_move);
     869
     870      // Remember the old Gargs (argslot[0]).
     871      Register O1_oldarg = O1_scratch;
     872      __ mov(Gargs, O1_oldarg);
     873
     874      // Move Gargs down to make room for dups.
     875      __ sll_ptr(G5_stack_move, LogBytesPerWord, G5_stack_move);
     876      __ add(Gargs, G5_stack_move, Gargs);
     877
     878      // Compute the new Gargs (argslot[0]).
     879      Register O2_newarg = O2_scratch;
     880      __ mov(Gargs, O2_newarg);
     881
     882      // Copy from oldarg[0...] down to newarg[0...]
     883      // Pseude-code:
     884      //   O1_oldarg  = old-Gargs
     885      //   O2_newarg  = new-Gargs
     886      //   O0_argslot = argslot
     887      //   while (O2_newarg < O1_oldarg) *O2_newarg = *O0_argslot++
     888      Label loop;
     889      __ bind(loop);
     890      __ ld_ptr(Address(O0_argslot, 0), O3_scratch);
     891      __ st_ptr(O3_scratch, Address(O2_newarg, 0));
     892      __ add(O0_argslot, wordSize, O0_argslot);
     893      __ add(O2_newarg,  wordSize, O2_newarg);
     894      __ cmp(O2_newarg, O1_oldarg);
     895      __ brx(Assembler::less, false, Assembler::pt, loop);
     896      __ delayed()->nop();  // FILLME
     897
     898      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     899      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     900    }
     901    break;
     902
     903  case _adapter_drop_args:
     904    {
     905      // 'argslot' is the position of the first argument to nuke.
     906      __ ldsw(G3_amh_vmargslot, O0_argslot);
     907      __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot);
     908
     909      // 'stack_move' is number of words to drop.
     910      Register G5_stack_move = G5_index;
     911      __ ldsw(G3_amh_conversion, G5_stack_move);
     912      __ sra(G5_stack_move, CONV_STACK_MOVE_SHIFT, G5_stack_move);
     913
     914      remove_arg_slots(_masm, G5_stack_move, O0_argslot, O1_scratch, O2_scratch, O3_scratch);
     915
     916      __ ld_ptr(G3_mh_vmtarget, G3_method_handle);
     917      __ jump_to_method_handle_entry(G3_method_handle, O1_scratch);
     918    }
     919    break;
     920
     921  case _adapter_collect_args:
     922    __ unimplemented(entry_name(ek)); // %%% FIXME: NYI
     923    break;
     924
     925  case _adapter_spread_args:
     926    // Handled completely by optimized cases.
     927    __ stop("init_AdapterMethodHandle should not issue this");
     928    break;
     929
     930  case _adapter_opt_spread_0:
     931  case _adapter_opt_spread_1:
     932  case _adapter_opt_spread_more:
     933    {
     934      // spread an array out into a group of arguments
     935      __ unimplemented(entry_name(ek));
     936    }
     937    break;
     938
     939  case _adapter_flyby:
     940  case _adapter_ricochet:
     941    __ unimplemented(entry_name(ek)); // %%% FIXME: NYI
     942    break;
     943
     944  default:
     945    ShouldNotReachHere();
     946  }
     947
     948  address me_cookie = MethodHandleEntry::start_compiled_entry(_masm, interp_entry);
     949  __ unimplemented(entry_name(ek)); // %%% FIXME: NYI
     950
     951  init_entry(ek, MethodHandleEntry::finish_compiled_entry(_masm, me_cookie));
    70952}
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    322322
    323323  // also store the value into an oop_Relocation cell, if any
    324   CodeBlob* nm = CodeCache::find_blob(instruction_address());
     324  CodeBlob* cb = CodeCache::find_blob(instruction_address());
     325  nmethod*  nm = cb ? cb->as_nmethod_or_null() : NULL;
    325326  if (nm != NULL) {
    326327    RelocIterator iter(nm, instruction_address(), next_instruction_address());
     
    431432
    432433  // also store the value into an oop_Relocation cell, if any
    433   CodeBlob* nm = CodeCache::find_blob(instruction_address());
     434  CodeBlob* cb = CodeCache::find_blob(instruction_address());
     435  nmethod*  nm = cb ? cb->as_nmethod_or_null() : NULL;
    434436  if (nm != NULL) {
    435437    RelocIterator iter(nm, instruction_address(), next_instruction_address());
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2002-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    143143REGISTER_DEFINITION(Register, G4_scratch);
    144144REGISTER_DEFINITION(Register, Gtemp);
     145REGISTER_DEFINITION(Register, Lentry_args);
     146
     147// JSR 292
    145148REGISTER_DEFINITION(Register, G5_method_type);
    146149REGISTER_DEFINITION(Register, G3_method_handle);
    147 REGISTER_DEFINITION(Register, Lentry_args);
     150REGISTER_DEFINITION(Register, L7_mh_SP_save);
    148151
    149152#ifdef CC_INTERP
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2000-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    117117  __ restore();
    118118
     119  // Restore SP from L7 if the exception PC is a MethodHandle call site.
     120  __ lduw(Address(G2_thread, JavaThread::is_method_handle_return_offset()), O7);
     121  __ tst(O7);
     122  __ movcc(Assembler::notZero, false, Assembler::icc, L7_mh_SP_save, SP);
     123
    119124  // G3_scratch contains handler address
    120125  // Since this may be the deopt blob we must set O7 to look like we returned
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    108108  // (as the stub's I's) when the runtime routine called by the stub creates its frame.
    109109  int i;
    110   // Always make the frame size 16 bytr aligned.
     110  // Always make the frame size 16 byte aligned.
    111111  int frame_size = round_to(additional_frame_words + register_save_size, 16);
    112112  // OopMap frame size is in c2 stack slots (sizeof(jint)) not bytes or words
     
    202202  __ stxfsr(SP, fsr_offset+STACK_BIAS);
    203203
    204   // Save all the FP registers
     204  // Save all the FP registers: 32 doubles (32 floats correspond to the 2 halves of the first 16 doubles)
    205205  int offset = d00_offset;
    206   for( int i=0; i<64; i+=2 ) {
     206  for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) {
    207207    FloatRegister f = as_FloatRegister(i);
    208208    __ stf(FloatRegisterImpl::D,  f, SP, offset+STACK_BIAS);
     209    // Record as callee saved both halves of double registers (2 float registers).
    209210    map->set_callee_saved(VMRegImpl::stack2reg(offset>>2), f->as_VMReg());
    210     if (true) {
    211       map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next());
    212     }
     211    map->set_callee_saved(VMRegImpl::stack2reg((offset + sizeof(float))>>2), f->as_VMReg()->next());
    213212    offset += sizeof(double);
    214213  }
     
    225224
    226225  // Restore all the FP registers
    227   for( int i=0; i<64; i+=2 ) {
     226  for( int i=0; i<FloatRegisterImpl::number_of_registers; i+=2 ) {
    228227    __ ldf(FloatRegisterImpl::D, SP, d00_offset+i*sizeof(float)+STACK_BIAS, as_FloatRegister(i));
    229228  }
     
    541540}
    542541
    543 // Helper class mostly to avoid passing masm everywhere, and handle store
    544 // displacement overflow logic for LP64
     542// Helper class mostly to avoid passing masm everywhere, and handle
     543// store displacement overflow logic.
    545544class AdapterGenerator {
    546545  MacroAssembler *masm;
    547 #ifdef _LP64
    548546  Register Rdisp;
    549547  void set_Rdisp(Register r)  { Rdisp = r; }
    550 #endif // _LP64
    551548
    552549  void patch_callers_callsite();
    553   void tag_c2i_arg(frame::Tag t, Register base, int st_off, Register scratch);
    554550
    555551  // base+st_off points to top of argument
    556   int arg_offset(const int st_off) { return st_off + Interpreter::value_offset_in_bytes(); }
     552  int arg_offset(const int st_off) { return st_off; }
    557553  int next_arg_offset(const int st_off) {
    558     return st_off - Interpreter::stackElementSize() + Interpreter::value_offset_in_bytes();
    559   }
    560 
    561 #ifdef _LP64
    562   // On _LP64 argument slot values are loaded first into a register
    563   // because they might not fit into displacement.
    564   Register arg_slot(const int st_off);
    565   Register next_arg_slot(const int st_off);
    566 #else
    567   int arg_slot(const int st_off)      { return arg_offset(st_off); }
    568   int next_arg_slot(const int st_off) { return next_arg_offset(st_off); }
    569 #endif // _LP64
     554    return st_off - Interpreter::stackElementSize;
     555  }
     556
     557  // Argument slot values may be loaded first into a register because
     558  // they might not fit into displacement.
     559  RegisterOrConstant arg_slot(const int st_off);
     560  RegisterOrConstant next_arg_slot(const int st_off);
    570561
    571562  // Stores long into offset pointed to by base
     
    654645}
    655646
    656 void AdapterGenerator::tag_c2i_arg(frame::Tag t, Register base, int st_off,
    657                  Register scratch) {
    658   if (TaggedStackInterpreter) {
    659     int tag_off = st_off + Interpreter::tag_offset_in_bytes();
    660 #ifdef _LP64
    661     Register tag_slot = Rdisp;
    662     __ set(tag_off, tag_slot);
    663 #else
    664     int tag_slot = tag_off;
    665 #endif // _LP64
    666     // have to store zero because local slots can be reused (rats!)
    667     if (t == frame::TagValue) {
    668       __ st_ptr(G0, base, tag_slot);
    669     } else if (t == frame::TagCategory2) {
    670       __ st_ptr(G0, base, tag_slot);
    671       int next_tag_off  = st_off - Interpreter::stackElementSize() +
    672                                    Interpreter::tag_offset_in_bytes();
    673 #ifdef _LP64
    674       __ set(next_tag_off, tag_slot);
    675 #else
    676       tag_slot = next_tag_off;
    677 #endif // _LP64
    678       __ st_ptr(G0, base, tag_slot);
    679     } else {
    680       __ mov(t, scratch);
    681       __ st_ptr(scratch, base, tag_slot);
    682     }
    683   }
    684 }
    685 
    686 #ifdef _LP64
    687 Register AdapterGenerator::arg_slot(const int st_off) {
    688   __ set( arg_offset(st_off), Rdisp);
    689   return Rdisp;
    690 }
    691 
    692 Register AdapterGenerator::next_arg_slot(const int st_off){
    693   __ set( next_arg_offset(st_off), Rdisp);
    694   return Rdisp;
    695 }
    696 #endif // _LP64
     647
     648RegisterOrConstant AdapterGenerator::arg_slot(const int st_off) {
     649  RegisterOrConstant roc(arg_offset(st_off));
     650  return __ ensure_simm13_or_reg(roc, Rdisp);
     651}
     652
     653RegisterOrConstant AdapterGenerator::next_arg_slot(const int st_off) {
     654  RegisterOrConstant roc(next_arg_offset(st_off));
     655  return __ ensure_simm13_or_reg(roc, Rdisp);
     656}
     657
    697658
    698659// Stores long into offset pointed to by base
     
    721682#endif // COMPILER2
    722683#endif // _LP64
    723   tag_c2i_arg(frame::TagCategory2, base, st_off, r);
    724684}
    725685
     
    727687                      const int st_off) {
    728688  __ st_ptr (r, base, arg_slot(st_off));
    729   tag_c2i_arg(frame::TagReference, base, st_off, r);
    730689}
    731690
     
    733692                   const int st_off) {
    734693  __ st (r, base, arg_slot(st_off));
    735   tag_c2i_arg(frame::TagValue, base, st_off, r);
    736694}
    737695
     
    748706  __ stf(FloatRegisterImpl::S, r_2->as_FloatRegister(), base, arg_slot(st_off) );
    749707#endif
    750   tag_c2i_arg(frame::TagCategory2, base, st_off, G1_scratch);
    751708}
    752709
     
    754711                                       const int st_off) {
    755712  __ stf(FloatRegisterImpl::S, f, base, arg_slot(st_off));
    756   tag_c2i_arg(frame::TagValue, base, st_off, G1_scratch);
    757713}
    758714
     
    789745  // space we need.  Add in varargs area needed by the interpreter. Round up
    790746  // to stack alignment.
    791   const int arg_size = total_args_passed * Interpreter::stackElementSize();
     747  const int arg_size = total_args_passed * Interpreter::stackElementSize;
    792748  const int varargs_area =
    793749                 (frame::varargs_offset - frame::register_save_words)*wordSize;
     
    796752  int bias = STACK_BIAS;
    797753  const int interp_arg_offset = frame::varargs_offset*wordSize +
    798                         (total_args_passed-1)*Interpreter::stackElementSize();
     754                        (total_args_passed-1)*Interpreter::stackElementSize;
    799755
    800756  Register base = SP;
     
    817773  // First write G1 (if used) to where ever it must go
    818774  for (int i=0; i<total_args_passed; i++) {
    819     const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize()) + bias;
     775    const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize) + bias;
    820776    VMReg r_1 = regs[i].first();
    821777    VMReg r_2 = regs[i].second();
     
    834790  // Now write the args into the outgoing interpreter space
    835791  for (int i=0; i<total_args_passed; i++) {
    836     const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize()) + bias;
     792    const int st_off = interp_arg_offset - (i*Interpreter::stackElementSize) + bias;
    837793    VMReg r_1 = regs[i].first();
    838794    VMReg r_2 = regs[i].second();
     
    854810#else
    855811      int ld_off = reg2offset(r_1) + extraspace + bias;
     812#endif // _LP64
    856813#ifdef ASSERT
    857814      G1_forced = true;
    858815#endif // ASSERT
    859 #endif // _LP64
    860816      r_1 = G1_scratch->as_VMReg();// as part of the load/store shuffle
    861817      if (!r_2->is_valid()) __ ld (base, ld_off, G1_scratch);
     
    868824        store_c2i_object(r, base, st_off);
    869825      } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
     826#ifndef _LP64
    870827        if (TieredCompilation) {
    871828          assert(G1_forced || sig_bt[i] != T_LONG, "should not use register args for longs");
    872829        }
     830#endif // _LP64
    873831        store_c2i_long(r, base, st_off, r_2->is_stack());
    874832      } else {
     
    901859
    902860  __ mov((frame::varargs_offset)*wordSize -
    903          1*Interpreter::stackElementSize()+bias+BytesPerWord, G1);
     861         1*Interpreter::stackElementSize+bias+BytesPerWord, G1);
    904862  // Jump to the interpreter just as if interpreter was doing it.
    905863  __ jmpl(G3_scratch, 0, G0);
     
    951909  // O6             - Adjusted or restored SP
    952910  // O7             - Valid return address
    953   // L0-L7, I0-I7    - Caller's temps (no frame pushed yet)
     911  // L0-L7, I0-I7   - Caller's temps (no frame pushed yet)
    954912  // F0-F7          - more outgoing args
    955913
     
    957915  // Gargs is the incoming argument base, and also an outgoing argument.
    958916  __ sub(Gargs, BytesPerWord, Gargs);
    959 
    960 #ifdef ASSERT
    961   {
    962     // on entry OsavedSP and SP should be equal
    963     Label ok;
    964     __ cmp(O5_savedSP, SP);
    965     __ br(Assembler::equal, false, Assembler::pt, ok);
    966     __ delayed()->nop();
    967     __ stop("I5_savedSP not set");
    968     __ should_not_reach_here();
    969     __ bind(ok);
    970   }
    971 #endif
    972917
    973918  // ON ENTRY TO THE CODE WE ARE MAKING, WE HAVE AN INTERPRETED FRAME
     
    1052997
    1053998    // Load in argument order going down.
    1054     const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize();
    1055 #ifdef _LP64
     999    const int ld_off = (total_args_passed-i)*Interpreter::stackElementSize;
    10561000    set_Rdisp(G1_scratch);
    1057 #endif // _LP64
    10581001
    10591002    VMReg r_1 = regs[i].first();
     
    10751018        // In V9, longs are given 2 64-bit slots in the interpreter, but the
    10761019        // data is passed in only 1 slot.
    1077         Register slot = (sig_bt[i]==T_LONG) ?
     1020        RegisterOrConstant slot = (sig_bt[i] == T_LONG) ?
    10781021              next_arg_slot(ld_off) : arg_slot(ld_off);
    10791022        __ ldx(Gargs, slot, r);
     
    10931036        // are passed on the stack, but need a stack-to-stack move through a
    10941037        // spare float register.
    1095         Register slot = (sig_bt[i]==T_LONG || sig_bt[i] == T_DOUBLE) ?
     1038        RegisterOrConstant slot = (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) ?
    10961039              next_arg_slot(ld_off) : arg_slot(ld_off);
    10971040        __ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister());
     
    11101053      int st_off = reg2offset(regs[i].first()) + STACK_BIAS;
    11111054      // Store down the shuffled stack word.  Target address _is_ aligned.
    1112       if (!r_2->is_valid()) __ stf(FloatRegisterImpl::S, r_1->as_FloatRegister(), SP, st_off);
    1113       else                  __ stf(FloatRegisterImpl::D, r_1->as_FloatRegister(), SP, st_off);
     1055      RegisterOrConstant slot = __ ensure_simm13_or_reg(st_off, Rdisp);
     1056      if (!r_2->is_valid()) __ stf(FloatRegisterImpl::S, r_1->as_FloatRegister(), SP, slot);
     1057      else                  __ stf(FloatRegisterImpl::D, r_1->as_FloatRegister(), SP, slot);
    11141058    }
    11151059  }
     
    11221066    if (regs[i].first()->is_Register() && regs[i].second()->is_valid()) {
    11231067      // Load in argument order going down
    1124       int ld_off = (total_args_passed-i)*Interpreter::stackElementSize();
     1068      int ld_off = (total_args_passed-i)*Interpreter::stackElementSize;
    11251069      // Need to marshal 64-bit value from misaligned Lesp loads
    11261070      Register r = regs[i].first()->as_Register()->after_restore();
     
    11931137                                                            int comp_args_on_stack, // VMRegStackSlots
    11941138                                                            const BasicType *sig_bt,
    1195                                                             const VMRegPair *regs) {
     1139                                                            const VMRegPair *regs,
     1140                                                            AdapterFingerPrint* fingerprint) {
    11961141  address i2c_entry = __ pc();
    11971142
     
    12621207
    12631208  __ flush();
    1264   return new AdapterHandlerEntry(i2c_entry, c2i_entry, c2i_unverified_entry);
     1209  return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
    12651210
    12661211}
     
    30633008  if (callee_locals < callee_parameters)
    30643009    return 0;                   // No adjustment for negative locals
    3065   int diff = (callee_locals - callee_parameters) * Interpreter::stackElementWords();
     3010  int diff = (callee_locals - callee_parameters) * Interpreter::stackElementWords;
    30663011  return round_to(diff, WordsPerLong);
    30673012}
     
    32173162  Register        Oreturn1           = O1;
    32183163  Register        O2UnrollBlock      = O2;
    3219   Register        O3tmp              = O3;
    3220   Register        I5exception_tmp    = I5;
    3221   Register        G4exception_tmp    = G4_scratch;
     3164  Register        L0deopt_mode       = L0;
     3165  Register        G4deopt_mode       = G4_scratch;
    32223166  int             frame_size_words;
    32233167  Address         saved_Freturn0_addr(FP, -sizeof(double) + STACK_BIAS);
     
    32693213  map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
    32703214  __ ba(false, cont);
    3271   __ delayed()->mov(Deoptimization::Unpack_deopt, I5exception_tmp);
     3215  __ delayed()->mov(Deoptimization::Unpack_deopt, L0deopt_mode);
    32723216
    32733217  int exception_offset = __ offset() - start;
     
    33203264
    33213265  __ ba(false, cont);
    3322   __ delayed()->mov(Deoptimization::Unpack_exception, I5exception_tmp);;
     3266  __ delayed()->mov(Deoptimization::Unpack_exception, L0deopt_mode);;
    33233267
    33243268  //
     
    33303274  (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
    33313275
    3332   __ mov(Deoptimization::Unpack_reexecute, I5exception_tmp);
     3276  __ mov(Deoptimization::Unpack_reexecute, L0deopt_mode);
    33333277
    33343278  __ bind(cont);
     
    33533297  // so this move will survive
    33543298
    3355   __ mov(I5exception_tmp, G4exception_tmp);
     3299  __ mov(L0deopt_mode, G4deopt_mode);
    33563300
    33573301  __ mov(O0, O2UnrollBlock->after_save());
     
    33603304
    33613305  Label noException;
    3362   __ cmp(G4exception_tmp, Deoptimization::Unpack_exception);   // Was exception pending?
     3306  __ cmp(G4deopt_mode, Deoptimization::Unpack_exception);   // Was exception pending?
    33633307  __ br(Assembler::notEqual, false, Assembler::pt, noException);
    33643308  __ delayed()->nop();
     
    33943338#endif
    33953339  __ set_last_Java_frame(SP, noreg);
    3396   __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4exception_tmp);
     3340  __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4deopt_mode);
    33973341#else
    33983342  // LP64 uses g4 in set_last_Java_frame
    3399   __ mov(G4exception_tmp, O1);
     3343  __ mov(G4deopt_mode, O1);
    34003344  __ set_last_Java_frame(SP, G0);
    34013345  __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, O1);
     
    34503394  MacroAssembler* masm               = new MacroAssembler(&buffer);
    34513395  Register        O2UnrollBlock      = O2;
    3452   Register        O3tmp              = O3;
    34533396  Register        O2klass_index      = O2;
    34543397
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/sparc.ad

    r2 r278  
    11//
    2 // Copyright 1998-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2// Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
    33// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44//
     
    1717// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818//
    19 // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20 // CA 95054 USA or visit www.sun.com if you need additional information or
    21 // have any questions.
     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.
    2222//
    2323//
     
    194194// the place in the sparc stack crawler that asserts on the 255 is
    195195// fixed up.
    196 reg_def R_D32x(SOC, SOC, Op_RegD,255, F32->as_VMReg());
    197 reg_def R_D32 (SOC, SOC, Op_RegD,  1, F32->as_VMReg()->next());
    198 reg_def R_D34x(SOC, SOC, Op_RegD,255, F34->as_VMReg());
    199 reg_def R_D34 (SOC, SOC, Op_RegD,  3, F34->as_VMReg()->next());
    200 reg_def R_D36x(SOC, SOC, Op_RegD,255, F36->as_VMReg());
    201 reg_def R_D36 (SOC, SOC, Op_RegD,  5, F36->as_VMReg()->next());
    202 reg_def R_D38x(SOC, SOC, Op_RegD,255, F38->as_VMReg());
    203 reg_def R_D38 (SOC, SOC, Op_RegD,  7, F38->as_VMReg()->next());
    204 reg_def R_D40x(SOC, SOC, Op_RegD,255, F40->as_VMReg());
    205 reg_def R_D40 (SOC, SOC, Op_RegD,  9, F40->as_VMReg()->next());
    206 reg_def R_D42x(SOC, SOC, Op_RegD,255, F42->as_VMReg());
    207 reg_def R_D42 (SOC, SOC, Op_RegD, 11, F42->as_VMReg()->next());
    208 reg_def R_D44x(SOC, SOC, Op_RegD,255, F44->as_VMReg());
    209 reg_def R_D44 (SOC, SOC, Op_RegD, 13, F44->as_VMReg()->next());
    210 reg_def R_D46x(SOC, SOC, Op_RegD,255, F46->as_VMReg());
    211 reg_def R_D46 (SOC, SOC, Op_RegD, 15, F46->as_VMReg()->next());
    212 reg_def R_D48x(SOC, SOC, Op_RegD,255, F48->as_VMReg());
    213 reg_def R_D48 (SOC, SOC, Op_RegD, 17, F48->as_VMReg()->next());
    214 reg_def R_D50x(SOC, SOC, Op_RegD,255, F50->as_VMReg());
    215 reg_def R_D50 (SOC, SOC, Op_RegD, 19, F50->as_VMReg()->next());
    216 reg_def R_D52x(SOC, SOC, Op_RegD,255, F52->as_VMReg());
    217 reg_def R_D52 (SOC, SOC, Op_RegD, 21, F52->as_VMReg()->next());
    218 reg_def R_D54x(SOC, SOC, Op_RegD,255, F54->as_VMReg());
    219 reg_def R_D54 (SOC, SOC, Op_RegD, 23, F54->as_VMReg()->next());
    220 reg_def R_D56x(SOC, SOC, Op_RegD,255, F56->as_VMReg());
    221 reg_def R_D56 (SOC, SOC, Op_RegD, 25, F56->as_VMReg()->next());
    222 reg_def R_D58x(SOC, SOC, Op_RegD,255, F58->as_VMReg());
    223 reg_def R_D58 (SOC, SOC, Op_RegD, 27, F58->as_VMReg()->next());
    224 reg_def R_D60x(SOC, SOC, Op_RegD,255, F60->as_VMReg());
    225 reg_def R_D60 (SOC, SOC, Op_RegD, 29, F60->as_VMReg()->next());
    226 reg_def R_D62x(SOC, SOC, Op_RegD,255, F62->as_VMReg());
    227 reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg()->next());
     196reg_def R_D32 (SOC, SOC, Op_RegD,  1, F32->as_VMReg());
     197reg_def R_D32x(SOC, SOC, Op_RegD,255, F32->as_VMReg()->next());
     198reg_def R_D34 (SOC, SOC, Op_RegD,  3, F34->as_VMReg());
     199reg_def R_D34x(SOC, SOC, Op_RegD,255, F34->as_VMReg()->next());
     200reg_def R_D36 (SOC, SOC, Op_RegD,  5, F36->as_VMReg());
     201reg_def R_D36x(SOC, SOC, Op_RegD,255, F36->as_VMReg()->next());
     202reg_def R_D38 (SOC, SOC, Op_RegD,  7, F38->as_VMReg());
     203reg_def R_D38x(SOC, SOC, Op_RegD,255, F38->as_VMReg()->next());
     204reg_def R_D40 (SOC, SOC, Op_RegD,  9, F40->as_VMReg());
     205reg_def R_D40x(SOC, SOC, Op_RegD,255, F40->as_VMReg()->next());
     206reg_def R_D42 (SOC, SOC, Op_RegD, 11, F42->as_VMReg());
     207reg_def R_D42x(SOC, SOC, Op_RegD,255, F42->as_VMReg()->next());
     208reg_def R_D44 (SOC, SOC, Op_RegD, 13, F44->as_VMReg());
     209reg_def R_D44x(SOC, SOC, Op_RegD,255, F44->as_VMReg()->next());
     210reg_def R_D46 (SOC, SOC, Op_RegD, 15, F46->as_VMReg());
     211reg_def R_D46x(SOC, SOC, Op_RegD,255, F46->as_VMReg()->next());
     212reg_def R_D48 (SOC, SOC, Op_RegD, 17, F48->as_VMReg());
     213reg_def R_D48x(SOC, SOC, Op_RegD,255, F48->as_VMReg()->next());
     214reg_def R_D50 (SOC, SOC, Op_RegD, 19, F50->as_VMReg());
     215reg_def R_D50x(SOC, SOC, Op_RegD,255, F50->as_VMReg()->next());
     216reg_def R_D52 (SOC, SOC, Op_RegD, 21, F52->as_VMReg());
     217reg_def R_D52x(SOC, SOC, Op_RegD,255, F52->as_VMReg()->next());
     218reg_def R_D54 (SOC, SOC, Op_RegD, 23, F54->as_VMReg());
     219reg_def R_D54x(SOC, SOC, Op_RegD,255, F54->as_VMReg()->next());
     220reg_def R_D56 (SOC, SOC, Op_RegD, 25, F56->as_VMReg());
     221reg_def R_D56x(SOC, SOC, Op_RegD,255, F56->as_VMReg()->next());
     222reg_def R_D58 (SOC, SOC, Op_RegD, 27, F58->as_VMReg());
     223reg_def R_D58x(SOC, SOC, Op_RegD,255, F58->as_VMReg()->next());
     224reg_def R_D60 (SOC, SOC, Op_RegD, 29, F60->as_VMReg());
     225reg_def R_D60x(SOC, SOC, Op_RegD,255, F60->as_VMReg()->next());
     226reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg());
     227reg_def R_D62x(SOC, SOC, Op_RegD,255, F62->as_VMReg()->next());
    228228
    229229
     
    472472#define __ _masm.
    473473
     474// Block initializing store
     475#define ASI_BLK_INIT_QUAD_LDD_P    0xE2
     476
    474477// tertiary op of a LoadP or StoreP encoding
    475478#define REGP_OP true
     
    532535
    533536int MachCallStaticJavaNode::ret_addr_offset() {
    534   return NativeCall::instruction_size;  // call; delay slot
     537  int offset = NativeCall::instruction_size;  // call; delay slot
     538  if (_method_handle_invoke)
     539    offset += 4;  // restore SP
     540  return offset;
    535541}
    536542
     
    816822          !(n->ideal_Opcode()==Op_PrefetchRead  && ld_op==Op_LoadI) &&
    817823          !(n->ideal_Opcode()==Op_PrefetchWrite && ld_op==Op_LoadI) &&
     824          !(n->ideal_Opcode()==Op_Load2I    && ld_op==Op_LoadD) &&
     825          !(n->ideal_Opcode()==Op_Load4C    && ld_op==Op_LoadD) &&
     826          !(n->ideal_Opcode()==Op_Load4S    && ld_op==Op_LoadD) &&
     827          !(n->ideal_Opcode()==Op_Load8B    && ld_op==Op_LoadD) &&
    818828          !(n->rule() == loadUB_rule)) {
    819829        verify_oops_warning(n, n->ideal_Opcode(), ld_op);
     
    827837          !(n->ideal_Opcode()==Op_StoreF && st_op==Op_StoreI) &&
    828838          !(n->ideal_Opcode()==Op_StoreL && st_op==Op_StoreI) &&
     839          !(n->ideal_Opcode()==Op_Store2I && st_op==Op_StoreD) &&
     840          !(n->ideal_Opcode()==Op_Store4C && st_op==Op_StoreD) &&
     841          !(n->ideal_Opcode()==Op_Store8B && st_op==Op_StoreD) &&
    829842          !(n->ideal_Opcode()==Op_StoreD && st_op==Op_StoreI && n->rule() == storeD0_rule)) {
    830843        verify_oops_warning(n, n->ideal_Opcode(), st_op);
     
    921934}
    922935
    923 void emit_form3_mem_reg_asi(CodeBuffer &cbuf, const MachNode* n, int primary, int tertiary,
    924                         int src1_enc, int disp32, int src2_enc, int dst_enc, int asi) {
    925 
    926   uint instr;
    927   instr = (Assembler::ldst_op << 30)
    928         | (dst_enc        << 25)
    929         | (primary        << 19)
    930         | (src1_enc       << 14);
    931 
    932   int disp = disp32;
    933   int index    = src2_enc;
    934 
    935   if (src1_enc == R_SP_enc || src1_enc == R_FP_enc)
    936     disp += STACK_BIAS;
    937 
    938   // We should have a compiler bailout here rather than a guarantee.
    939   // Better yet would be some mechanism to handle variable-size matches correctly.
    940   guarantee(Assembler::is_simm13(disp), "Do not match large constant offsets" );
    941 
    942   if( disp != 0 ) {
    943     // use reg-reg form
    944     // set src2=R_O7 contains offset
    945     index = R_O7_enc;
    946     emit3_simm13( cbuf, Assembler::arith_op, index, Assembler::or_op3, 0, disp);
    947   }
    948   instr |= (asi << 5);
    949   instr |= index;
    950   uint *code = (uint*)cbuf.code_end();
    951   *code = instr;
    952   cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord);
    953 }
    954 
    955936void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) {
    956937  // The method which records debug information at every safepoint
     
    17801761const bool Matcher::clone_shift_expressions = false;
    17811762
     1763bool Matcher::narrow_oop_use_complex_address() {
     1764  NOT_LP64(ShouldNotCallThis());
     1765  assert(UseCompressedOops, "only for compressed oops code");
     1766  return false;
     1767}
     1768
    17821769// Is it better to copy float constants, or load them directly from memory?
    17831770// Intel can load a float constant from a direct address, requiring no
     
    18041791const bool Matcher::strict_fp_requires_explicit_rounding = false;
    18051792
    1806 // Do floats take an entire double register or just half?
    1807 const bool Matcher::float_in_double = false;
     1793// Are floats conerted to double when stored to stack during deoptimization?
     1794// Sparc does not handle callee-save floats.
     1795bool Matcher::float_in_double() { return false; }
    18081796
    18091797// Do ints take an entire long register or just half?
     
    18841872  ShouldNotReachHere();
    18851873  return RegMask();
     1874}
     1875
     1876const RegMask Matcher::method_handle_invoke_SP_save_mask() {
     1877  return L7_REGP_mask;
    18861878}
    18871879
     
    19471939  %}
    19481940
    1949   enc_class form3_mem_reg_little( memory mem, iRegI dst) %{
    1950     emit_form3_mem_reg_asi(cbuf, this, $primary, -1,
    1951                      $mem$$base, $mem$$disp, $mem$$index, $dst$$reg, Assembler::ASI_PRIMARY_LITTLE);
    1952   %}
    1953 
    19541941  enc_class form3_mem_prefetch_read( memory mem ) %{
    19551942    emit_form3_mem_reg(cbuf, this, $primary, -1,
     
    24692456    emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type,
    24702457                    /*preserve_g2=*/true, /*force far call*/true);
     2458  %}
     2459
     2460  enc_class preserve_SP %{
     2461    MacroAssembler _masm(&cbuf);
     2462    __ mov(SP, L7_mh_SP_save);
     2463  %}
     2464
     2465  enc_class restore_SP %{
     2466    MacroAssembler _masm(&cbuf);
     2467    __ mov(L7_mh_SP_save, SP);
    24712468  %}
    24722469
     
    28392836
    28402837
    2841   enc_class enc_String_Compare(o0RegP str1, o1RegP str2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result) %{
     2838  enc_class enc_String_Compare(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, notemp_iRegI result) %{
    28422839    Label Ldone, Lloop;
    28432840    MacroAssembler _masm(&cbuf);
     
    28452842    Register   str1_reg = reg_to_register_object($str1$$reg);
    28462843    Register   str2_reg = reg_to_register_object($str2$$reg);
    2847     Register   tmp1_reg = reg_to_register_object($tmp1$$reg);
    2848     Register   tmp2_reg = reg_to_register_object($tmp2$$reg);
     2844    Register   cnt1_reg = reg_to_register_object($cnt1$$reg);
     2845    Register   cnt2_reg = reg_to_register_object($cnt2$$reg);
    28492846    Register result_reg = reg_to_register_object($result$$reg);
    28502847
    2851     // Get the first character position in both strings
    2852     //         [8] char array, [12] offset, [16] count
    2853     int  value_offset = java_lang_String:: value_offset_in_bytes();
    2854     int offset_offset = java_lang_String::offset_offset_in_bytes();
    2855     int  count_offset = java_lang_String:: count_offset_in_bytes();
    2856 
    2857     // load str1 (jchar*) base address into tmp1_reg
    2858     __ load_heap_oop(str1_reg, value_offset, tmp1_reg);
    2859     __ ld(str1_reg, offset_offset, result_reg);
    2860     __ add(tmp1_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1_reg);
    2861     __   ld(str1_reg, count_offset, str1_reg); // hoisted
    2862     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
    2863     __   load_heap_oop(str2_reg, value_offset, tmp2_reg); // hoisted
    2864     __ add(result_reg, tmp1_reg, tmp1_reg);
    2865 
    2866     // load str2 (jchar*) base address into tmp2_reg
    2867     // __ ld_ptr(str2_reg, value_offset, tmp2_reg); // hoisted
    2868     __ ld(str2_reg, offset_offset, result_reg);
    2869     __ add(tmp2_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp2_reg);
    2870     __   ld(str2_reg, count_offset, str2_reg); // hoisted
    2871     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
    2872     __   subcc(str1_reg, str2_reg, O7); // hoisted
    2873     __ add(result_reg, tmp2_reg, tmp2_reg);
     2848    assert(result_reg != str1_reg &&
     2849           result_reg != str2_reg &&
     2850           result_reg != cnt1_reg &&
     2851           result_reg != cnt2_reg ,
     2852           "need different registers");
    28742853
    28752854    // Compute the minimum of the string lengths(str1_reg) and the
    28762855    // difference of the string lengths (stack)
    2877 
    2878     // discard string base pointers, after loading up the lengths
    2879     // __ ld(str1_reg, count_offset, str1_reg); // hoisted
    2880     // __ ld(str2_reg, count_offset, str2_reg); // hoisted
    28812856
    28822857    // See if the lengths are different, and calculate min in str1_reg.
    28832858    // Stash diff in O7 in case we need it for a tie-breaker.
    28842859    Label Lskip;
    2885     // __ subcc(str1_reg, str2_reg, O7); // hoisted
    2886     __ sll(str1_reg, exact_log2(sizeof(jchar)), str1_reg); // scale the limit
     2860    __ subcc(cnt1_reg, cnt2_reg, O7);
     2861    __ sll(cnt1_reg, exact_log2(sizeof(jchar)), cnt1_reg); // scale the limit
    28872862    __ br(Assembler::greater, true, Assembler::pt, Lskip);
    2888     // str2 is shorter, so use its count:
    2889     __ delayed()->sll(str2_reg, exact_log2(sizeof(jchar)), str1_reg); // scale the limit
     2863    // cnt2 is shorter, so use its count:
     2864    __ delayed()->sll(cnt2_reg, exact_log2(sizeof(jchar)), cnt1_reg); // scale the limit
    28902865    __ bind(Lskip);
    28912866
    2892     // reallocate str1_reg, str2_reg, result_reg
     2867    // reallocate cnt1_reg, cnt2_reg, result_reg
    28932868    // Note:  limit_reg holds the string length pre-scaled by 2
    2894     Register limit_reg =   str1_reg;
    2895     Register  chr2_reg =   str2_reg;
     2869    Register limit_reg =   cnt1_reg;
     2870    Register  chr2_reg =   cnt2_reg;
    28962871    Register  chr1_reg = result_reg;
    2897     // tmp{12} are the base pointers
     2872    // str{12} are the base pointers
    28982873
    28992874    // Is the minimum length zero?
     
    29032878
    29042879    // Load first characters
    2905     __ lduh(tmp1_reg, 0, chr1_reg);
    2906     __ lduh(tmp2_reg, 0, chr2_reg);
     2880    __ lduh(str1_reg, 0, chr1_reg);
     2881    __ lduh(str2_reg, 0, chr2_reg);
    29072882
    29082883    // Compare first characters
     
    29162891      Label LSkip2;
    29172892      // Check if the strings start at same location
    2918       __ cmp(tmp1_reg, tmp2_reg);
     2893      __ cmp(str1_reg, str2_reg);
    29192894      __ brx(Assembler::notEqual, true, Assembler::pt, LSkip2);
    29202895      __ delayed()->nop();
     
    29332908    __ delayed()->mov(O7, result_reg);  // result is difference in lengths
    29342909
    2935     // Shift tmp1_reg and tmp2_reg to the end of the arrays, negate limit
    2936     __ add(tmp1_reg, limit_reg, tmp1_reg);
    2937     __ add(tmp2_reg, limit_reg, tmp2_reg);
     2910    // Shift str1_reg and str2_reg to the end of the arrays, negate limit
     2911    __ add(str1_reg, limit_reg, str1_reg);
     2912    __ add(str2_reg, limit_reg, str2_reg);
    29382913    __ neg(chr1_reg, limit_reg);  // limit = -(limit-2)
    29392914
    29402915    // Compare the rest of the characters
    2941     __ lduh(tmp1_reg, limit_reg, chr1_reg);
     2916    __ lduh(str1_reg, limit_reg, chr1_reg);
    29422917    __ bind(Lloop);
    2943     // __ lduh(tmp1_reg, limit_reg, chr1_reg); // hoisted
    2944     __ lduh(tmp2_reg, limit_reg, chr2_reg);
     2918    // __ lduh(str1_reg, limit_reg, chr1_reg); // hoisted
     2919    __ lduh(str2_reg, limit_reg, chr2_reg);
    29452920    __ subcc(chr1_reg, chr2_reg, chr1_reg);
    29462921    __ br(Assembler::notZero, false, Assembler::pt, Ldone);
     
    29492924    // annul LDUH if branch is not taken to prevent access past end of string
    29502925    __ br(Assembler::notZero, true, Assembler::pt, Lloop);
    2951     __ delayed()->lduh(tmp1_reg, limit_reg, chr1_reg); // hoisted
     2926    __ delayed()->lduh(str1_reg, limit_reg, chr1_reg); // hoisted
    29522927
    29532928    // If strings are equal up to min length, return the length difference.
     
    29582933  %}
    29592934
    2960 enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result) %{
    2961     Label Lword, Lword_loop, Lpost_word, Lchar, Lchar_loop, Ldone;
     2935enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI result) %{
     2936    Label Lword_loop, Lpost_word, Lchar, Lchar_loop, Ldone;
    29622937    MacroAssembler _masm(&cbuf);
    29632938
    29642939    Register   str1_reg = reg_to_register_object($str1$$reg);
    29652940    Register   str2_reg = reg_to_register_object($str2$$reg);
    2966     Register   tmp1_reg = reg_to_register_object($tmp1$$reg);
    2967     Register   tmp2_reg = reg_to_register_object($tmp2$$reg);
     2941    Register    cnt_reg = reg_to_register_object($cnt$$reg);
     2942    Register   tmp1_reg = O7;
    29682943    Register result_reg = reg_to_register_object($result$$reg);
    29692944
    2970     // Get the first character position in both strings
    2971     //         [8] char array, [12] offset, [16] count
    2972     int  value_offset = java_lang_String:: value_offset_in_bytes();
    2973     int offset_offset = java_lang_String::offset_offset_in_bytes();
    2974     int  count_offset = java_lang_String:: count_offset_in_bytes();
    2975 
    2976     // load str1 (jchar*) base address into tmp1_reg
    2977     __ load_heap_oop(Address(str1_reg, value_offset), tmp1_reg);
    2978     __ ld(Address(str1_reg, offset_offset), result_reg);
    2979     __ add(tmp1_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp1_reg);
    2980     __    ld(Address(str1_reg, count_offset), str1_reg); // hoisted
    2981     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
    2982     __    load_heap_oop(Address(str2_reg, value_offset), tmp2_reg); // hoisted
    2983     __ add(result_reg, tmp1_reg, tmp1_reg);
    2984 
    2985     // load str2 (jchar*) base address into tmp2_reg
    2986     // __ ld_ptr(Address(str2_reg, value_offset), tmp2_reg); // hoisted
    2987     __ ld(Address(str2_reg, offset_offset), result_reg);
    2988     __ add(tmp2_reg, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp2_reg);
    2989     __    ld(Address(str2_reg, count_offset), str2_reg); // hoisted
    2990     __ sll(result_reg, exact_log2(sizeof(jchar)), result_reg);
    2991     __   cmp(str1_reg, str2_reg); // hoisted
    2992     __ add(result_reg, tmp2_reg, tmp2_reg);
    2993 
    2994     __ sll(str1_reg, exact_log2(sizeof(jchar)), str1_reg);
    2995     __ br(Assembler::notEqual, true, Assembler::pt, Ldone);
    2996     __ delayed()->mov(G0, result_reg);    // not equal
    2997 
    2998     __ br_zero(Assembler::equal, true, Assembler::pn, str1_reg, Ldone);
    2999     __ delayed()->add(G0, 1, result_reg); //equals
    3000 
    3001     __ cmp(tmp1_reg, tmp2_reg); //same string ?
     2945    assert(result_reg != str1_reg &&
     2946           result_reg != str2_reg &&
     2947           result_reg !=  cnt_reg &&
     2948           result_reg != tmp1_reg ,
     2949           "need different registers");
     2950
     2951    __ cmp(str1_reg, str2_reg); //same char[] ?
    30022952    __ brx(Assembler::equal, true, Assembler::pn, Ldone);
    30032953    __ delayed()->add(G0, 1, result_reg);
    30042954
     2955    __ br_on_reg_cond(Assembler::rc_z, true, Assembler::pn, cnt_reg, Ldone);
     2956    __ delayed()->add(G0, 1, result_reg); // count == 0
     2957
    30052958    //rename registers
    3006     Register limit_reg =   str1_reg;
    3007     Register  chr2_reg =   str2_reg;
     2959    Register limit_reg =    cnt_reg;
    30082960    Register  chr1_reg = result_reg;
    3009     // tmp{12} are the base pointers
     2961    Register  chr2_reg =   tmp1_reg;
    30102962
    30112963    //check for alignment and position the pointers to the ends
    3012     __ or3(tmp1_reg, tmp2_reg, chr1_reg);
    3013     __ andcc(chr1_reg, 0x3, chr1_reg); // notZero means at least one not 4-byte aligned
    3014     __ br(Assembler::notZero, false, Assembler::pn, Lchar);
    3015     __ delayed()->nop();
    3016 
    3017     __ bind(Lword);
    3018     __ and3(limit_reg, 0x2, O7); //remember the remainder (either 0 or 2)
    3019     __ andn(limit_reg, 0x3, limit_reg);
    3020     __ br_zero(Assembler::zero, false, Assembler::pn, limit_reg, Lpost_word);
    3021     __ delayed()->nop();
    3022 
    3023     __ add(tmp1_reg, limit_reg, tmp1_reg);
    3024     __ add(tmp2_reg, limit_reg, tmp2_reg);
    3025     __ neg(limit_reg);
    3026 
    3027     __ lduw(tmp1_reg, limit_reg, chr1_reg);
    3028     __ bind(Lword_loop);
    3029     __ lduw(tmp2_reg, limit_reg, chr2_reg);
    3030     __ cmp(chr1_reg, chr2_reg);
    3031     __ br(Assembler::notEqual, true, Assembler::pt, Ldone);
    3032     __ delayed()->mov(G0, result_reg);
    3033     __ inccc(limit_reg, 2*sizeof(jchar));
    3034     // annul LDUW if branch i  s not taken to prevent access past end of string
    3035     __ br(Assembler::notZero, true, Assembler::pt, Lword_loop); //annul on taken
    3036     __ delayed()->lduw(tmp1_reg, limit_reg, chr1_reg); // hoisted
    3037 
    3038     __ bind(Lpost_word);
    3039     __ br_zero(Assembler::zero, true, Assembler::pt, O7, Ldone);
    3040     __ delayed()->add(G0, 1, result_reg);
    3041 
    3042     __ lduh(tmp1_reg, 0, chr1_reg);
    3043     __ lduh(tmp2_reg, 0, chr2_reg);
    3044     __ cmp (chr1_reg, chr2_reg);
    3045     __ br(Assembler::notEqual, true, Assembler::pt, Ldone);
    3046     __ delayed()->mov(G0, result_reg);
     2964    __ or3(str1_reg, str2_reg, chr1_reg);
     2965    __ andcc(chr1_reg, 0x3, chr1_reg);
     2966    // notZero means at least one not 4-byte aligned.
     2967    // We could optimize the case when both arrays are not aligned
     2968    // but it is not frequent case and it requires additional checks.
     2969    __ br(Assembler::notZero, false, Assembler::pn, Lchar); // char by char compare
     2970    __ delayed()->sll(limit_reg, exact_log2(sizeof(jchar)), limit_reg); // set byte count
     2971
     2972    // Compare char[] arrays aligned to 4 bytes.
     2973    __ char_arrays_equals(str1_reg, str2_reg, limit_reg, result_reg,
     2974                          chr1_reg, chr2_reg, Ldone);
    30472975    __ ba(false,Ldone);
    30482976    __ delayed()->add(G0, 1, result_reg);
    30492977
     2978    // char by char compare
    30502979    __ bind(Lchar);
    3051     __ add(tmp1_reg, limit_reg, tmp1_reg);
    3052     __ add(tmp2_reg, limit_reg, tmp2_reg);
     2980    __ add(str1_reg, limit_reg, str1_reg);
     2981    __ add(str2_reg, limit_reg, str2_reg);
    30532982    __ neg(limit_reg); //negate count
    30542983
    3055     __ lduh(tmp1_reg, limit_reg, chr1_reg);
     2984    __ lduh(str1_reg, limit_reg, chr1_reg);
     2985    // Lchar_loop
    30562986    __ bind(Lchar_loop);
    3057     __ lduh(tmp2_reg, limit_reg, chr2_reg);
     2987    __ lduh(str2_reg, limit_reg, chr2_reg);
    30582988    __ cmp(chr1_reg, chr2_reg);
    30592989    __ br(Assembler::notEqual, true, Assembler::pt, Ldone);
     
    30612991    __ inccc(limit_reg, sizeof(jchar));
    30622992    // annul LDUH if branch is not taken to prevent access past end of string
    3063     __ br(Assembler::notZero, true, Assembler::pt, Lchar_loop); //annul on taken
    3064     __ delayed()->lduh(tmp1_reg, limit_reg, chr1_reg); // hoisted
     2993    __ br(Assembler::notZero, true, Assembler::pt, Lchar_loop);
     2994    __ delayed()->lduh(str1_reg, limit_reg, chr1_reg); // hoisted
    30652995
    30662996    __ add(G0, 1, result_reg);  //equal
     
    30692999  %}
    30703000
    3071 enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result) %{
     3001enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, notemp_iRegI result) %{
    30723002    Label Lvector, Ldone, Lloop;
    30733003    MacroAssembler _masm(&cbuf);
     
    30763006    Register   ary2_reg = reg_to_register_object($ary2$$reg);
    30773007    Register   tmp1_reg = reg_to_register_object($tmp1$$reg);
    3078     Register   tmp2_reg = reg_to_register_object($tmp2$$reg);
     3008    Register   tmp2_reg = O7;
    30793009    Register result_reg = reg_to_register_object($result$$reg);
    30803010
     
    30843014    // return true if the same array
    30853015    __ cmp(ary1_reg, ary2_reg);
    3086     __ br(Assembler::equal, true, Assembler::pn, Ldone);
     3016    __ brx(Assembler::equal, true, Assembler::pn, Ldone);
    30873017    __ delayed()->add(G0, 1, result_reg); // equal
    30883018
     
    31023032    __ delayed()->mov(G0, result_reg);     // not equal
    31033033
    3104     __ br_zero(Assembler::zero, true, Assembler::pn, tmp1_reg, Ldone);
     3034    __ br_on_reg_cond(Assembler::rc_z, true, Assembler::pn, tmp1_reg, Ldone);
    31053035    __ delayed()->add(G0, 1, result_reg); // zero-length arrays are equal
    31063036
     
    31103040
    31113041    // renaming registers
    3112     Register chr1_reg  =  tmp2_reg;  // for characters in ary1
    3113     Register chr2_reg  =  result_reg; // for characters in ary2
     3042    Register chr1_reg  =  result_reg; // for characters in ary1
     3043    Register chr2_reg  =  tmp2_reg;  // for characters in ary2
    31143044    Register limit_reg =  tmp1_reg;   // length
    31153045
    31163046    // set byte count
    31173047    __ sll(limit_reg, exact_log2(sizeof(jchar)), limit_reg);
    3118     __ andcc(limit_reg, 0x2, chr1_reg); //trailing character ?
    3119     __ br(Assembler::zero, false, Assembler::pt, Lvector);
    3120     __ delayed()->nop();
    3121 
    3122     //compare the trailing char
    3123     __ sub(limit_reg, sizeof(jchar), limit_reg);
    3124     __ lduh(ary1_reg, limit_reg, chr1_reg);
    3125     __ lduh(ary2_reg, limit_reg, chr2_reg);
    3126     __ cmp(chr1_reg, chr2_reg);
    3127     __ br(Assembler::notEqual, true, Assembler::pt, Ldone);
    3128     __ delayed()->mov(G0, result_reg);     // not equal
    3129 
    3130     // only one char ?
    3131     __ br_zero(Assembler::zero, true, Assembler::pn, limit_reg, Ldone);
    3132     __ delayed()->add(G0, 1, result_reg); // zero-length arrays are equal
    3133 
    3134     __ bind(Lvector);
    3135     // Shift ary1_reg and ary2_reg to the end of the arrays, negate limit
    3136     __ add(ary1_reg, limit_reg, ary1_reg);
    3137     __ add(ary2_reg, limit_reg, ary2_reg);
    3138     __ neg(limit_reg, limit_reg);
    3139 
    3140     __ lduw(ary1_reg, limit_reg, chr1_reg);
    3141     __ bind(Lloop);
    3142     __ lduw(ary2_reg, limit_reg, chr2_reg);
    3143     __ cmp(chr1_reg, chr2_reg);
    3144     __ br(Assembler::notEqual, false, Assembler::pt, Ldone);
    3145     __ delayed()->mov(G0, result_reg);     // not equal
    3146     __ inccc(limit_reg, 2*sizeof(jchar));
    3147     // annul LDUW if branch is not taken to prevent access past end of string
    3148     __ br(Assembler::notZero, true, Assembler::pt, Lloop); //annul on taken
    3149     __ delayed()->lduw(ary1_reg, limit_reg, chr1_reg); // hoisted
    3150 
     3048
     3049    // Compare char[] arrays aligned to 4 bytes.
     3050    __ char_arrays_equals(ary1_reg, ary2_reg, limit_reg, result_reg,
     3051                          chr1_reg, chr2_reg, Ldone);
    31513052    __ add(G0, 1, result_reg); // equals
    31523053
     
    44004301// multiple operand types with the same basic encoding and format.  The classic
    44014302// case of this is memory operands.
    4402 // Indirect is not included since its use is limited to Compare & Swap
    44034303opclass memory( indirect, indOffset13, indIndex );
     4304opclass indIndexMemory( indIndex );
    44044305
    44054306//----------PIPELINE-----------------------------------------------------------
     
    57085609  ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
    57095610
    5710   size(3*4);
     5611  size((3+1)*4);  // set may use two instructions.
    57115612  format %{ "LDUH   $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t"
    57125613            "SET    $mask,$tmp\n\t"
     
    58525753  ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST);
    58535754
    5854   size(3*4);
     5755  size((3+1)*4);  // set may use two instructions.
    58555756  format %{ "LDUW   $mem,$dst\t! int & 32-bit mask -> long\n\t"
    58565757            "SET    $mask,$tmp\n\t"
     
    62396140
    62406141instruct prefetchw( memory mem ) %{
     6142  predicate(AllocatePrefetchStyle != 3 );
    62416143  match( PrefetchWrite mem );
    62426144  ins_cost(MEMORY_REF_COST);
     
    62486150%}
    62496151
     6152// Use BIS instruction to prefetch.
     6153instruct prefetchw_bis( memory mem ) %{
     6154  predicate(AllocatePrefetchStyle == 3);
     6155  match( PrefetchWrite mem );
     6156  ins_cost(MEMORY_REF_COST);
     6157
     6158  format %{ "STXA   G0,$mem\t! // Block initializing store" %}
     6159  ins_encode %{
     6160     Register base = as_Register($mem$$base);
     6161     int disp = $mem$$disp;
     6162     if (disp != 0) {
     6163       __ add(base, AllocatePrefetchStepSize, base);
     6164     }
     6165     __ stxa(G0, base, G0, ASI_BLK_INIT_QUAD_LDD_P);
     6166  %}
     6167  ins_pipe(istore_mem_reg);
     6168%}
    62506169
    62516170//----------Store Instructions-------------------------------------------------
     
    67616680%}
    67626681
    6763 instruct cmovII_U_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{
     6682instruct cmovIIu_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{
    67646683  match(Set dst (CMoveI (Binary cmp icc) (Binary dst src)));
    67656684  ins_cost(150);
     
    67706689%}
    67716690
    6772 instruct cmovII_U_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{
     6691instruct cmovIIu_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{
    67736692  match(Set dst (CMoveI (Binary cmp icc) (Binary dst src)));
    67746693  ins_cost(140);
     
    68166735%}
    68176736
     6737// This instruction also works with CmpN so we don't need cmovNN_reg.
     6738instruct cmovNIu_reg(cmpOpU cmp, flagsRegU icc, iRegN dst, iRegN src) %{
     6739  match(Set dst (CMoveN (Binary cmp icc) (Binary dst src)));
     6740  ins_cost(150);
     6741  size(4);
     6742  format %{ "MOV$cmp  $icc,$src,$dst" %}
     6743  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) );
     6744  ins_pipe(ialu_reg);
     6745%}
     6746
    68186747instruct cmovNF_reg(cmpOpF cmp, flagsRegF fcc, iRegN dst, iRegN src) %{
    68196748  match(Set dst (CMoveN (Binary cmp fcc) (Binary dst src)));
     
    68536782%}
    68546783
     6784instruct cmovPIu_reg(cmpOpU cmp, flagsRegU icc, iRegP dst, iRegP src) %{
     6785  match(Set dst (CMoveP (Binary cmp icc) (Binary dst src)));
     6786  ins_cost(150);
     6787
     6788  size(4);
     6789  format %{ "MOV$cmp  $icc,$src,$dst\t! ptr" %}
     6790  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) );
     6791  ins_pipe(ialu_reg);
     6792%}
     6793
    68556794instruct cmovPI_imm(cmpOp cmp, flagsReg icc, iRegP dst, immP0 src) %{
     6795  match(Set dst (CMoveP (Binary cmp icc) (Binary dst src)));
     6796  ins_cost(140);
     6797
     6798  size(4);
     6799  format %{ "MOV$cmp  $icc,$src,$dst\t! ptr" %}
     6800  ins_encode( enc_cmov_imm(cmp,dst,src, (Assembler::icc)) );
     6801  ins_pipe(ialu_imm);
     6802%}
     6803
     6804instruct cmovPIu_imm(cmpOpU cmp, flagsRegU icc, iRegP dst, immP0 src) %{
    68566805  match(Set dst (CMoveP (Binary cmp icc) (Binary dst src)));
    68576806  ins_cost(140);
     
    69026851%}
    69036852
     6853instruct cmovFIu_reg(cmpOpU cmp, flagsRegU icc, regF dst, regF src) %{
     6854  match(Set dst (CMoveF (Binary cmp icc) (Binary dst src)));
     6855  ins_cost(150);
     6856
     6857  size(4);
     6858  format %{ "FMOVS$cmp $icc,$src,$dst" %}
     6859  opcode(0x101);
     6860  ins_encode( enc_cmovf_reg(cmp,dst,src, (Assembler::icc)) );
     6861  ins_pipe(int_conditional_float_move);
     6862%}
     6863
    69046864// Conditional move,
    69056865instruct cmovFF_reg(cmpOpF cmp, flagsRegF fcc, regF dst, regF src) %{
     
    69256885
    69266886instruct cmovDI_reg(cmpOp cmp, flagsReg icc, regD dst, regD src) %{
     6887  match(Set dst (CMoveD (Binary cmp icc) (Binary dst src)));
     6888  ins_cost(150);
     6889
     6890  size(4);
     6891  format %{ "FMOVD$cmp $icc,$src,$dst" %}
     6892  opcode(0x102);
     6893  ins_encode( enc_cmovf_reg(cmp,dst,src, (Assembler::icc)) );
     6894  ins_pipe(int_conditional_double_move);
     6895%}
     6896
     6897instruct cmovDIu_reg(cmpOpU cmp, flagsRegU icc, regD dst, regD src) %{
    69276898  match(Set dst (CMoveD (Binary cmp icc) (Binary dst src)));
    69286899  ins_cost(150);
     
    69646935
    69656936instruct cmovLI_reg(cmpOp cmp, flagsReg icc, iRegL dst, iRegL src) %{
     6937  match(Set dst (CMoveL (Binary cmp icc) (Binary dst src)));
     6938  ins_cost(150);
     6939
     6940  size(4);
     6941  format %{ "MOV$cmp  $icc,$src,$dst\t! long" %}
     6942  ins_encode( enc_cmov_reg(cmp,dst,src, (Assembler::icc)) );
     6943  ins_pipe(ialu_reg);
     6944%}
     6945
     6946
     6947instruct cmovLIu_reg(cmpOpU cmp, flagsRegU icc, iRegL dst, iRegL src) %{
    69666948  match(Set dst (CMoveL (Binary cmp icc) (Binary dst src)));
    69676949  ins_cost(150);
     
    92589240instruct CallStaticJavaDirect( method meth ) %{
    92599241  match(CallStaticJava);
     9242  predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke());
    92609243  effect(USE meth);
    92619244
     
    92649247  format %{ "CALL,static  ; NOP ==> " %}
    92659248  ins_encode( Java_Static_Call( meth ), call_epilog );
     9249  ins_pc_relative(1);
     9250  ins_pipe(simple_call);
     9251%}
     9252
     9253// Call Java Static Instruction (method handle version)
     9254instruct CallStaticJavaHandle(method meth, l7RegP l7_mh_SP_save) %{
     9255  match(CallStaticJava);
     9256  predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke());
     9257  effect(USE meth, KILL l7_mh_SP_save);
     9258
     9259  size(8);
     9260  ins_cost(CALL_COST);
     9261  format %{ "CALL,static/MethodHandle" %}
     9262  ins_encode(preserve_SP, Java_Static_Call(meth), restore_SP, call_epilog);
    92669263  ins_pc_relative(1);
    92679264  ins_pipe(simple_call);
     
    94729469%}
    94739470
    9474 instruct string_compare(o0RegP str1, o1RegP str2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result,
    9475                         o7RegI tmp3, flagsReg ccr) %{
    9476   match(Set result (StrComp str1 str2));
    9477   effect(USE_KILL str1, USE_KILL str2, KILL tmp1, KILL tmp2, KILL ccr, KILL tmp3);
     9471instruct string_compare(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, notemp_iRegI result,
     9472                        o7RegI tmp, flagsReg ccr) %{
     9473  match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
     9474  effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL ccr, KILL tmp);
    94789475  ins_cost(300);
    9479   format %{ "String Compare $str1,$str2 -> $result" %}
    9480   ins_encode( enc_String_Compare(str1, str2, tmp1, tmp2, result) );
     9476  format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result   // KILL $tmp" %}
     9477  ins_encode( enc_String_Compare(str1, str2, cnt1, cnt2, result) );
    94819478  ins_pipe(long_memory_op);
    94829479%}
    94839480
    9484 instruct string_equals(o0RegP str1, o1RegP str2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result,
    9485                        o7RegI tmp3, flagsReg ccr) %{
    9486   match(Set result (StrEquals str1 str2));
    9487   effect(USE_KILL str1, USE_KILL str2, KILL tmp1, KILL tmp2, KILL ccr, KILL tmp3);
     9481instruct string_equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI result,
     9482                       o7RegI tmp, flagsReg ccr) %{
     9483  match(Set result (StrEquals (Binary str1 str2) cnt));
     9484  effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt, KILL tmp, KILL ccr);
    94889485  ins_cost(300);
    9489   format %{ "String Equals $str1,$str2 -> $result" %}
    9490   ins_encode( enc_String_Equals(str1, str2, tmp1, tmp2, result) );
     9486  format %{ "String Equals $str1,$str2,$cnt -> $result   // KILL $tmp" %}
     9487  ins_encode( enc_String_Equals(str1, str2, cnt, result) );
    94919488  ins_pipe(long_memory_op);
    94929489%}
    94939490
    9494 instruct array_equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, g4RegP tmp2, notemp_iRegI result,
    9495                         flagsReg ccr) %{
     9491instruct array_equals(o0RegP ary1, o1RegP ary2, g3RegI tmp1, notemp_iRegI result,
     9492                      o7RegI tmp2, flagsReg ccr) %{
    94969493  match(Set result (AryEq ary1 ary2));
    94979494  effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL ccr);
    94989495  ins_cost(300);
    9499   format %{ "Array Equals $ary1,$ary2 -> $result" %}
    9500   ins_encode( enc_Array_Equals(ary1, ary2, tmp1, tmp2, result));
     9496  format %{ "Array Equals $ary1,$ary2 -> $result   // KILL $tmp1,$tmp2" %}
     9497  ins_encode( enc_Array_Equals(ary1, ary2, tmp1, result));
    95019498  ins_pipe(long_memory_op);
    95029499%}
     
    96749671instruct bytes_reverse_int(iRegI dst, stackSlotI src) %{
    96759672  match(Set dst (ReverseBytesI src));
    9676   effect(DEF dst, USE src);
    96779673
    96789674  // Op cost is artificially doubled to make sure that load or store
     
    96809676  // onto a stack slot.
    96819677  ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
    9682   size(8);
    96839678  format %{ "LDUWA  $src, $dst\t!asi=primary_little" %}
    9684   opcode(Assembler::lduwa_op3);
    9685   ins_encode( form3_mem_reg_little(src, dst) );
     9679
     9680  ins_encode %{
     9681    __ set($src$$disp + STACK_BIAS, O7);
     9682    __ lduwa($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9683  %}
    96869684  ins_pipe( iload_mem );
    96879685%}
     
    96899687instruct bytes_reverse_long(iRegL dst, stackSlotL src) %{
    96909688  match(Set dst (ReverseBytesL src));
    9691   effect(DEF dst, USE src);
    96929689
    96939690  // Op cost is artificially doubled to make sure that load or store
     
    96959692  // onto a stack slot.
    96969693  ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
    9697   size(8);
    96989694  format %{ "LDXA   $src, $dst\t!asi=primary_little" %}
    96999695
    9700   opcode(Assembler::ldxa_op3);
    9701   ins_encode( form3_mem_reg_little(src, dst) );
     9696  ins_encode %{
     9697    __ set($src$$disp + STACK_BIAS, O7);
     9698    __ ldxa($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9699  %}
    97029700  ins_pipe( iload_mem );
    97039701%}
    97049702
     9703instruct bytes_reverse_unsigned_short(iRegI dst, stackSlotI src) %{
     9704  match(Set dst (ReverseBytesUS src));
     9705
     9706  // Op cost is artificially doubled to make sure that load or store
     9707  // instructions are preferred over this one which requires a spill
     9708  // onto a stack slot.
     9709  ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
     9710  format %{ "LDUHA  $src, $dst\t!asi=primary_little\n\t" %}
     9711
     9712  ins_encode %{
     9713    // the value was spilled as an int so bias the load
     9714    __ set($src$$disp + STACK_BIAS + 2, O7);
     9715    __ lduha($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9716  %}
     9717  ins_pipe( iload_mem );
     9718%}
     9719
     9720instruct bytes_reverse_short(iRegI dst, stackSlotI src) %{
     9721  match(Set dst (ReverseBytesS src));
     9722
     9723  // Op cost is artificially doubled to make sure that load or store
     9724  // instructions are preferred over this one which requires a spill
     9725  // onto a stack slot.
     9726  ins_cost(2*DEFAULT_COST + MEMORY_REF_COST);
     9727  format %{ "LDSHA  $src, $dst\t!asi=primary_little\n\t" %}
     9728
     9729  ins_encode %{
     9730    // the value was spilled as an int so bias the load
     9731    __ set($src$$disp + STACK_BIAS + 2, O7);
     9732    __ ldsha($src$$base$$Register, O7, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9733  %}
     9734  ins_pipe( iload_mem );
     9735%}
     9736
    97059737// Load Integer reversed byte order
    9706 instruct loadI_reversed(iRegI dst, memory src) %{
     9738instruct loadI_reversed(iRegI dst, indIndexMemory src) %{
    97079739  match(Set dst (ReverseBytesI (LoadI src)));
    97089740
    97099741  ins_cost(DEFAULT_COST + MEMORY_REF_COST);
    9710   size(8);
     9742  size(4);
    97119743  format %{ "LDUWA  $src, $dst\t!asi=primary_little" %}
    97129744
    9713   opcode(Assembler::lduwa_op3);
    9714   ins_encode( form3_mem_reg_little( src, dst) );
     9745  ins_encode %{
     9746    __ lduwa($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9747  %}
    97159748  ins_pipe(iload_mem);
    97169749%}
    97179750
    97189751// Load Long - aligned and reversed
    9719 instruct loadL_reversed(iRegL dst, memory src) %{
     9752instruct loadL_reversed(iRegL dst, indIndexMemory src) %{
    97209753  match(Set dst (ReverseBytesL (LoadL src)));
    97219754
    9722   ins_cost(DEFAULT_COST + MEMORY_REF_COST);
    9723   size(8);
     9755  ins_cost(MEMORY_REF_COST);
     9756  size(4);
    97249757  format %{ "LDXA   $src, $dst\t!asi=primary_little" %}
    97259758
    9726   opcode(Assembler::ldxa_op3);
    9727   ins_encode( form3_mem_reg_little( src, dst ) );
     9759  ins_encode %{
     9760    __ ldxa($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9761  %}
    97289762  ins_pipe(iload_mem);
    97299763%}
    97309764
     9765// Load unsigned short / char reversed byte order
     9766instruct loadUS_reversed(iRegI dst, indIndexMemory src) %{
     9767  match(Set dst (ReverseBytesUS (LoadUS src)));
     9768
     9769  ins_cost(MEMORY_REF_COST);
     9770  size(4);
     9771  format %{ "LDUHA  $src, $dst\t!asi=primary_little" %}
     9772
     9773  ins_encode %{
     9774    __ lduha($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9775  %}
     9776  ins_pipe(iload_mem);
     9777%}
     9778
     9779// Load short reversed byte order
     9780instruct loadS_reversed(iRegI dst, indIndexMemory src) %{
     9781  match(Set dst (ReverseBytesS (LoadS src)));
     9782
     9783  ins_cost(MEMORY_REF_COST);
     9784  size(4);
     9785  format %{ "LDSHA  $src, $dst\t!asi=primary_little" %}
     9786
     9787  ins_encode %{
     9788    __ ldsha($src$$base$$Register, $src$$index$$Register, Assembler::ASI_PRIMARY_LITTLE, $dst$$Register);
     9789  %}
     9790  ins_pipe(iload_mem);
     9791%}
     9792
    97319793// Store Integer reversed byte order
    9732 instruct storeI_reversed(memory dst, iRegI src) %{
     9794instruct storeI_reversed(indIndexMemory dst, iRegI src) %{
    97339795  match(Set dst (StoreI dst (ReverseBytesI src)));
    97349796
    97359797  ins_cost(MEMORY_REF_COST);
    9736   size(8);
     9798  size(4);
    97379799  format %{ "STWA   $src, $dst\t!asi=primary_little" %}
    97389800
    9739   opcode(Assembler::stwa_op3);
    9740   ins_encode( form3_mem_reg_little( dst, src) );
     9801  ins_encode %{
     9802    __ stwa($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
     9803  %}
    97419804  ins_pipe(istore_mem_reg);
    97429805%}
    97439806
    97449807// Store Long reversed byte order
    9745 instruct storeL_reversed(memory dst, iRegL src) %{
     9808instruct storeL_reversed(indIndexMemory dst, iRegL src) %{
    97469809  match(Set dst (StoreL dst (ReverseBytesL src)));
    97479810
    97489811  ins_cost(MEMORY_REF_COST);
    9749   size(8);
     9812  size(4);
    97509813  format %{ "STXA   $src, $dst\t!asi=primary_little" %}
    97519814
    9752   opcode(Assembler::stxa_op3);
    9753   ins_encode( form3_mem_reg_little( dst, src) );
     9815  ins_encode %{
     9816    __ stxa($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
     9817  %}
     9818  ins_pipe(istore_mem_reg);
     9819%}
     9820
     9821// Store unsighed short/char reversed byte order
     9822instruct storeUS_reversed(indIndexMemory dst, iRegI src) %{
     9823  match(Set dst (StoreC dst (ReverseBytesUS src)));
     9824
     9825  ins_cost(MEMORY_REF_COST);
     9826  size(4);
     9827  format %{ "STHA   $src, $dst\t!asi=primary_little" %}
     9828
     9829  ins_encode %{
     9830    __ stha($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
     9831  %}
     9832  ins_pipe(istore_mem_reg);
     9833%}
     9834
     9835// Store short reversed byte order
     9836instruct storeS_reversed(indIndexMemory dst, iRegI src) %{
     9837  match(Set dst (StoreC dst (ReverseBytesS src)));
     9838
     9839  ins_cost(MEMORY_REF_COST);
     9840  size(4);
     9841  format %{ "STHA   $src, $dst\t!asi=primary_little" %}
     9842
     9843  ins_encode %{
     9844    __ stha($src$$Register, $dst$$base$$Register, $dst$$index$$Register, Assembler::ASI_PRIMARY_LITTLE);
     9845  %}
    97549846  ins_pipe(istore_mem_reg);
    97559847%}
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    140140      __ add(t, frame::memory_parameter_word_sp_offset, t);     // add space for save area (in words)
    141141      __ round_to(t, WordsPerLong);                             // make sure it is multiple of 2 (in words)
    142       __ sll(t, Interpreter::logStackElementSize(), t);                    // compute number of bytes
     142      __ sll(t, Interpreter::logStackElementSize, t);           // compute number of bytes
    143143      __ neg(t);                                                // negate so it can be used with save
    144144      __ save(SP, t, SP);                                       // setup new frame
     
    192192      Label loop;
    193193      __ BIND(loop);
    194       // Store tag first.
    195       if (TaggedStackInterpreter) {
    196         __ ld_ptr(src, 0, tmp);
    197         __ add(src, BytesPerWord, src);  // get next
    198         __ st_ptr(tmp, dst, Interpreter::tag_offset_in_bytes());
    199       }
    200194      // Store parameter value
    201195      __ ld_ptr(src, 0, tmp);
    202196      __ add(src, BytesPerWord, src);
    203       __ st_ptr(tmp, dst, Interpreter::value_offset_in_bytes());
     197      __ st_ptr(tmp, dst, 0);
    204198      __ deccc(cnt);
    205199      __ br(Assembler::greater, false, Assembler::pt, loop);
    206       __ delayed()->sub(dst, Interpreter::stackElementSize(), dst);
     200      __ delayed()->sub(dst, Interpreter::stackElementSize, dst);
    207201
    208202      // done
     
    221215    const Register t = G3_scratch;
    222216    __ ld_ptr(parameter_size.as_in().as_address(), t); // get parameter size (in words)
    223     __ sll(t, Interpreter::logStackElementSize(), t);            // compute number of bytes
     217    __ sll(t, Interpreter::logStackElementSize, t);    // compute number of bytes
    224218    __ sub(FP, t, Gargs);                              // setup parameter pointer
    225219#ifdef _LP64
     
    380374    __ add(O7->after_save(), frame::pc_return_offset, Lscratch); // save the issuing PC
    381375    BLOCK_COMMENT("call exception_handler_for_return_address");
    382     __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), Lscratch);
     376    __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), G2_thread, Lscratch);
    383377    __ mov(O0, handler_reg);
    384378    __ restore();                 // compensates for compiler weakness
     
    10141008      __ delayed()->cmp(to_from, byte_count);
    10151009      if (NOLp == NULL)
    1016         __ brx(Assembler::greaterEqual, false, Assembler::pt, no_overlap_target);
     1010        __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target);
    10171011      else
    1018         __ brx(Assembler::greaterEqual, false, Assembler::pt, (*NOLp));
     1012        __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp));
    10191013      __ delayed()->nop();
    10201014  }
     
    11491143      __ ldx(from, 0, O3);
    11501144      __ inc(from, 8);
    1151       __ align(16);
     1145      __ align(OptoLoopAlignment);
    11521146    __ BIND(L_loop);
    11531147      __ ldx(from, 0, O4);
     
    12211215      __ andn(end_from, 7, end_from);     // Align address
    12221216      __ ldx(end_from, 0, O3);
    1223       __ align(16);
     1217      __ align(OptoLoopAlignment);
    12241218    __ BIND(L_loop);
    12251219      __ ldx(end_from, -8, O4);
     
    13501344      __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit);
    13511345      __ delayed()->nop();
    1352       __ align(16);
     1346      __ align(OptoLoopAlignment);
    13531347    __ BIND(L_copy_byte_loop);
    13541348      __ ldub(from, offset, O3);
     
    14461440    }
    14471441    // copy 4 elements (16 bytes) at a time
    1448       __ align(16);
     1442      __ align(OptoLoopAlignment);
    14491443    __ BIND(L_aligned_copy);
    14501444      __ dec(end_from, 16);
     
    14621456      __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit);
    14631457      __ delayed()->nop();
    1464       __ align(16);
     1458      __ align(OptoLoopAlignment);
    14651459    __ BIND(L_copy_byte_loop);
    14661460      __ dec(end_from);
     
    15781572      __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit);
    15791573      __ delayed()->nop();
    1580       __ align(16);
     1574      __ align(OptoLoopAlignment);
    15811575    __ BIND(L_copy_2_bytes_loop);
    15821576      __ lduh(from, offset, O3);
     
    15911585      __ retl();
    15921586      __ delayed()->mov(G0, O0); // return 0
     1587    return start;
     1588  }
     1589
     1590  //
     1591  //  Generate stub for disjoint short fill.  If "aligned" is true, the
     1592  //  "to" address is assumed to be heapword aligned.
     1593  //
     1594  // Arguments for generated stub:
     1595  //      to:    O0
     1596  //      value: O1
     1597  //      count: O2 treated as signed
     1598  //
     1599  address generate_fill(BasicType t, bool aligned, const char* name) {
     1600    __ align(CodeEntryAlignment);
     1601    StubCodeMark mark(this, "StubRoutines", name);
     1602    address start = __ pc();
     1603
     1604    const Register to        = O0;   // source array address
     1605    const Register value     = O1;   // fill value
     1606    const Register count     = O2;   // elements count
     1607    // O3 is used as a temp register
     1608
     1609    assert_clean_int(count, O3);     // Make sure 'count' is clean int.
     1610
     1611    Label L_exit, L_skip_align1, L_skip_align2, L_fill_byte;
     1612    Label L_fill_2_bytes, L_fill_elements, L_fill_32_bytes;
     1613
     1614    int shift = -1;
     1615    switch (t) {
     1616       case T_BYTE:
     1617        shift = 2;
     1618        break;
     1619       case T_SHORT:
     1620        shift = 1;
     1621        break;
     1622      case T_INT:
     1623         shift = 0;
     1624        break;
     1625      default: ShouldNotReachHere();
     1626    }
     1627
     1628    BLOCK_COMMENT("Entry:");
     1629
     1630    if (t == T_BYTE) {
     1631      // Zero extend value
     1632      __ and3(value, 0xff, value);
     1633      __ sllx(value, 8, O3);
     1634      __ or3(value, O3, value);
     1635    }
     1636    if (t == T_SHORT) {
     1637      // Zero extend value
     1638      __ sllx(value, 48, value);
     1639      __ srlx(value, 48, value);
     1640    }
     1641    if (t == T_BYTE || t == T_SHORT) {
     1642      __ sllx(value, 16, O3);
     1643      __ or3(value, O3, value);
     1644    }
     1645
     1646    __ cmp(count, 2<<shift); // Short arrays (< 8 bytes) fill by element
     1647    __ brx(Assembler::lessUnsigned, false, Assembler::pn, L_fill_elements); // use unsigned cmp
     1648    __ delayed()->andcc(count, 1, G0);
     1649
     1650    if (!aligned && (t == T_BYTE || t == T_SHORT)) {
     1651      // align source address at 4 bytes address boundary
     1652      if (t == T_BYTE) {
     1653        // One byte misalignment happens only for byte arrays
     1654        __ andcc(to, 1, G0);
     1655        __ br(Assembler::zero, false, Assembler::pt, L_skip_align1);
     1656        __ delayed()->nop();
     1657        __ stb(value, to, 0);
     1658        __ inc(to, 1);
     1659        __ dec(count, 1);
     1660        __ BIND(L_skip_align1);
     1661      }
     1662      // Two bytes misalignment happens only for byte and short (char) arrays
     1663      __ andcc(to, 2, G0);
     1664      __ br(Assembler::zero, false, Assembler::pt, L_skip_align2);
     1665      __ delayed()->nop();
     1666      __ sth(value, to, 0);
     1667      __ inc(to, 2);
     1668      __ dec(count, 1 << (shift - 1));
     1669      __ BIND(L_skip_align2);
     1670    }
     1671#ifdef _LP64
     1672    if (!aligned) {
     1673#endif
     1674    // align to 8 bytes, we know we are 4 byte aligned to start
     1675    __ andcc(to, 7, G0);
     1676    __ br(Assembler::zero, false, Assembler::pt, L_fill_32_bytes);
     1677    __ delayed()->nop();
     1678    __ stw(value, to, 0);
     1679    __ inc(to, 4);
     1680    __ dec(count, 1 << shift);
     1681    __ BIND(L_fill_32_bytes);
     1682#ifdef _LP64
     1683    }
     1684#endif
     1685
     1686    if (t == T_INT) {
     1687      // Zero extend value
     1688      __ srl(value, 0, value);
     1689    }
     1690    if (t == T_BYTE || t == T_SHORT || t == T_INT) {
     1691      __ sllx(value, 32, O3);
     1692      __ or3(value, O3, value);
     1693    }
     1694
     1695    Label L_check_fill_8_bytes;
     1696    // Fill 32-byte chunks
     1697    __ subcc(count, 8 << shift, count);
     1698    __ brx(Assembler::less, false, Assembler::pt, L_check_fill_8_bytes);
     1699    __ delayed()->nop();
     1700
     1701    Label L_fill_32_bytes_loop, L_fill_4_bytes;
     1702    __ align(16);
     1703    __ BIND(L_fill_32_bytes_loop);
     1704
     1705    __ stx(value, to, 0);
     1706    __ stx(value, to, 8);
     1707    __ stx(value, to, 16);
     1708    __ stx(value, to, 24);
     1709
     1710    __ subcc(count, 8 << shift, count);
     1711    __ brx(Assembler::greaterEqual, false, Assembler::pt, L_fill_32_bytes_loop);
     1712    __ delayed()->add(to, 32, to);
     1713
     1714    __ BIND(L_check_fill_8_bytes);
     1715    __ addcc(count, 8 << shift, count);
     1716    __ brx(Assembler::zero, false, Assembler::pn, L_exit);
     1717    __ delayed()->subcc(count, 1 << (shift + 1), count);
     1718    __ brx(Assembler::less, false, Assembler::pn, L_fill_4_bytes);
     1719    __ delayed()->andcc(count, 1<<shift, G0);
     1720
     1721    //
     1722    // length is too short, just fill 8 bytes at a time
     1723    //
     1724    Label L_fill_8_bytes_loop;
     1725    __ BIND(L_fill_8_bytes_loop);
     1726    __ stx(value, to, 0);
     1727    __ subcc(count, 1 << (shift + 1), count);
     1728    __ brx(Assembler::greaterEqual, false, Assembler::pn, L_fill_8_bytes_loop);
     1729    __ delayed()->add(to, 8, to);
     1730
     1731    // fill trailing 4 bytes
     1732    __ andcc(count, 1<<shift, G0);  // in delay slot of branches
     1733    if (t == T_INT) {
     1734      __ BIND(L_fill_elements);
     1735    }
     1736    __ BIND(L_fill_4_bytes);
     1737    __ brx(Assembler::zero, false, Assembler::pt, L_fill_2_bytes);
     1738    if (t == T_BYTE || t == T_SHORT) {
     1739      __ delayed()->andcc(count, 1<<(shift-1), G0);
     1740    } else {
     1741      __ delayed()->nop();
     1742    }
     1743    __ stw(value, to, 0);
     1744    if (t == T_BYTE || t == T_SHORT) {
     1745      __ inc(to, 4);
     1746      // fill trailing 2 bytes
     1747      __ andcc(count, 1<<(shift-1), G0); // in delay slot of branches
     1748      __ BIND(L_fill_2_bytes);
     1749      __ brx(Assembler::zero, false, Assembler::pt, L_fill_byte);
     1750      __ delayed()->andcc(count, 1, count);
     1751      __ sth(value, to, 0);
     1752      if (t == T_BYTE) {
     1753        __ inc(to, 2);
     1754        // fill trailing byte
     1755        __ andcc(count, 1, count);  // in delay slot of branches
     1756        __ BIND(L_fill_byte);
     1757        __ brx(Assembler::zero, false, Assembler::pt, L_exit);
     1758        __ delayed()->nop();
     1759        __ stb(value, to, 0);
     1760      } else {
     1761        __ BIND(L_fill_byte);
     1762      }
     1763    } else {
     1764      __ BIND(L_fill_2_bytes);
     1765    }
     1766    __ BIND(L_exit);
     1767    __ retl();
     1768    __ delayed()->nop();
     1769
     1770    // Handle copies less than 8 bytes.  Int is handled elsewhere.
     1771    if (t == T_BYTE) {
     1772      __ BIND(L_fill_elements);
     1773      Label L_fill_2, L_fill_4;
     1774      // in delay slot __ andcc(count, 1, G0);
     1775      __ brx(Assembler::zero, false, Assembler::pt, L_fill_2);
     1776      __ delayed()->andcc(count, 2, G0);
     1777      __ stb(value, to, 0);
     1778      __ inc(to, 1);
     1779      __ BIND(L_fill_2);
     1780      __ brx(Assembler::zero, false, Assembler::pt, L_fill_4);
     1781      __ delayed()->andcc(count, 4, G0);
     1782      __ stb(value, to, 0);
     1783      __ stb(value, to, 1);
     1784      __ inc(to, 2);
     1785      __ BIND(L_fill_4);
     1786      __ brx(Assembler::zero, false, Assembler::pt, L_exit);
     1787      __ delayed()->nop();
     1788      __ stb(value, to, 0);
     1789      __ stb(value, to, 1);
     1790      __ stb(value, to, 2);
     1791      __ retl();
     1792      __ delayed()->stb(value, to, 3);
     1793    }
     1794
     1795    if (t == T_SHORT) {
     1796      Label L_fill_2;
     1797      __ BIND(L_fill_elements);
     1798      // in delay slot __ andcc(count, 1, G0);
     1799      __ brx(Assembler::zero, false, Assembler::pt, L_fill_2);
     1800      __ delayed()->andcc(count, 2, G0);
     1801      __ sth(value, to, 0);
     1802      __ inc(to, 2);
     1803      __ BIND(L_fill_2);
     1804      __ brx(Assembler::zero, false, Assembler::pt, L_exit);
     1805      __ delayed()->nop();
     1806      __ sth(value, to, 0);
     1807      __ retl();
     1808      __ delayed()->sth(value, to, 2);
     1809    }
    15931810    return start;
    15941811  }
     
    16851902    }
    16861903    // copy 4 elements (16 bytes) at a time
    1687       __ align(16);
     1904      __ align(OptoLoopAlignment);
    16881905    __ BIND(L_aligned_copy);
    16891906      __ dec(end_from, 16);
     
    17821999      __ dec(count, 4);   // The cmp at the beginning guaranty count >= 4
    17832000
    1784       __ align(16);
     2001      __ align(OptoLoopAlignment);
    17852002    __ BIND(L_copy_16_bytes);
    17862003      __ ldx(from, 4, O4);
     
    19082125    //
    19092126      __ ldx(end_from, -4, O3);
    1910       __ align(16);
     2127      __ align(OptoLoopAlignment);
    19112128    __ BIND(L_copy_16_bytes);
    19122129      __ ldx(end_from, -12, O4);
     
    19302147
    19312148    // copy 4 elements (16 bytes) at a time
    1932       __ align(16);
     2149      __ align(OptoLoopAlignment);
    19332150    __ BIND(L_aligned_copy);
    19342151      __ dec(end_from, 16);
     
    20012218  //      count: O2 treated as signed
    20022219  //
     2220  // count -= 2;
     2221  // if ( count >= 0 ) { // >= 2 elements
     2222  //   if ( count > 6) { // >= 8 elements
     2223  //     count -= 6; // original count - 8
     2224  //     do {
     2225  //       copy_8_elements;
     2226  //       count -= 8;
     2227  //     } while ( count >= 0 );
     2228  //     count += 6;
     2229  //   }
     2230  //   if ( count >= 0 ) { // >= 2 elements
     2231  //     do {
     2232  //       copy_2_elements;
     2233  //     } while ( (count=count-2) >= 0 );
     2234  //   }
     2235  // }
     2236  // count += 2;
     2237  // if ( count != 0 ) { // 1 element left
     2238  //   copy_1_element;
     2239  // }
     2240  //
    20032241  void generate_disjoint_long_copy_core(bool aligned) {
    20042242    Label L_copy_8_bytes, L_copy_16_bytes, L_exit;
     
    20132251      __ brx(Assembler::negative, false, Assembler::pn, L_copy_8_bytes );
    20142252      __ delayed()->add(offset0, 8, offset8);
    2015       __ align(16);
     2253
     2254    // Copy by 64 bytes chunks
     2255    Label L_copy_64_bytes;
     2256    const Register from64 = O3;  // source address
     2257    const Register to64   = G3;  // destination address
     2258      __ subcc(count, 6, O3);
     2259      __ brx(Assembler::negative, false, Assembler::pt, L_copy_16_bytes );
     2260      __ delayed()->mov(to,   to64);
     2261      // Now we can use O4(offset0), O5(offset8) as temps
     2262      __ mov(O3, count);
     2263      __ mov(from, from64);
     2264
     2265      __ align(OptoLoopAlignment);
     2266    __ BIND(L_copy_64_bytes);
     2267      for( int off = 0; off < 64; off += 16 ) {
     2268        __ ldx(from64,  off+0, O4);
     2269        __ ldx(from64,  off+8, O5);
     2270        __ stx(O4, to64,  off+0);
     2271        __ stx(O5, to64,  off+8);
     2272      }
     2273      __ deccc(count, 8);
     2274      __ inc(from64, 64);
     2275      __ brx(Assembler::greaterEqual, false, Assembler::pt, L_copy_64_bytes);
     2276      __ delayed()->inc(to64, 64);
     2277
     2278      // Restore O4(offset0), O5(offset8)
     2279      __ sub(from64, from, offset0);
     2280      __ inccc(count, 6);
     2281      __ brx(Assembler::negative, false, Assembler::pn, L_copy_8_bytes );
     2282      __ delayed()->add(offset0, 8, offset8);
     2283
     2284      // Copy by 16 bytes chunks
     2285      __ align(OptoLoopAlignment);
    20162286    __ BIND(L_copy_16_bytes);
    20172287      __ ldx(from, offset0, O3);
     
    20242294      __ delayed()->inc(offset8, 16);
    20252295
     2296      // Copy last 8 bytes
    20262297    __ BIND(L_copy_8_bytes);
    20272298      __ inccc(count, 2);
     
    20862357      __ delayed()->sllx(count, LogBytesPerLong, offset8);
    20872358      __ sub(offset8, 8, offset0);
    2088       __ align(16);
     2359      __ align(OptoLoopAlignment);
    20892360    __ BIND(L_copy_16_bytes);
    20902361      __ ldx(from, offset8, O2);
     
    23152586    __ restore();
    23162587#endif
     2588
     2589    assert_clean_int(O2_count, G1);     // Make sure 'count' is clean int.
    23172590
    23182591#ifdef ASSERT
     
    23302603#endif //ASSERT
    23312604
    2332     assert_clean_int(O2_count, G1);     // Make sure 'count' is clean int.
    2333 
    23342605    checkcast_copy_entry = __ pc();
    23352606    // caller can pass a 64-bit byte count here (from generic stub)
     
    23522623    //   (O2 = len; O2 != 0; O2--) --- number of oops *remaining*
    23532624    //   G3, G4, G5 --- current oop, oop.klass, oop.klass.super
    2354     __ align(16);
     2625    __ align(OptoLoopAlignment);
    23552626
    23562627    __ BIND(store_element);
     
    28083079    StubRoutines::_unsafe_arraycopy    = generate_unsafe_copy("unsafe_arraycopy");
    28093080    StubRoutines::_generic_arraycopy   = generate_generic_copy("generic_arraycopy");
     3081
     3082    StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill");
     3083    StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill");
     3084    StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill");
     3085    StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill");
     3086    StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill");
     3087    StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill");
    28103088  }
    28113089
     
    28633141    // arraycopy stubs used by compilers
    28643142    generate_arraycopy_stubs();
     3143
     3144    // Don't initialize the platform math functions since sparc
     3145    // doesn't have intrinsics for these operations.
    28653146  }
    28663147
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    3838enum /* platform_dependent_constants */ {
    3939  // %%%%%%%% May be able to shrink this a lot
    40   code_size1 = 20000,                                        // simply increase if too small (assembler will crash if too small)
    41   code_size2 = 20000                                         // simply increase if too small (assembler will crash if too small)
     40  code_size1 = 20000,           // simply increase if too small (assembler will crash if too small)
     41  code_size2 = 20000            // simply increase if too small (assembler will crash if too small)
     42};
     43
     44// MethodHandles adapters
     45enum method_handles_platform_dependent_constants {
     46  method_handles_adapters_code_size = 6000
    4247};
    4348
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    151151
    152152
    153 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) {
    154   assert(!unbox, "NYI");//6815692//
     153address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) {
     154  TosState incoming_state = state;
     155
     156  Label cont;
    155157  address compiled_entry = __ pc();
    156   Label cont;
    157158
    158159  address entry = __ pc();
     
    167168  // first which would move g1 -> O0/O1 and destroy the exception we were throwing.
    168169
    169   if( state == ltos ) {
    170     __ srl (G1, 0,O1);
    171     __ srlx(G1,32,O0);
    172   }
    173 #endif /* !_LP64 && COMPILER2 */
    174 
     170  if (incoming_state == ltos) {
     171    __ srl (G1,  0, O1);
     172    __ srlx(G1, 32, O0);
     173  }
     174#endif // !_LP64 && COMPILER2
    175175
    176176  __ bind(cont);
     
    184184  __ mov(Llast_SP, SP);   // Remove any adapter added stack space.
    185185
    186 
     186  Label L_got_cache, L_giant_index;
    187187  const Register cache = G3_scratch;
    188188  const Register size  = G1_scratch;
     189  if (EnableInvokeDynamic) {
     190    __ ldub(Address(Lbcp, 0), G1_scratch);  // Load current bytecode.
     191    __ cmp(G1_scratch, Bytecodes::_invokedynamic);
     192    __ br(Assembler::equal, false, Assembler::pn, L_giant_index);
     193    __ delayed()->nop();
     194  }
    189195  __ get_cache_and_index_at_bcp(cache, G1_scratch, 1);
     196  __ bind(L_got_cache);
    190197  __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() +
    191198                   ConstantPoolCacheEntry::flags_offset(), size);
    192199  __ and3(size, 0xFF, size);                   // argument size in words
    193   __ sll(size, Interpreter::logStackElementSize(), size); // each argument size in bytes
     200  __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes
    194201  __ add(Lesp, size, Lesp);                    // pop arguments
    195202  __ dispatch_next(state, step);
     203
     204  // out of the main line of code...
     205  if (EnableInvokeDynamic) {
     206    __ bind(L_giant_index);
     207    __ get_cache_and_index_at_bcp(cache, G1_scratch, 1, sizeof(u4));
     208    __ ba(false, L_got_cache);
     209    __ delayed()->nop();
     210  }
    196211
    197212  return entry;
     
    481496  //
    482497  assert_different_registers(Gargs, Glocals_size, Gframe_size, O5_savedSP);
    483   __ sll(Glocals_size, Interpreter::logStackElementSize(), Otmp1);
     498  __ sll(Glocals_size, Interpreter::logStackElementSize, Otmp1);
    484499  __ add(Gargs, Otmp1, Gargs);
    485500
     
    497512    __ sub( Otmp1, Glocals_size, Glocals_size );
    498513    __ round_to( Glocals_size, WordsPerLong );
    499     __ sll( Glocals_size, Interpreter::logStackElementSize(), Glocals_size );
     514    __ sll( Glocals_size, Interpreter::logStackElementSize, Glocals_size );
    500515
    501516    // see if the frame is greater than one page in size. If so,
     
    505520    __ add( Gframe_size, extra_space, Gframe_size );
    506521    __ round_to( Gframe_size, WordsPerLong );
    507     __ sll( Gframe_size, Interpreter::logStackElementSize(), Gframe_size);
     522    __ sll( Gframe_size, Interpreter::logStackElementSize, Gframe_size);
    508523
    509524    // Add in java locals size for stack overflow check only
     
    12201235  __ lduh( size_of_locals, O2 );
    12211236  __ lduh( size_of_parameters, O1 );
    1222   __ sll( O2, Interpreter::logStackElementSize(), O2);
    1223   __ sll( O1, Interpreter::logStackElementSize(), O1 );
     1237  __ sll( O2, Interpreter::logStackElementSize, O2);
     1238  __ sll( O1, Interpreter::logStackElementSize, O1 );
    12241239  __ sub( Llocals, O2, O2 );
    12251240  __ sub( Llocals, O1, O1 );
     
    14561471  // callee_locals and max_stack are counts, not the size in frame.
    14571472  const int locals_size =
    1458        round_to(callee_extra_locals * Interpreter::stackElementWords(), WordsPerLong);
    1459   const int max_stack_words = max_stack * Interpreter::stackElementWords();
     1473       round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
     1474  const int max_stack_words = max_stack * Interpreter::stackElementWords;
    14601475  return (round_to((max_stack_words
    14611476                   //6815692//+ methodOopDesc::extra_stack_words()
     
    15561571    // preallocate stack space
    15571572    intptr_t*  esp = monitors - 1 -
    1558                      (tempcount * Interpreter::stackElementWords()) -
     1573                     (tempcount * Interpreter::stackElementWords) -
    15591574                     popframe_extra_args;
    15601575
    1561     int local_words = method->max_locals() * Interpreter::stackElementWords();
    1562     int parm_words  = method->size_of_parameters() * Interpreter::stackElementWords();
     1576    int local_words = method->max_locals() * Interpreter::stackElementWords;
     1577    int parm_words  = method->size_of_parameters() * Interpreter::stackElementWords;
    15631578    NEEDS_CLEANUP;
    15641579    intptr_t* locals;
     
    16481663
    16491664    assert(interpreter_frame->interpreter_frame_method() == method, "method matches");
    1650     assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize())+Interpreter::value_offset_in_bytes()), "locals match");
     1665    assert(interpreter_frame->interpreter_frame_local_at(9) == (intptr_t *)((intptr_t)locals - (9 * Interpreter::stackElementSize)), "locals match");
    16511666    assert(interpreter_frame->interpreter_frame_monitor_end()   == mp, "monitor_end matches");
    16521667    assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches");
     
    17441759    // Compute size of arguments for saving when returning to deoptimized caller
    17451760    __ lduh(Lmethod, in_bytes(methodOopDesc::size_of_parameters_offset()), Gtmp1);
    1746     __ sll(Gtmp1, Interpreter::logStackElementSize(), Gtmp1);
     1761    __ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1);
    17471762    __ sub(Llocals, Gtmp1, Gtmp2);
    17481763    __ add(Gtmp2, wordSize, Gtmp2);
     
    18241839  __ super_call_VM_leaf(L7_thread_cache,
    18251840                        CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address),
    1826                         Oissuing_pc->after_save());
     1841                        G2_thread, Oissuing_pc->after_save());
    18271842
    18281843  // The caller's SP was adjusted upon method entry to accomodate
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    3030  // if too small.
    3131  // Run with +PrintInterpreter to get the VM to print out the size.
    32   // Max size with JVMTI and TaggedStackInterpreter
     32  // Max size with JVMTI
     33
    3334#ifdef _LP64
    3435  // The sethi() instruction generates lots more instructions when shell
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    319319}
    320320
     321// Fast path for caching oop constants.
     322// %%% We should use this to handle Class and String constants also.
     323// %%% It will simplify the ldc/primitive path considerably.
     324void TemplateTable::fast_aldc(bool wide) {
     325  transition(vtos, atos);
     326
     327  if (!EnableMethodHandles) {
     328    // We should not encounter this bytecode if !EnableMethodHandles.
     329    // The verifier will stop it.  However, if we get past the verifier,
     330    // this will stop the thread in a reasonable way, without crashing the JVM.
     331    __ call_VM(noreg, CAST_FROM_FN_PTR(address,
     332                     InterpreterRuntime::throw_IncompatibleClassChangeError));
     333    // the call_VM checks for exception, so we should never return here.
     334    __ should_not_reach_here();
     335    return;
     336  }
     337
     338  Register Rcache = G3_scratch;
     339  Register Rscratch = G4_scratch;
     340
     341  resolve_cache_and_index(f1_oop, Otos_i, Rcache, Rscratch, wide ? sizeof(u2) : sizeof(u1));
     342
     343  __ verify_oop(Otos_i);
     344}
     345
    321346void TemplateTable::ldc2_w() {
    322347  transition(vtos, vtos);
     
    581606void TemplateTable::iload(int n) {
    582607  transition(vtos, itos);
    583   debug_only(__ verify_local_tag(frame::TagValue, Llocals, Otos_i, n));
    584608  __ ld( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
    585609}
     
    589613  transition(vtos, ltos);
    590614  assert(n+1 < Argument::n_register_parameters, "would need more code");
    591   debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, Otos_l, n));
    592615  __ load_unaligned_long(Llocals, Interpreter::local_offset_in_bytes(n+1), Otos_l);
    593616}
     
    597620  transition(vtos, ftos);
    598621  assert(n < Argument::n_register_parameters, "would need more code");
    599   debug_only(__ verify_local_tag(frame::TagValue, Llocals, G3_scratch, n));
    600622  __ ldf( FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(n),     Ftos_f );
    601623}
     
    605627  transition(vtos, dtos);
    606628  FloatRegister dst = Ftos_d;
    607   debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, G3_scratch, n));
    608629  __ load_unaligned_double(Llocals, Interpreter::local_offset_in_bytes(n+1), dst);
    609630}
     
    612633void TemplateTable::aload(int n) {
    613634  transition(vtos, atos);
    614   debug_only(__ verify_local_tag(frame::TagReference, Llocals, Otos_i, n));
    615635  __ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i );
    616636}
     
    708728void TemplateTable::astore() {
    709729  transition(vtos, vtos);
    710   // astore tos can also be a returnAddress, so load and store the tag too
    711   __ load_ptr_and_tag(0, Otos_i, Otos_l2);
    712   __ inc(Lesp, Interpreter::stackElementSize());
     730  __ load_ptr(0, Otos_i);
     731  __ inc(Lesp, Interpreter::stackElementSize);
    713732  __ verify_oop_or_return_address(Otos_i, G3_scratch);
    714733  locals_index(G3_scratch);
    715   __ store_local_ptr( G3_scratch, Otos_i, Otos_l2 );
     734  __ store_local_ptr(G3_scratch, Otos_i);
    716735}
    717736
     
    751770void TemplateTable::wide_astore() {
    752771  transition(vtos, vtos);
    753   // astore tos can also be a returnAddress, so load and store the tag too
    754   __ load_ptr_and_tag(0, Otos_i, Otos_l2);
    755   __ inc(Lesp, Interpreter::stackElementSize());
     772  __ load_ptr(0, Otos_i);
     773  __ inc(Lesp, Interpreter::stackElementSize);
    756774  __ verify_oop_or_return_address(Otos_i, G3_scratch);
    757775  locals_index_wide(G3_scratch);
    758   __ store_local_ptr( G3_scratch, Otos_i, Otos_l2 );
     776  __ store_local_ptr(G3_scratch, Otos_i);
    759777}
    760778
     
    846864
    847865  __ ba(false,done);
    848   __ delayed()->inc(Lesp, 3* Interpreter::stackElementSize()); // adj sp (pops array, index and value)
     866  __ delayed()->inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value)
    849867
    850868  __ bind(is_null);
     
    852870
    853871  __ profile_null_seen(G3_scratch);
    854   __ inc(Lesp, 3* Interpreter::stackElementSize());     // adj sp (pops array, index and value)
     872  __ inc(Lesp, 3* Interpreter::stackElementSize);     // adj sp (pops array, index and value)
    855873  __ bind(done);
    856874}
     
    885903void TemplateTable::istore(int n) {
    886904  transition(itos, vtos);
    887   __ tag_local(frame::TagValue, Llocals, Otos_i, n);
    888905  __ st(Otos_i, Llocals, Interpreter::local_offset_in_bytes(n));
    889906}
     
    893910  transition(ltos, vtos);
    894911  assert(n+1 < Argument::n_register_parameters, "only handle register cases");
    895   __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
    896912  __ store_unaligned_long(Otos_l, Llocals, Interpreter::local_offset_in_bytes(n+1));
    897913
     
    902918  transition(ftos, vtos);
    903919  assert(n < Argument::n_register_parameters, "only handle register cases");
    904   __ tag_local(frame::TagValue, Llocals, Otos_l, n);
    905920  __ stf(FloatRegisterImpl::S, Ftos_f, Llocals, Interpreter::local_offset_in_bytes(n));
    906921}
     
    910925  transition(dtos, vtos);
    911926  FloatRegister src = Ftos_d;
    912   __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);
    913927  __ store_unaligned_double(src, Llocals, Interpreter::local_offset_in_bytes(n+1));
    914928}
     
    917931void TemplateTable::astore(int n) {
    918932  transition(vtos, vtos);
    919   // astore tos can also be a returnAddress, so load and store the tag too
    920   __ load_ptr_and_tag(0, Otos_i, Otos_l2);
    921   __ inc(Lesp, Interpreter::stackElementSize());
     933  __ load_ptr(0, Otos_i);
     934  __ inc(Lesp, Interpreter::stackElementSize);
    922935  __ verify_oop_or_return_address(Otos_i, G3_scratch);
    923   __ store_local_ptr( n, Otos_i, Otos_l2 );
     936  __ store_local_ptr(n, Otos_i);
    924937}
    925938
     
    927940void TemplateTable::pop() {
    928941  transition(vtos, vtos);
    929   __ inc(Lesp, Interpreter::stackElementSize());
     942  __ inc(Lesp, Interpreter::stackElementSize);
    930943}
    931944
     
    933946void TemplateTable::pop2() {
    934947  transition(vtos, vtos);
    935   __ inc(Lesp, 2 * Interpreter::stackElementSize());
     948  __ inc(Lesp, 2 * Interpreter::stackElementSize);
    936949}
    937950
     
    941954  // stack: ..., a
    942955  // load a and tag
    943   __ load_ptr_and_tag(0, Otos_i, Otos_l2);
    944   __ push_ptr(Otos_i, Otos_l2);
     956  __ load_ptr(0, Otos_i);
     957  __ push_ptr(Otos_i);
    945958  // stack: ..., a, a
    946959}
     
    950963  transition(vtos, vtos);
    951964  // stack: ..., a, b
    952   __ load_ptr_and_tag(1, G3_scratch, G4_scratch);   // get a
    953   __ load_ptr_and_tag(0, Otos_l1, Otos_l2);         // get b
    954   __ store_ptr_and_tag(1, Otos_l1, Otos_l2);        // put b
    955   __ store_ptr_and_tag(0, G3_scratch, G4_scratch);  // put a - like swap
    956   __ push_ptr(Otos_l1, Otos_l2);                    // push b
     965  __ load_ptr( 1, G3_scratch);  // get a
     966  __ load_ptr( 0, Otos_l1);     // get b
     967  __ store_ptr(1, Otos_l1);     // put b
     968  __ store_ptr(0, G3_scratch);  // put a - like swap
     969  __ push_ptr(Otos_l1);         // push b
    957970  // stack: ..., b, a, b
    958971}
     
    963976  // stack: ..., a, b, c
    964977  // get c and push on stack, reuse registers
    965   __ load_ptr_and_tag(0, G3_scratch, G4_scratch);     // get c
    966   __ push_ptr(G3_scratch, G4_scratch);               // push c with tag
     978  __ load_ptr( 0, G3_scratch);  // get c
     979  __ push_ptr(G3_scratch);      // push c with tag
    967980  // stack: ..., a, b, c, c  (c in reg)  (Lesp - 4)
    968981  // (stack offsets n+1 now)
    969   __ load_ptr_and_tag(3, Otos_l1, Otos_l2);          // get a
    970   __ store_ptr_and_tag(3, G3_scratch, G4_scratch);   // put c at 3
     982  __ load_ptr( 3, Otos_l1);     // get a
     983  __ store_ptr(3, G3_scratch);  // put c at 3
    971984  // stack: ..., c, b, c, c  (a in reg)
    972   __ load_ptr_and_tag(2, G3_scratch, G4_scratch);    // get b
    973   __ store_ptr_and_tag(2, Otos_l1, Otos_l2);         // put a at 2
     985  __ load_ptr( 2, G3_scratch);  // get b
     986  __ store_ptr(2, Otos_l1);     // put a at 2
    974987  // stack: ..., c, a, c, c  (b in reg)
    975   __ store_ptr_and_tag(1, G3_scratch, G4_scratch);   // put b at 1
     988  __ store_ptr(1, G3_scratch);  // put b at 1
    976989  // stack: ..., c, a, b, c
    977990}
     
    980993void TemplateTable::dup2() {
    981994  transition(vtos, vtos);
    982   __ load_ptr_and_tag(1, G3_scratch, G4_scratch);     // get a
    983   __ load_ptr_and_tag(0, Otos_l1, Otos_l2);           // get b
    984   __ push_ptr(G3_scratch, G4_scratch);                // push a
    985   __ push_ptr(Otos_l1, Otos_l2);                      // push b
     995  __ load_ptr(1, G3_scratch);  // get a
     996  __ load_ptr(0, Otos_l1);     // get b
     997  __ push_ptr(G3_scratch);     // push a
     998  __ push_ptr(Otos_l1);        // push b
    986999  // stack: ..., a, b, a, b
    9871000}
     
    9911004  transition(vtos, vtos);
    9921005  // stack: ..., a, b, c
    993   __ load_ptr_and_tag(1, Lscratch, G1_scratch);       // get b
    994   __ load_ptr_and_tag(2, Otos_l1, Otos_l2);           // get a
    995   __ store_ptr_and_tag(2, Lscratch, G1_scratch);      // put b at a
     1006  __ load_ptr( 1, Lscratch);    // get b
     1007  __ load_ptr( 2, Otos_l1);     // get a
     1008  __ store_ptr(2, Lscratch);    // put b at a
    9961009  // stack: ..., b, b, c
    997   __ load_ptr_and_tag(0, G3_scratch, G4_scratch);     // get c
    998   __ store_ptr_and_tag(1, G3_scratch, G4_scratch);    // put c at b
     1010  __ load_ptr( 0, G3_scratch);  // get c
     1011  __ store_ptr(1, G3_scratch);  // put c at b
    9991012  // stack: ..., b, c, c
    1000   __ store_ptr_and_tag(0, Otos_l1, Otos_l2);          // put a at c
     1013  __ store_ptr(0, Otos_l1);     // put a at c
    10011014  // stack: ..., b, c, a
    1002   __ push_ptr(Lscratch, G1_scratch);                  // push b
    1003   __ push_ptr(G3_scratch, G4_scratch);                // push c
     1015  __ push_ptr(Lscratch);        // push b
     1016  __ push_ptr(G3_scratch);      // push c
    10041017  // stack: ..., b, c, a, b, c
    10051018}
     
    10111024  transition(vtos, vtos);
    10121025  // stack: ..., a, b, c, d
    1013   __ load_ptr_and_tag(1, Lscratch, G1_scratch);       // get c
    1014   __ load_ptr_and_tag(3, Otos_l1, Otos_l2);           // get a
    1015   __ store_ptr_and_tag(3, Lscratch, G1_scratch);      // put c at 3
    1016   __ store_ptr_and_tag(1, Otos_l1, Otos_l2);          // put a at 1
     1026  __ load_ptr( 1, Lscratch);    // get c
     1027  __ load_ptr( 3, Otos_l1);     // get a
     1028  __ store_ptr(3, Lscratch);    // put c at 3
     1029  __ store_ptr(1, Otos_l1);     // put a at 1
    10171030  // stack: ..., c, b, a, d
    1018   __ load_ptr_and_tag(2, G3_scratch, G4_scratch);     // get b
    1019   __ load_ptr_and_tag(0, Otos_l1, Otos_l2);           // get d
    1020   __ store_ptr_and_tag(0, G3_scratch, G4_scratch);    // put b at 0
    1021   __ store_ptr_and_tag(2, Otos_l1, Otos_l2);          // put d at 2
     1031  __ load_ptr( 2, G3_scratch);  // get b
     1032  __ load_ptr( 0, Otos_l1);     // get d
     1033  __ store_ptr(0, G3_scratch);  // put b at 0
     1034  __ store_ptr(2, Otos_l1);     // put d at 2
    10221035  // stack: ..., c, d, a, b
    1023   __ push_ptr(Lscratch, G1_scratch);                  // push c
    1024   __ push_ptr(Otos_l1, Otos_l2);                      // push d
     1036  __ push_ptr(Lscratch);        // push c
     1037  __ push_ptr(Otos_l1);         // push d
    10251038  // stack: ..., c, d, a, b, c, d
    10261039}
     
    10301043  transition(vtos, vtos);
    10311044  // stack: ..., a, b
    1032   __ load_ptr_and_tag(1, G3_scratch, G4_scratch);     // get a
    1033   __ load_ptr_and_tag(0, Otos_l1, Otos_l2);           // get b
    1034   __ store_ptr_and_tag(0, G3_scratch, G4_scratch);    // put b
    1035   __ store_ptr_and_tag(1, Otos_l1, Otos_l2);          // put a
     1045  __ load_ptr( 1, G3_scratch);  // get a
     1046  __ load_ptr( 0, Otos_l1);     // get b
     1047  __ store_ptr(0, G3_scratch);  // put b
     1048  __ store_ptr(1, Otos_l1);     // put a
    10361049  // stack: ..., b, a
    10371050}
     
    10461059     // %%%%% Mul may not exist: better to call .mul?
    10471060   case  mul:  __ smul(O1, Otos_i, Otos_i);  break;
    1048    case _and:  __  and3(O1, Otos_i, Otos_i);  break;
    1049    case  _or:  __   or3(O1, Otos_i, Otos_i);  break;
    1050    case _xor:  __  xor3(O1, Otos_i, Otos_i);  break;
     1061   case _and:  __ and3(O1, Otos_i, Otos_i);  break;
     1062   case  _or:  __  or3(O1, Otos_i, Otos_i);  break;
     1063   case _xor:  __ xor3(O1, Otos_i, Otos_i);  break;
    10511064   case  shl:  __  sll(O1, Otos_i, Otos_i);  break;
    10521065   case  shr:  __  sra(O1, Otos_i, Otos_i);  break;
     
    10621075  switch (op) {
    10631076#ifdef _LP64
    1064    case  add:  __ add(O2, Otos_l, Otos_l);  break;
    1065    case  sub:  __ sub(O2, Otos_l, Otos_l);  break;
    1066    case _and:  __ and3( O2, Otos_l, Otos_l);  break;
    1067    case  _or:  __  or3( O2, Otos_l, Otos_l);  break;
    1068    case _xor:  __ xor3( O2, Otos_l, Otos_l);  break;
     1077   case  add:  __  add(O2, Otos_l, Otos_l);  break;
     1078   case  sub:  __  sub(O2, Otos_l, Otos_l);  break;
     1079   case _and:  __ and3(O2, Otos_l, Otos_l);  break;
     1080   case  _or:  __  or3(O2, Otos_l, Otos_l);  break;
     1081   case _xor:  __ xor3(O2, Otos_l, Otos_l);  break;
    10691082#else
    10701083   case  add:  __ addcc(O3, Otos_l2, Otos_l2);  __ addc(O2, Otos_l1, Otos_l1);  break;
    10711084   case  sub:  __ subcc(O3, Otos_l2, Otos_l2);  __ subc(O2, Otos_l1, Otos_l1);  break;
    1072    case _and:  __ and3(  O3, Otos_l2, Otos_l2);  __ and3( O2, Otos_l1, Otos_l1);  break;
    1073    case  _or:  __  or3(  O3, Otos_l2, Otos_l2);  __  or3( O2, Otos_l1, Otos_l1);  break;
    1074    case _xor:  __ xor3(  O3, Otos_l2, Otos_l2);  __ xor3( O2, Otos_l1, Otos_l1);  break;
     1085   case _and:  __  and3(O3, Otos_l2, Otos_l2);  __ and3(O2, Otos_l1, Otos_l1);  break;
     1086   case  _or:  __   or3(O3, Otos_l2, Otos_l2);  __  or3(O2, Otos_l1, Otos_l1);  break;
     1087   case _xor:  __  xor3(O3, Otos_l2, Otos_l2);  __ xor3(O2, Otos_l1, Otos_l1);  break;
    10751088#endif
    10761089   default: ShouldNotReachHere();
     
    13081321  __ access_local_int(G3_scratch, Otos_i);
    13091322  __ add(Otos_i, O2, Otos_i);
    1310   __ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes());    // access_local_int puts E.A. in G3_scratch
     1323  __ st(Otos_i, G3_scratch, 0);    // access_local_int puts E.A. in G3_scratch
    13111324}
    13121325
     
    13181331  __ access_local_int(G3_scratch, Otos_i);
    13191332  __ add(Otos_i, O3, Otos_i);
    1320   __ st(Otos_i, G3_scratch, Interpreter::value_offset_in_bytes());    // access_local_int puts E.A. in G3_scratch
     1333  __ st(Otos_i, G3_scratch, 0);    // access_local_int puts E.A. in G3_scratch
    13211334}
    13221335
     
    15561569    __ add(Lbcp, O1_disp, Lbcp);
    15571570    // Push returnAddress for "ret" on stack
    1558     __ push_ptr(Otos_i, G0); // push ptr sized thing plus 0 for tag.
     1571    __ push_ptr(Otos_i);
    15591572    // And away we go!
    15601573    __ dispatch_next(vtos);
     
    19621975
    19631976// ----------------------------------------------------------------------------
    1964 void TemplateTable::resolve_cache_and_index(int byte_no, Register Rcache, Register index) {
    1965   assert(byte_no == 1 || byte_no == 2, "byte_no out of range");
     1977void TemplateTable::resolve_cache_and_index(int byte_no,
     1978                                            Register result,
     1979                                            Register Rcache,
     1980                                            Register index,
     1981                                            size_t index_size) {
    19661982  // Depends on cpCacheOop layout!
    1967   const int shift_count = (1 + byte_no)*BitsPerByte;
    19681983  Label resolved;
    19691984
    1970   __ get_cache_and_index_at_bcp(Rcache, index, 1);
    1971   __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
    1972                     ConstantPoolCacheEntry::indices_offset(), Lbyte_code);
    1973 
    1974   __ srl(  Lbyte_code, shift_count, Lbyte_code );
    1975   __ and3( Lbyte_code,        0xFF, Lbyte_code );
    1976   __ cmp(  Lbyte_code, (int)bytecode());
    1977   __ br(   Assembler::equal, false, Assembler::pt, resolved);
    1978   __ delayed()->set((int)bytecode(), O1);
     1985  __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
     1986  if (byte_no == f1_oop) {
     1987    // We are resolved if the f1 field contains a non-null object (CallSite, etc.)
     1988    // This kind of CP cache entry does not need to match the flags byte, because
     1989    // there is a 1-1 relation between bytecode type and CP entry type.
     1990    assert_different_registers(result, Rcache);
     1991    __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
     1992              ConstantPoolCacheEntry::f1_offset(), result);
     1993    __ tst(result);
     1994    __ br(Assembler::notEqual, false, Assembler::pt, resolved);
     1995    __ delayed()->set((int)bytecode(), O1);
     1996  } else {
     1997    assert(byte_no == f1_byte || byte_no == f2_byte, "byte_no out of range");
     1998    assert(result == noreg, "");  //else change code for setting result
     1999    const int shift_count = (1 + byte_no)*BitsPerByte;
     2000
     2001    __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
     2002              ConstantPoolCacheEntry::indices_offset(), Lbyte_code);
     2003
     2004    __ srl(  Lbyte_code, shift_count, Lbyte_code );
     2005    __ and3( Lbyte_code,        0xFF, Lbyte_code );
     2006    __ cmp(  Lbyte_code, (int)bytecode());
     2007    __ br(   Assembler::equal, false, Assembler::pt, resolved);
     2008    __ delayed()->set((int)bytecode(), O1);
     2009  }
    19792010
    19802011  address entry;
     
    19882019    case Bytecodes::_invokestatic   : // fall through
    19892020    case Bytecodes::_invokeinterface: entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invoke);  break;
     2021    case Bytecodes::_invokedynamic  : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_invokedynamic);  break;
     2022    case Bytecodes::_fast_aldc      : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);     break;
     2023    case Bytecodes::_fast_aldc_w    : entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_ldc);     break;
    19902024    default                         : ShouldNotReachHere();                                 break;
    19912025  }
     
    19932027  __ call_VM(noreg, entry, O1);
    19942028  // Update registers with resolved info
    1995   __ get_cache_and_index_at_bcp(Rcache, index, 1);
     2029  __ get_cache_and_index_at_bcp(Rcache, index, 1, index_size);
     2030  if (result != noreg)
     2031    __ ld_ptr(Rcache, constantPoolCacheOopDesc::base_offset() +
     2032              ConstantPoolCacheEntry::f1_offset(), result);
    19962033  __ bind(resolved);
    19972034}
     
    20022039                                               Register Rflags,
    20032040                                               bool is_invokevirtual,
    2004                                                bool is_invokevfinal) {
     2041                                               bool is_invokevfinal,
     2042                                               bool is_invokedynamic) {
    20052043  // Uses both G3_scratch and G4_scratch
    20062044  Register Rcache = G3_scratch;
     
    20262064  if (is_invokevfinal) {
    20272065    __ get_cache_and_index_at_bcp(Rcache, Rscratch, 1);
     2066    __ ld_ptr(Rcache, method_offset, Rmethod);
     2067  } else if (byte_no == f1_oop) {
     2068    // Resolved f1_oop goes directly into 'method' register.
     2069    resolve_cache_and_index(byte_no, Rmethod, Rcache, Rscratch, sizeof(u4));
    20282070  } else {
    2029     resolve_cache_and_index(byte_no, Rcache, Rscratch);
    2030   }
    2031 
    2032   __ ld_ptr(Rcache, method_offset, Rmethod);
     2071    resolve_cache_and_index(byte_no, noreg, Rcache, Rscratch, sizeof(u2));
     2072    __ ld_ptr(Rcache, method_offset, Rmethod);
     2073  }
     2074
    20332075  if (Ritable_index != noreg) {
    20342076    __ ld_ptr(Rcache, index_offset, Ritable_index);
     
    21112153  ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset();
    21122154
    2113   resolve_cache_and_index(byte_no, Rcache, index);
     2155  resolve_cache_and_index(byte_no, noreg, Rcache, index, sizeof(u2));
    21142156  jvmti_post_field_access(Rcache, index, is_static, false);
    21152157  load_field_cp_cache_entry(Rclass, Rcache, index, Roffset, Rflags, is_static);
     
    24762518  ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset();
    24772519
    2478   resolve_cache_and_index(byte_no, Rcache, index);
     2520  resolve_cache_and_index(byte_no, noreg, Rcache, index, sizeof(u2));
    24792521  jvmti_post_field_mod(Rcache, index, is_static);
    24802522  load_field_cp_cache_entry(Rclass, Rcache, index, Roffset, Rflags, is_static);
     
    27432785  Register Rreceiver = Lscratch;
    27442786
    2745   __ ld_ptr(Llocals, Interpreter::value_offset_in_bytes(), Rreceiver);
     2787  __ ld_ptr(Llocals, 0, Rreceiver);
    27462788
    27472789  // access constant pool cache  (is resolved)
     
    28172859void TemplateTable::invokevirtual(int byte_no) {
    28182860  transition(vtos, vtos);
     2861  assert(byte_no == f2_byte, "use this argument");
    28192862
    28202863  Register Rscratch = G3_scratch;
     
    28242867  Label notFinal;
    28252868
    2826   load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, true);
     2869  load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, true, false, false);
    28272870  __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
    28282871
     
    28652908void TemplateTable::fast_invokevfinal(int byte_no) {
    28662909  transition(vtos, vtos);
     2910  assert(byte_no == f2_byte, "use this argument");
    28672911
    28682912  load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Lscratch, true,
    2869                              /*is_invokevfinal*/true);
     2913                             /*is_invokevfinal*/true, false);
    28702914  __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
    28712915  invokevfinal_helper(G3_scratch, Lscratch);
     
    29022946void TemplateTable::invokespecial(int byte_no) {
    29032947  transition(vtos, vtos);
     2948  assert(byte_no == f1_byte, "use this argument");
    29042949
    29052950  Register Rscratch = G3_scratch;
     
    29072952  Register Rret = Lscratch;
    29082953
    2909   load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, false);
     2954  load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, /*virtual*/ false, false, false);
    29102955  __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
    29112956
     
    29352980void TemplateTable::invokestatic(int byte_no) {
    29362981  transition(vtos, vtos);
     2982  assert(byte_no == f1_byte, "use this argument");
    29372983
    29382984  Register Rscratch = G3_scratch;
     
    29402986  Register Rret = Lscratch;
    29412987
    2942   load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, false);
     2988  load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Rret, /*virtual*/ false, false, false);
    29432989  __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
    29442990
     
    29933039void TemplateTable::invokeinterface(int byte_no) {
    29943040  transition(vtos, vtos);
     3041  assert(byte_no == f1_byte, "use this argument");
    29953042
    29963043  Register Rscratch = G4_scratch;
     
    30023049  assert_different_registers(Rscratch, G5_method);
    30033050
    3004   load_invoke_cp_cache_entry(byte_no, Rinterface, Rindex, Rflags, false);
     3051  load_invoke_cp_cache_entry(byte_no, Rinterface, Rindex, Rflags, /*virtual*/ false, false, false);
    30053052  __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore
    30063053
     
    31193166void TemplateTable::invokedynamic(int byte_no) {
    31203167  transition(vtos, vtos);
     3168  assert(byte_no == f1_oop, "use this argument");
    31213169
    31223170  if (!EnableInvokeDynamic) {
     
    31313179  }
    31323180
    3133   __ stop("invokedynamic NYI");//6815692//
     3181  // G5: CallSite object (f1)
     3182  // XX: unused (f2)
     3183  // XX: flags (unused)
     3184
     3185  Register G5_callsite = G5_method;
     3186  Register Rscratch    = G3_scratch;
     3187  Register Rtemp       = G1_scratch;
     3188  Register Rret        = Lscratch;
     3189
     3190  load_invoke_cp_cache_entry(byte_no, G5_callsite, noreg, Rret,
     3191                             /*virtual*/ false, /*vfinal*/ false, /*indy*/ true);
     3192  __ mov(SP, O5_savedSP);  // record SP that we wanted the callee to restore
     3193
     3194  __ verify_oop(G5_callsite);
     3195
     3196  // profile this call
     3197  __ profile_call(O4);
     3198
     3199  // get return address
     3200  AddressLiteral table(Interpreter::return_5_addrs_by_index_table());
     3201  __ set(table, Rtemp);
     3202  __ srl(Rret, ConstantPoolCacheEntry::tosBits, Rret);  // get return type
     3203  // Make sure we don't need to mask Rret for tosBits after the above shift
     3204  ConstantPoolCacheEntry::verify_tosBits();
     3205  __ sll(Rret, LogBytesPerWord, Rret);
     3206  __ ld_ptr(Rtemp, Rret, Rret);  // get return address
     3207
     3208  __ ld_ptr(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);
     3209  __ null_check(G3_method_handle);
     3210
     3211  // Adjust Rret first so Llast_SP can be same as Rret
     3212  __ add(Rret, -frame::pc_return_offset, O7);
     3213  __ add(Lesp, BytesPerWord, Gargs);  // setup parameter pointer
     3214  __ jump_to_method_handle_entry(G3_method_handle, Rtemp, /* emit_delayed_nop */ false);
     3215  // Record SP so we can remove any stack space allocated by adapter transition
     3216  __ delayed()->mov(SP, Llast_SP);
    31343217}
    31353218
     
    31543237  __ get_cpool_and_tags(Rscratch, G3_scratch);
    31553238  // make sure the class we're about to instantiate has been resolved
     3239  // This is done before loading instanceKlass to be consistent with the order
     3240  // how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
    31563241  __ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch);
    31573242  __ ldub(G3_scratch, Roffset, G3_scratch);
     
    31593244  __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
    31603245  __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
    3161 
     3246  // get instanceKlass
    31623247  //__ sll(Roffset, LogBytesPerWord, Roffset);        // executed in delay slot
    31633248  __ add(Roffset, sizeof(constantPoolOopDesc), Roffset);
     
    36503735     // put ndims * wordSize into Lscratch
    36513736  __ ldub( Lbcp,     3,               Lscratch);
    3652   __ sll(  Lscratch, Interpreter::logStackElementSize(), Lscratch);
     3737  __ sll(  Lscratch, Interpreter::logStackElementSize, Lscratch);
    36533738     // Lesp points past last_dim, so set to O1 to first_dim address
    36543739  __ add(  Lesp,     Lscratch,        O1);
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1998-2002 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2001-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
     
    6666    }
    6767#ifdef _LP64
    68     // Single issue niagara1 is slower for CompressedOops
    69     // but niagaras after that it's fine.
    70     if (!is_niagara1_plus()) {
    71       if (FLAG_IS_DEFAULT(UseCompressedOops)) {
    72         FLAG_SET_ERGO(bool, UseCompressedOops, false);
    73       }
    74     }
    7568    // 32-bit oops don't make sense for the 64-bit VM on sparc
    7669    // since the 32-bit VM has the same registers and smaller objects.
     
    8780      FLAG_SET_DEFAULT(InteriorEntryAlignment, 4);
    8881    }
     82    if (is_niagara1_plus()) {
     83      if (AllocatePrefetchStyle > 0 && FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
     84        // Use BIS instruction for allocation prefetch.
     85        FLAG_SET_DEFAULT(AllocatePrefetchStyle, 3);
     86        if (FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
     87          // Use smaller prefetch distance on N2 with BIS
     88          FLAG_SET_DEFAULT(AllocatePrefetchDistance, 64);
     89        }
     90      }
     91      if (AllocatePrefetchStyle != 3 && FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
     92        // Use different prefetch distance without BIS
     93        FLAG_SET_DEFAULT(AllocatePrefetchDistance, 256);
     94      }
     95    }
     96#endif
    8997    if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
    9098      FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
    9199    }
    92     if (is_niagara1_plus() && FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
    93       // Use smaller prefetch distance on N2
    94       FLAG_SET_DEFAULT(AllocatePrefetchDistance, 256);
    95     }
    96 #endif
     100    // When using CMS, we cannot use memset() in BOT updates because
     101    // the sun4v/CMT version in libc_psr uses BIS which exposes
     102    // "phantom zeros" to concurrent readers. See 6948537.
     103    if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) {
     104      FLAG_SET_DEFAULT(UseMemSetInBOT, false);
     105    }
    97106  }
    98107
     
    103112    }
    104113  }
     114
     115#ifdef COMPILER2
     116  // Currently not supported anywhere.
     117  FLAG_SET_DEFAULT(UseFPUForSpilling, false);
     118#endif
    105119
    106120  char buf[512];
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp

    r2 r278  
    11/*
    2  * Copyright 2006 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp

    r2 r278  
    11/*
    2  * Copyright 2006-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
  • trunk/openjdk/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp

    r2 r278  
    11/*
    2  * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
     2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    44 *
     
    1717 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1818 *
    19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
     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.
    2222 *
    2323 */
Note: See TracChangeset for help on using the changeset viewer.