Changeset 278 for trunk/openjdk/hotspot/src/cpu/sparc
- Timestamp:
- Mar 26, 2011, 8:39:20 PM (15 years ago)
- Location:
- trunk/openjdk
- Files:
-
- 84 edited
-
. (modified) (2 props)
-
hotspot/src/cpu/sparc/vm/args.cc (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/assembler_sparc.cpp (modified) (15 diffs)
-
hotspot/src/cpu/sparc/vm/assembler_sparc.hpp (modified) (17 diffs)
-
hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp (modified) (13 diffs)
-
hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp (modified) (4 diffs)
-
hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/bytes_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp (modified) (4 diffs)
-
hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp (modified) (32 diffs)
-
hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp (modified) (9 diffs)
-
hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp (modified) (7 diffs)
-
hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/copy_sparc.hpp (modified) (4 diffs)
-
hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/debug_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/dump_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/frame_sparc.cpp (modified) (9 diffs)
-
hotspot/src/cpu/sparc/vm/frame_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/globals_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/icache_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/icache_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp (modified) (35 diffs)
-
hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp (modified) (9 diffs)
-
hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp (modified) (11 diffs)
-
hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp (modified) (5 diffs)
-
hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/jni_sparc.h (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp (modified) (4 diffs)
-
hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp (modified) (4 diffs)
-
hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/register_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/register_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/runtime_sparc.cpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp (modified) (37 diffs)
-
hotspot/src/cpu/sparc/vm/sparc.ad (modified) (45 diffs)
-
hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp (modified) (27 diffs)
-
hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp (modified) (14 diffs)
-
hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp (modified) (3 diffs)
-
hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp (modified) (53 diffs)
-
hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp (modified) (5 diffs)
-
hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp (modified) (2 diffs)
-
hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk
- Property svn:ignore
-
old new 1 1 build 2 build-product-release
-
-
Property svn:mergeinfo
set to
/branches/vendor/oracle/openjdk6/b22 merged eligible /branches/vendor/oracle/openjdk6/current merged eligible
- Property svn:ignore
-
trunk/openjdk/hotspot/src/cpu/sparc/vm/args.cc
r2 r278 1 1 /* 2 * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 627 627 628 628 // 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) {629 void MacroAssembler::jumpl(const AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line) { 630 630 assert_not_delayed(); 631 631 // Force fixed length sethi because NativeJump and NativeFarCall don't handle … … 673 673 } 674 674 675 void MacroAssembler::jump( AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) {675 void MacroAssembler::jump(const AddressLiteral& addrlit, Register temp, int offset, const char* file, int line) { 676 676 jumpl(addrlit, temp, G0, offset, file, line); 677 677 } … … 2334 2334 2335 2335 2336 void 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 2336 2348 void MacroAssembler::float_cmp( bool is_float, int unordered_result, 2337 2349 FloatRegister Fa, FloatRegister Fb, … … 2626 2638 2627 2639 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 2640 RegisterOrConstant 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; 2638 2659 } 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 2673 RegisterOrConstant 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; 2657 2692 } 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 2705 RegisterOrConstant 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 } 2662 2737 } 2663 2738 } … … 2709 2784 // Adjust recv_klass by scaled itable_index, so we can free itable_index. 2710 2785 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); 2714 2789 2715 2790 // for (scan = klass->itable(); scan->interface() != NULL; scan += scan_step) { … … 2806 2881 assert_different_registers(sub_klass, super_klass, temp_reg); 2807 2882 if (super_check_offset.is_register()) { 2808 assert_different_registers(sub_klass, super_klass, 2883 assert_different_registers(sub_klass, super_klass, temp_reg, 2809 2884 super_check_offset.as_register()); 2810 2885 } else if (must_load_sco) { … … 2856 2931 lduw(super_klass, sco_offset, temp2_reg); 2857 2932 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()); 2858 2935 } 2859 2936 ld_ptr(sub_klass, super_check_offset, temp_reg); … … 3015 3092 3016 3093 3017 3018 3019 3094 void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_reg, 3020 3095 Register temp_reg, 3021 3096 Label& wrong_method_type) { 3097 if (UseCompressedOops) unimplemented("coop"); // field accesses must decode 3022 3098 assert_different_registers(mtype_reg, mh_reg, temp_reg); 3023 3099 // compare method type against that of the receiver … … 3030 3106 3031 3107 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. 3112 void 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 3129 void MacroAssembler::jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop) { 3033 3130 assert(mh_reg == G3_method_handle, "caller must put MH object in G3"); 3034 3131 assert_different_registers(mh_reg, temp_reg); 3132 3133 if (UseCompressedOops) unimplemented("coop"); // field accesses must decode 3035 3134 3036 3135 // pick out the interpreted side of the handler … … 3044 3143 // see MethodHandles::generate_method_handle_stub 3045 3144 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 3049 3151 3050 3152 RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot, 3051 3153 int extra_slot_offset) { 3052 3154 // 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; 3057 3157 if (arg_slot.is_constant()) { 3058 3158 offset += arg_slot.as_constant() * stackElementSize; … … 3067 3167 } 3068 3168 3169 3170 Address MacroAssembler::argument_address(RegisterOrConstant arg_slot, 3171 int extra_slot_offset) { 3172 return Address(Gargs, argument_offset(arg_slot, extra_slot_offset)); 3173 } 3069 3174 3070 3175 … … 4083 4188 static void check_index(int ind) { 4084 4189 assert(0 <= ind && ind <= 64*K && ((ind % oopSize) == 0), 4085 "Invariants.") 4190 "Invariants."); 4086 4191 } 4087 4192 … … 4677 4782 } 4678 4783 } 4784 4785 // Compare char[] arrays aligned to 4 bytes. 4786 void 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 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 88 88 REGISTER_DECLARATION(Register, G5_method_type , G5); 89 89 REGISTER_DECLARATION(Register, G3_method_handle , G3); 90 REGISTER_DECLARATION(Register, L7_mh_SP_save , L7); 90 91 91 92 // The compiler requires that G5_megamorphic_method is G5_inline_cache_klass, … … 662 663 swap_op3 = 0x0f, 663 664 664 lduwa_op3 = 0x10,665 ldxa_op3 = 0x1b,666 667 665 stwa_op3 = 0x14, 668 666 stxa_op3 = 0x1e, … … 1066 1064 void assert_not_delayed(const char* msg) { 1067 1065 #ifdef CHECK_DELAY 1068 assert _msg (delay_state == no_delay, msg);1066 assert(delay_state == no_delay, msg); 1069 1067 #endif 1070 1068 } … … 1280 1278 // 171 1281 1279 1280 inline void ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d); 1282 1281 inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d); 1283 1282 inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder()); … … 1383 1382 // pp 181 1384 1383 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) ); } 1387 1386 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) ); } 1388 1387 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) ); } 1389 1388 void andn( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); } 1390 1389 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); 1391 1391 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) ); } 1392 1392 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) ); } 1395 1395 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) ); } 1396 1396 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) ); } … … 1399 1399 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) ); } 1400 1400 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) ); } 1403 1403 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) ); } 1404 1404 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) ); } … … 1536 1536 // pp 222 1537 1537 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); 1539 1540 inline void stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a); 1540 1541 inline void stf( FloatRegisterImpl::Width w, FloatRegister d, const Address& a, int offset = 0); … … 1974 1975 // address pseudos: make these names unlike instruction names to avoid confusion 1975 1976 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); 1982 1983 inline void jump_indirect_to(Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0); 1983 1984 … … 1987 1988 void jmp ( Register r1, int offset, const char* file, int line ); 1988 1989 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); 1991 1992 1992 1993 … … 2028 2029 #endif 2029 2030 2030 // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's2031 // st_long will perform st for 32 bit VM's and stx for 64 bit VM's2031 // 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 2032 2033 inline void ld_long(Register s1, Register s2, Register d); 2033 2034 inline void ld_long(Register s1, int simm13a, Register d); … … 2040 2041 2041 2042 // 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; 2058 2056 } 2059 2057 … … 2237 2235 inline void set_oop (jobject obj, Register d); // uses allocate_oop_address 2238 2236 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_address2237 inline void set_oop (const AddressLiteral& obj_addr, Register d); // same as load_address 2240 2238 2241 2239 void set_narrow_oop( jobject obj, Register d ); … … 2303 2301 void lcmp( Register Ra, Register Rb, Register Rresult); 2304 2302 #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); 2305 2306 2306 2307 void float_cmp( bool is_float, int unordered_result, … … 2422 2423 Register temp_reg, 2423 2424 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); 2425 2428 // offset relative to Gargs of argument at tos[arg_slot]. 2426 2429 // (arg_slot == 0 means the last argument, not the first). 2427 2430 RegisterOrConstant argument_offset(RegisterOrConstant arg_slot, 2428 2431 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); 2430 2435 2431 2436 // Stack overflow checking … … 2455 2460 void inc_counter(address counter_addr, Register Rtmp1, Register Rtmp2); 2456 2461 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); 2457 2467 2458 2468 #undef VIRTUAL -
trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 99 99 inline 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(); } 100 100 inline 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 102 inline 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 } 101 106 102 107 inline 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) ); } … … 202 207 203 208 // 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);209 inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { 210 if (s2.is_register()) add(s1, s2.as_register(), d); 206 211 else { add(s1, s2.as_constant() + offset, d); offset = 0; } 207 212 if (offset != 0) add(d, offset, d); 208 213 } 209 214 215 inline 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 210 220 inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); } 211 221 inline 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)); } … … 224 234 225 235 // pp 222 236 237 inline 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 } 226 241 227 242 inline 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) ); } … … 285 300 inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); } 286 301 inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); } 302 inline void Assembler::stw(Register d, Register s1, RegisterOrConstant s2) { stw(d, Address(s1, s2)); } 287 303 inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); } 288 304 inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); } … … 635 651 636 652 637 inline void MacroAssembler::load_contents( AddressLiteral& addrlit, Register d, int offset) {653 inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) { 638 654 assert_not_delayed(); 639 655 sethi(addrlit, d); … … 642 658 643 659 644 inline void MacroAssembler::load_ptr_contents( AddressLiteral& addrlit, Register d, int offset) {660 inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) { 645 661 assert_not_delayed(); 646 662 sethi(addrlit, d); … … 649 665 650 666 651 inline void MacroAssembler::store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {667 inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { 652 668 assert_not_delayed(); 653 669 sethi(addrlit, temp); … … 656 672 657 673 658 inline void MacroAssembler::store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset) {674 inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { 659 675 assert_not_delayed(); 660 676 sethi(addrlit, temp); … … 664 680 665 681 // 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) {682 inline void MacroAssembler::jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset) { 667 683 assert_not_delayed(); 668 684 // Force fixed length sethi because NativeJump and NativeFarCall don't handle … … 673 689 674 690 675 inline void MacroAssembler::jump_to( AddressLiteral& addrlit, Register temp, int offset) {691 inline void MacroAssembler::jump_to(const AddressLiteral& addrlit, Register temp, int offset) { 676 692 jumpl_to(addrlit, temp, G0, offset); 677 693 } … … 697 713 698 714 699 inline void MacroAssembler::set_oop( AddressLiteral& obj_addr, Register d) {715 inline void MacroAssembler::set_oop(const AddressLiteral& obj_addr, Register d) { 700 716 assert(obj_addr.rspec().type() == relocInfo::oop_type, "must be an oop reloc"); 701 717 set(obj_addr, d); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp
r2 r278 1 1 /* 2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 237 237 238 238 inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { 239 return op1 << op2;239 return op1 << (op2 & 0x1f); 240 240 } 241 241 242 242 inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { 243 return op1 >> op2; // QQ op2 & 0x1f??243 return op1 >> (op2 & 0x1f); 244 244 } 245 245 … … 248 248 } 249 249 250 inline j int BytecodeInterpreter::VMintUshr(jint op1, jint op2) {251 return ((juint) op1) >> op2; // QQ op2 & 0x1f??250 inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { 251 return ((juint) op1) >> (op2 & 0x1f); 252 252 } 253 253 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 378 378 } 379 379 380 381 void 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 380 390 void ArrayCopyStub::emit_code(LIR_Assembler* ce) { 381 391 //---------------slow case: call to native----------------- -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 182 182 183 183 184 void FrameMap::init () {185 if (_init_done) return;184 void FrameMap::initialize() { 185 assert(!_init_done, "once"); 186 186 187 187 int i=0; … … 346 346 347 347 348 // JSR 292 349 LIR_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 348 355 bool FrameMap::validate_frame() { 349 356 int max_offset = in_bytes(framesize_in_bytes()); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 190 190 { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); 191 191 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. 193 196 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); 195 198 #ifdef ASSERT 196 199 // verify the interpreter's monitor has a non-null object 197 200 { 198 201 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); 200 203 __ cmp(G0, O7); 201 204 __ br(Assembler::notEqual, false, Assembler::pt, L); … … 206 209 #endif // ASSERT 207 210 // 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); 209 212 __ 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); 211 214 __ st_ptr(O7, frame_map()->address_for_monitor_object(i)); 212 215 } … … 355 358 356 359 357 voidLIR_Assembler::emit_exception_handler() {360 int LIR_Assembler::emit_exception_handler() { 358 361 // if the last instruction is a call (typically to do a throw which 359 362 // is coming at the end after block reordering) the return address … … 371 374 // not enough space left for the handler 372 375 bailout("exception handler overflow"); 373 return ;374 } 375 #ifdef ASSERT 376 return -1; 377 } 378 376 379 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); 387 382 __ delayed()->nop(); 388 383 debug_only(__ stop("should have gone to the caller");) 389 384 assert(code_offset() - offset <= exception_handler_size, "overflow"); 390 391 385 __ 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. 393 int 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 446 int LIR_Assembler::emit_deopt_handler() { 395 447 // if the last instruction is a call (typically to do a throw which 396 448 // is coming at the end after block reordering) the return address … … 406 458 // not enough space left for the handler 407 459 bailout("deopt handler overflow"); 408 return ;409 } 410 #ifdef ASSERT 460 return -1; 461 } 462 411 463 int offset = code_offset(); 412 #endif // ASSERT413 compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset());414 415 464 AddressLiteral deopt_blob(SharedRuntime::deopt_blob()->unpack()); 416 417 465 __ JUMP(deopt_blob, G3_scratch, 0); // sethi;jmp 418 466 __ delayed()->nop(); 419 420 467 assert(code_offset() - offset <= deopt_handler_size, "overflow"); 421 422 468 debug_only(__ stop("should have gone to the caller");) 423 424 469 __ end_a_stub(); 470 471 return offset; 425 472 } 426 473 … … 689 736 690 737 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) { 738 void 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 745 void LIR_Assembler::ic_call(LIR_OpJavaCall* op) { 698 746 RelocationHolder rspec = virtual_call_Relocation::spec(pc()); 699 747 __ set_oop((jobject)Universe::non_oop_word(), G5_inline_cache_reg); 700 748 __ 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 755 void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) { 756 add_debug_info_for_null_check_here(op->info()); 708 757 __ 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); 711 760 } else { 712 761 // This will generate 2 instructions 713 __ set( vtable_offset, G5_method);762 __ set(op->vtable_offset(), G5_method); 714 763 // ld_ptr, set_hi, set 715 764 __ ld_ptr(G3_scratch, G5_method, G5_method); … … 954 1003 #ifdef _LP64 955 1004 assert(base != to_reg->as_register_lo(), "can't handle this"); 1005 assert(O7 != to_reg->as_register_lo(), "can't handle this"); 956 1006 __ 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 957 1008 __ 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()); 959 1010 #else 960 1011 if (base == to_reg->as_register_lo()) { … … 977 1028 // split unaligned loads 978 1029 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); 981 1032 } else { 982 1033 __ ldf(FloatRegisterImpl::D, base, offset, to_reg->as_double_reg()); … … 1069 1120 switch (c->type()) { 1070 1121 case T_INT: 1071 case T_FLOAT: { 1122 case T_FLOAT: 1123 case T_ADDRESS: { 1072 1124 Register src_reg = O7; 1073 1125 int value = c->as_jint_bits(); … … 1125 1177 switch (c->type()) { 1126 1178 case T_INT: 1127 case T_FLOAT: { 1179 case T_FLOAT: 1180 case T_ADDRESS: { 1128 1181 LIR_Opr tmp = FrameMap::O7_opr; 1129 1182 int value = c->as_jint_bits(); … … 1197 1250 switch (c->type()) { 1198 1251 case T_INT: 1252 case T_ADDRESS: 1199 1253 { 1200 1254 jint con = c->as_jint(); … … 1722 1776 } 1723 1777 } else if (code == lir_cmp_l2i) { 1778 #ifdef _LP64 1779 __ lcmp(left->as_register_lo(), right->as_register_lo(), dst->as_register()); 1780 #else 1724 1781 __ lcmp(left->as_register_hi(), left->as_register_lo(), 1725 1782 right->as_register_hi(), right->as_register_lo(), 1726 1783 dst->as_register()); 1784 #endif 1727 1785 } else { 1728 1786 ShouldNotReachHere(); … … 2040 2098 2041 2099 2042 void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info , bool unwind) {2100 void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) { 2043 2101 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"); 2045 2103 2046 2104 info->add_register_oop(exceptionOop); 2047 2105 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 2118 void 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(); 2062 2123 } 2063 2124 … … 2172 2233 // but not necessarily exactly of type default_type. 2173 2234 Label known_ok, halt; 2174 jobject2reg(op->expected_type()-> encoding(), tmp);2235 jobject2reg(op->expected_type()->constant_encoding(), tmp); 2175 2236 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2176 2237 if (basic_type != T_OBJECT) { … … 2201 2262 2202 2263 __ 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 2203 2265 if (shift == 0) { 2204 2266 __ add(src_ptr, src_pos, src_ptr); … … 2209 2271 2210 2272 __ 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 2211 2274 if (shift == 0) { 2212 2275 __ add(dst_ptr, dst_pos, dst_ptr); … … 2346 2409 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || 2347 2410 (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { 2348 __ br(Assembler::always, false, Assembler::p n, *op->stub()->entry());2411 __ br(Assembler::always, false, Assembler::pt, *op->stub()->entry()); 2349 2412 __ delayed()->nop(); 2350 2413 } else { … … 2430 2493 Register mdo = k_RInfo; 2431 2494 Register data_val = Rtmp1; 2432 jobject2reg(md-> encoding(), mdo);2495 jobject2reg(md->constant_encoding(), mdo); 2433 2496 2434 2497 int mdo_offset_bias = 0; … … 2453 2516 // so let's do it before loading the class 2454 2517 if (k->is_loaded()) { 2455 jobject2reg(k-> encoding(), k_RInfo);2518 jobject2reg(k->constant_encoding(), k_RInfo); 2456 2519 } else { 2457 2520 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); … … 2514 2577 // so let's do it before loading the class 2515 2578 if (k->is_loaded()) { 2516 jobject2reg(k-> encoding(), k_RInfo);2579 jobject2reg(k->constant_encoding(), k_RInfo); 2517 2580 } else { 2518 2581 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); … … 2718 2781 Register mdo = op->mdo()->as_register(); 2719 2782 Register tmp1 = op->tmp1()->as_register(); 2720 jobject2reg(md-> encoding(), mdo);2783 jobject2reg(md->constant_encoding(), mdo); 2721 2784 int mdo_offset_bias = 0; 2722 2785 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, CounterData::count_offset()) + … … 2730 2793 2731 2794 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);2735 2795 Bytecodes::Code bc = method->java_code_at_bci(bci); 2736 2796 // Perform additional virtual call profiling for invokevirtual and … … 2775 2835 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - 2776 2836 mdo_offset_bias); 2777 jobject2reg(known_klass-> encoding(), tmp1);2837 jobject2reg(known_klass->constant_encoding(), tmp1); 2778 2838 __ st_ptr(tmp1, recv_addr); 2779 2839 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - … … 2822 2882 __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - 2823 2883 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(); 2828 2886 __ bind(next_test); 2829 2887 } 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); 2830 2893 2831 2894 __ bind(update_done); 2832 2895 } 2896 } else { 2897 // Static call 2898 __ lduw(counter_addr, tmp1); 2899 __ add(tmp1, DataLayout::counter_increment, tmp1); 2900 __ stw(tmp1, counter_addr); 2833 2901 } 2834 2902 } … … 2836 2904 2837 2905 void LIR_Assembler::align_backward_branch_target() { 2838 __ align( 16);2906 __ align(OptoLoopAlignment); 2839 2907 } 2840 2908 … … 2860 2928 // we may also be emitting the call info for the instruction 2861 2929 // which we are the delay slot of. 2862 CodeEmitInfo * call_info = op->call_info();2930 CodeEmitInfo* call_info = op->call_info(); 2863 2931 if (call_info) { 2864 2932 add_call_info(code_offset(), call_info); … … 3085 3153 inst->at(i - 1)->print(); 3086 3154 inst->at(i)->print(); 3155 tty->cr(); 3087 3156 } 3088 3157 #endif … … 3100 3169 case lir_virtual_call: 3101 3170 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: { 3104 3173 LIR_Op* prev = inst->at(i - 1); 3105 3174 if (LIRFillDelaySlots && prev && prev->code() == lir_move && prev->info() == NULL && … … 3118 3187 inst->at(i - 1)->print(); 3119 3188 inst->at(i)->print(); 3189 tty->cr(); 3120 3190 } 3121 3191 #endif … … 3123 3193 } 3124 3194 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); 3129 3197 break; 3130 3198 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 145 145 // apply the shift and accumulate the displacement 146 146 if (shift > 0) { 147 LIR_Opr tmp = new_ register(T_INT);147 LIR_Opr tmp = new_pointer_register(); 148 148 __ shift_left(index, shift, tmp); 149 149 index = tmp; 150 150 } 151 151 if (disp != 0) { 152 LIR_Opr tmp = new_ register(T_INT);152 LIR_Opr tmp = new_pointer_register(); 153 153 if (Assembler::is_simm13(disp)) { 154 __ add(tmp, LIR_OprFact::int Const(disp), tmp);154 __ add(tmp, LIR_OprFact::intptrConst(disp), tmp); 155 155 index = tmp; 156 156 } else { 157 __ move(LIR_OprFact::int Const(disp), tmp);157 __ move(LIR_OprFact::intptrConst(disp), tmp); 158 158 __ add(tmp, index, tmp); 159 159 index = tmp; … … 163 163 } else if (disp != 0 && !Assembler::is_simm13(disp)) { 164 164 // index is illegal so replace it with the displacement loaded into a register 165 index = new_ register(T_INT);166 __ move(LIR_OprFact::int Const(disp), index);165 index = new_pointer_register(); 166 __ move(LIR_OprFact::intptrConst(disp), index); 167 167 disp = 0; 168 168 } … … 222 222 LIR_Opr ptr = new_pointer_register(); 223 223 __ add(base_opr, LIR_OprFact::intptrConst(offset), ptr); 224 return new LIR_Address(ptr, 0,type);224 return new LIR_Address(ptr, type); 225 225 } else { 226 226 return new LIR_Address(base_opr, offset, type); … … 232 232 LIR_Opr pointer = new_pointer_register(); 233 233 __ 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); 235 235 increment_counter(addr, step); 236 236 } … … 410 410 LIR_Opr hdr = FrameMap::G3_opr; 411 411 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()); 413 413 } 414 414 … … 897 897 BasicType elem_type = x->elt_type(); 898 898 899 __ oop2reg(ciTypeArrayKlass::make(elem_type)-> encoding(), klass_reg);899 __ oop2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg); 900 900 901 901 CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info); … … 1160 1160 LIR_Opr tmp = new_pointer_register(); 1161 1161 __ add(base_op, index_op, tmp); 1162 addr = new LIR_Address(tmp, 0,type);1162 addr = new LIR_Address(tmp, type); 1163 1163 } else { 1164 1164 addr = new LIR_Address(base_op, index_op, type); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 40 40 align(CodeEntryAlignment); 41 41 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 return47 // instruction can be a safepoint.48 if (restore_frame) {49 restore();50 }51 retl();52 delayed()->nop();53 42 } 54 43 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 678 678 679 679 __ 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()); 681 681 __ 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. 684 691 } 685 692 break; … … 986 993 void Runtime1::generate_handle_exception(StubAssembler* sasm, OopMapSet* oop_maps, OopMap* oop_map, bool) { 987 994 Label no_deopt; 988 Label no_handler;989 995 990 996 __ verify_not_null_oop(Oexception); … … 1004 1010 // by entering the deopt blob with a pending exception. 1005 1011 1012 #ifdef ASSERT 1013 Label done; 1006 1014 __ tst(O0); 1007 __ br(Assembler:: zero, false, Assembler::pn, no_handler);1015 __ br(Assembler::notZero, false, Assembler::pn, done); 1008 1016 __ delayed()->nop(); 1017 __ stop("should have found address"); 1018 __ bind(done); 1019 #endif 1009 1020 1010 1021 // restore the registers that were saved at the beginning and jump to the exception handler. … … 1014 1025 __ delayed()->restore(); 1015 1026 1016 __ bind(no_handler);1017 __ mov(L0, I7); // restore return address1018 1019 // restore exception oop1020 __ 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 1030 1027 oop_maps->add_gc_map(call_offset, oop_map); 1031 1028 } … … 1035 1032 1036 1033 #define __ masm-> 1034 1035 const 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 1 1 /* 2 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 61 61 define_pd_global(intx, InteriorEntryAlignment, 16); // = CodeEntryAlignment 62 62 define_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*wordSize66 63 define_pd_global(intx, RegisterCostAreaRatio, 12000); 67 64 define_pd_global(bool, UseTLAB, true); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/copy_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 155 155 156 156 static 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"); 158 158 159 159 julong* to = (julong*)tohw; … … 163 163 size_t odd = count % (BytesPerLong / HeapWordSize) ; 164 164 165 size_t aligned_count = align_object_ size(count - odd) / HeapWordsPerLong;165 size_t aligned_count = align_object_offset(count - odd) / HeapWordsPerLong; 166 166 julong* end = ((julong*)tohw) + aligned_count - 1; 167 167 while (to <= end) { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2007-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 27 27 // if too small. 28 28 // Run with +PrintInterpreter to get the VM to print out the size. 29 // Max size with JVMTI and TaggedStackInterpreter29 // Max size with JVMTI 30 30 31 31 // QQQ this is proably way too large for c++ interpreter -
trunk/openjdk/hotspot/src/cpu/sparc/vm/debug_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 337 337 } 338 338 339 frame::frame(intptr_t* sp, intptr_t* younger_sp, bool younger_frame_adjusted_stack) { 340 _sp = sp; 341 _younger_sp = younger_sp; 339 frame::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) { 342 344 if (younger_sp == NULL) { 343 345 // make a deficient frame which doesn't know where its PC is … … 353 355 // So do not put add any asserts on the _pc here. 354 356 } 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) { 356 375 // 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. 367 382 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; 371 386 _deopt_state = is_deoptimized; 372 387 } else { … … 462 477 if (is_entry_frame()) return sender_for_entry_frame(map); 463 478 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(); 467 481 468 482 // Note: The version of this operation on any platform with callee-save … … 483 497 // explicitly recognized. 484 498 485 adjusted_stack= is_interpreted_frame();486 if ( adjusted_stack) {499 bool frame_is_interpreted = is_interpreted_frame(); 500 if (frame_is_interpreted) { 487 501 map->make_integer_regs_unsaved(); 488 502 map->shift_window(sp, younger_sp); … … 503 517 } 504 518 } 505 return frame(sp, younger_sp, adjusted_stack);519 return frame(sp, younger_sp, frame_is_interpreted); 506 520 } 507 521 … … 520 534 *O7_addr() = pc - pc_return_offset; 521 535 _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"); 525 539 _deopt_state = is_deoptimized; 526 540 } else { … … 620 634 // stack frames shouldn't be much larger than max_stack elements 621 635 622 if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize ()) {636 if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { 623 637 return false; 624 638 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 41 41 42 42 define_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.) 45 define_pd_global(intx, OptoLoopAlignment, 16); // = 4*wordSize 43 46 define_pd_global(intx, InlineFrequencyCount, 50); // we can use more inlining on the SPARC 44 47 define_pd_global(intx, InlineSmallCode, 1500); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2004, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 51 51 assert_different_registers(args_size, locals_size); 52 52 // max_locals*2 for TAGS. Assumes that args_size has already been adjusted. 53 if (TaggedStackInterpreter) sll(locals_size, 1, locals_size);54 53 subcc(locals_size, args_size, delta);// extra space for non-arguments locals in words 55 54 // Use br/mov combination because it works on both V8 and V9 and is … … 245 244 246 245 247 void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1 ) {246 void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2) { 248 247 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); 250 250 } 251 251 #endif /* CC_INTERP */ … … 319 319 #else 320 320 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()); 322 322 #endif 323 323 } … … 330 330 stf(FloatRegisterImpl::D, d, r1, offset); 331 331 // store something more useful here 332 debug_only(stx(G0, r1, offset+Interpreter::stackElementSize ());)332 debug_only(stx(G0, r1, offset+Interpreter::stackElementSize);) 333 333 #else 334 334 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); 336 336 #endif 337 337 } … … 345 345 #else 346 346 ld(r1, offset, rd); 347 ld(r1, offset + Interpreter::stackElementSize (), rd->successor());347 ld(r1, offset + Interpreter::stackElementSize, rd->successor()); 348 348 #endif 349 349 } … … 356 356 stx(l, r1, offset); 357 357 // store something more useful here 358 debug_only(stx(G0, r1, offset+Interpreter::stackElementSize ());)358 debug_only(stx(G0, r1, offset+Interpreter::stackElementSize);) 359 359 #else 360 360 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 } 399 364 400 365 void InterpreterMacroAssembler::pop_i(Register r) { 401 366 assert_not_delayed(); 402 // Uses destination register r for scratch403 debug_only(verify_stack_tag(frame::TagValue, r));404 367 ld(Lesp, Interpreter::expr_offset_in_bytes(0), r); 405 inc(Lesp, Interpreter::stackElementSize ());368 inc(Lesp, Interpreter::stackElementSize); 406 369 debug_only(verify_esp(Lesp)); 407 370 } … … 409 372 void InterpreterMacroAssembler::pop_ptr(Register r, Register scratch) { 410 373 assert_not_delayed(); 411 // Uses destination register r for scratch412 debug_only(verify_stack_tag(frame::TagReference, r, scratch));413 374 ld_ptr(Lesp, Interpreter::expr_offset_in_bytes(0), r); 414 inc(Lesp, Interpreter::stackElementSize ());375 inc(Lesp, Interpreter::stackElementSize); 415 376 debug_only(verify_esp(Lesp)); 416 377 } … … 418 379 void InterpreterMacroAssembler::pop_l(Register r) { 419 380 assert_not_delayed(); 420 // Uses destination register r for scratch421 debug_only(verify_stack_tag(frame::TagCategory2, r));422 381 load_unaligned_long(Lesp, Interpreter::expr_offset_in_bytes(0), r); 423 inc(Lesp, 2*Interpreter::stackElementSize ());382 inc(Lesp, 2*Interpreter::stackElementSize); 424 383 debug_only(verify_esp(Lesp)); 425 384 } … … 428 387 void InterpreterMacroAssembler::pop_f(FloatRegister f, Register scratch) { 429 388 assert_not_delayed(); 430 debug_only(verify_stack_tag(frame::TagValue, scratch));431 389 ldf(FloatRegisterImpl::S, Lesp, Interpreter::expr_offset_in_bytes(0), f); 432 inc(Lesp, Interpreter::stackElementSize ());390 inc(Lesp, Interpreter::stackElementSize); 433 391 debug_only(verify_esp(Lesp)); 434 392 } … … 437 395 void InterpreterMacroAssembler::pop_d(FloatRegister f, Register scratch) { 438 396 assert_not_delayed(); 439 debug_only(verify_stack_tag(frame::TagCategory2, scratch));440 397 load_unaligned_double(Lesp, Interpreter::expr_offset_in_bytes(0), f); 441 inc(Lesp, 2*Interpreter::stackElementSize ());398 inc(Lesp, 2*Interpreter::stackElementSize); 442 399 debug_only(verify_esp(Lesp)); 443 400 } 444 401 445 402 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 too461 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 470 403 void InterpreterMacroAssembler::push_i(Register r) { 471 404 assert_not_delayed(); 472 405 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); 476 408 } 477 409 478 410 void InterpreterMacroAssembler::push_ptr(Register r) { 479 411 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); 490 414 } 491 415 … … 497 421 assert_not_delayed(); 498 422 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; 503 425 store_unaligned_long(r, Lesp, offset); 504 dec(Lesp, 2 * Interpreter::stackElementSize ());426 dec(Lesp, 2 * Interpreter::stackElementSize); 505 427 } 506 428 … … 509 431 assert_not_delayed(); 510 432 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); 514 435 } 515 436 … … 518 439 assert_not_delayed(); 519 440 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; 524 443 store_unaligned_double(d, Lesp, offset); 525 dec(Lesp, 2 * Interpreter::stackElementSize ());444 dec(Lesp, 2 * Interpreter::stackElementSize); 526 445 } 527 446 … … 561 480 562 481 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 483 void InterpreterMacroAssembler::load_ptr(int n, Register val) { 566 484 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 } 486 void InterpreterMacroAssembler::store_ptr(int n, Register val) { 573 487 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 }577 488 } 578 489 … … 580 491 void InterpreterMacroAssembler::load_receiver(Register param_count, 581 492 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); 587 494 ld_ptr(Lesp, param_count, recv); // gets receiver Oop 588 495 } … … 605 512 // Compute max expression stack+register save area 606 513 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 TAGS608 514 add( Gframe_size, frame::memory_parameter_word_sp_offset, Gframe_size ); 609 515 … … 814 720 815 721 816 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, int bcp_offset) { 722 void 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 741 void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, Register tmp, 742 int bcp_offset, size_t index_size) { 817 743 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); 818 744 assert_different_registers(cache, tmp); 819 745 assert_not_delayed(); 820 get_ 2_byte_integer_at_bcp(bcp_offset, cache, tmp, Unsigned);821 // convert from field index to ConstantPoolCacheEntry index822 // and fromword index to byte offset746 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 823 749 sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp); 824 750 add(LcpoolCache, tmp, cache); … … 826 752 827 753 828 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset) { 754 void InterpreterMacroAssembler::get_cache_entry_pointer_at_bcp(Register cache, Register tmp, 755 int bcp_offset, size_t index_size) { 829 756 assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); 830 757 assert_different_registers(cache, tmp); 831 758 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 } 833 764 // convert from field index to ConstantPoolCacheEntry index 834 765 // and from word index to byte offset … … 1675 1606 1676 1607 void InterpreterMacroAssembler::profile_virtual_call(Register receiver, 1677 Register scratch) { 1608 Register scratch, 1609 bool receiver_can_be_null) { 1678 1610 if (ProfileInterpreter) { 1679 1611 Label profile_continue; … … 1682 1614 test_method_data_pointer(profile_continue); 1683 1615 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 } 1686 1629 1687 1630 // Record the receiver type. 1688 record_klass_in_profile(receiver, scratch); 1631 record_klass_in_profile(receiver, scratch, true); 1632 bind(skip_receiver_profile); 1689 1633 1690 1634 // The method data pointer needs to be updated to reflect the new target. … … 1696 1640 void InterpreterMacroAssembler::record_klass_in_profile_helper( 1697 1641 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 } 1700 1647 return; 1648 } 1701 1649 1702 1650 int last_row = VirtualCallData::row_limit() - 1; … … 1715 1663 int recvr_offset = in_bytes(VirtualCallData::receiver_offset(row)); 1716 1664 test_mdp_data_at(recvr_offset, receiver, next_test, scratch); 1665 // delayed()->tst(scratch); 1717 1666 1718 1667 // The receiver is receiver[n]. Increment count[n]. … … 1724 1673 1725 1674 if (test_for_null_also) { 1675 Label found_null; 1726 1676 // Failed the equality check on receiver[n]... Test for null. 1727 1677 if (start_row == last_row) { 1728 1678 // 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 } 1731 1692 break; 1732 1693 } 1733 1694 // Since null is rare, make it be the branch-taken case. 1734 Label found_null;1735 1695 brx(Assembler::zero, false, Assembler::pn, found_null); 1736 1696 delayed()->nop(); 1737 1697 1738 1698 // 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); 1740 1700 1741 1701 // Found a null. Keep searching for a matching receiver, … … 1754 1714 mov(DataLayout::counter_increment, scratch); 1755 1715 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 } 1758 1720 } 1759 1721 1760 1722 void InterpreterMacroAssembler::record_klass_in_profile(Register receiver, 1761 Register scratch ) {1723 Register scratch, bool is_virtual_call) { 1762 1724 assert(ProfileInterpreter, "must be profiling"); 1763 1725 Label done; 1764 1726 1765 record_klass_in_profile_helper(receiver, scratch, 0, done );1727 record_klass_in_profile_helper(receiver, scratch, 0, done, is_virtual_call); 1766 1728 1767 1729 bind (done); … … 1841 1803 1842 1804 // Record the object type. 1843 record_klass_in_profile(klass, scratch );1805 record_klass_in_profile(klass, scratch, false); 1844 1806 } 1845 1807 … … 1970 1932 1971 1933 // Locals 1972 #ifdef ASSERT1973 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 scratch1980 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 tag1989 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 might2000 // 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 // ASSERT2010 2011 1934 void InterpreterMacroAssembler::access_local_ptr( Register index, Register dst ) { 2012 1935 assert_not_delayed(); 2013 sll(index, Interpreter::logStackElementSize (), index);1936 sll(index, Interpreter::logStackElementSize, index); 2014 1937 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); 2017 1939 // Note: index must hold the effective address--the iinc template uses it 2018 1940 } … … 2022 1944 Register dst ) { 2023 1945 assert_not_delayed(); 2024 sll(index, Interpreter::logStackElementSize (), index);1946 sll(index, Interpreter::logStackElementSize, index); 2025 1947 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); 2028 1949 } 2029 1950 2030 1951 void InterpreterMacroAssembler::access_local_int( Register index, Register dst ) { 2031 1952 assert_not_delayed(); 2032 sll(index, Interpreter::logStackElementSize (), index);1953 sll(index, Interpreter::logStackElementSize, index); 2033 1954 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); 2036 1956 // Note: index must hold the effective address--the iinc template uses it 2037 1957 } … … 2040 1960 void InterpreterMacroAssembler::access_local_long( Register index, Register dst ) { 2041 1961 assert_not_delayed(); 2042 sll(index, Interpreter::logStackElementSize (), index);1962 sll(index, Interpreter::logStackElementSize, index); 2043 1963 sub(Llocals, index, index); 2044 debug_only(verify_local_tag(frame::TagCategory2, index, dst));2045 1964 // First half stored at index n+1 (which grows down from Llocals[n]) 2046 1965 load_unaligned_long(index, Interpreter::local_offset_in_bytes(1), dst); … … 2050 1969 void InterpreterMacroAssembler::access_local_float( Register index, FloatRegister dst ) { 2051 1970 assert_not_delayed(); 2052 sll(index, Interpreter::logStackElementSize (), index);1971 sll(index, Interpreter::logStackElementSize, index); 2053 1972 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); 2056 1974 } 2057 1975 … … 2059 1977 void InterpreterMacroAssembler::access_local_double( Register index, FloatRegister dst ) { 2060 1978 assert_not_delayed(); 2061 sll(index, Interpreter::logStackElementSize (), index);1979 sll(index, Interpreter::logStackElementSize, index); 2062 1980 sub(Llocals, index, index); 2063 debug_only(verify_local_tag(frame::TagCategory2, index, G1_scratch));2064 1981 load_unaligned_double(index, Interpreter::local_offset_in_bytes(1), dst); 2065 1982 } … … 2087 2004 #endif // ASSERT 2088 2005 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 2110 2006 2111 2007 void InterpreterMacroAssembler::store_local_int( Register index, Register src ) { 2112 2008 assert_not_delayed(); 2113 sll(index, Interpreter::logStackElementSize (), index);2009 sll(index, Interpreter::logStackElementSize, index); 2114 2010 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 2015 void InterpreterMacroAssembler::store_local_ptr( Register index, Register src ) { 2016 assert_not_delayed(); 2017 sll(index, Interpreter::logStackElementSize, index); 2124 2018 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 2027 void InterpreterMacroAssembler::store_local_ptr( int n, Register src ) { 2028 st_ptr(src, Llocals, Interpreter::local_offset_in_bytes(n)); 2143 2029 } 2144 2030 2145 2031 void InterpreterMacroAssembler::store_local_long( Register index, Register src ) { 2146 2032 assert_not_delayed(); 2147 sll(index, Interpreter::logStackElementSize (), index);2033 sll(index, Interpreter::logStackElementSize, index); 2148 2034 sub(Llocals, index, index); 2149 #ifdef ASSERT2035 #ifdef ASSERT 2150 2036 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 2153 2038 store_unaligned_long(src, index, Interpreter::local_offset_in_bytes(1)); // which is n+1 2154 2039 } … … 2157 2042 void InterpreterMacroAssembler::store_local_float( Register index, FloatRegister src ) { 2158 2043 assert_not_delayed(); 2159 sll(index, Interpreter::logStackElementSize (), index);2044 sll(index, Interpreter::logStackElementSize, index); 2160 2045 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); 2166 2050 } 2167 2051 … … 2169 2053 void InterpreterMacroAssembler::store_local_double( Register index, FloatRegister src ) { 2170 2054 assert_not_delayed(); 2171 sll(index, Interpreter::logStackElementSize (), index);2055 sll(index, Interpreter::logStackElementSize, index); 2172 2056 sub(Llocals, index, index); 2173 #ifdef ASSERT2057 #ifdef ASSERT 2174 2058 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 2177 2060 store_unaligned_double(src, index, Interpreter::local_offset_in_bytes(1)); 2178 2061 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 122 122 123 123 #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); 125 125 126 126 // Generate a subtype check: branch to ok_is_subtype if sub_klass is … … 150 150 void push_i( Register r = Otos_i); 151 151 void push_ptr( Register r = Otos_i); 152 void push_ptr( Register r, Register tag);153 152 void push_l( Register r = Otos_l1); 154 153 void push_f(FloatRegister f = Ftos_f); … … 160 159 void empty_expression_stack(); // resets both Lesp and SP 161 160 162 // Support for Tagged Stacks163 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 167 161 #ifdef ASSERT 168 162 void verify_sp(Register Rsp, Register Rtemp); 169 163 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);173 164 #endif // ASSERT 174 165 … … 192 183 setCCOrNot should_set_CC = dont_set_CC ); 193 184 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)); 196 188 197 189 … … 242 234 #endif // ASSERT 243 235 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 ); 246 238 void store_local_long( Register index, Register src ); 247 239 void store_local_float( Register index, FloatRegister src ); 248 240 void store_local_double( Register index, FloatRegister src ); 249 241 250 // Tagged stack helpers for swap and dup251 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. 255 247 void load_receiver(Register param_count, Register recv); 256 248 … … 291 283 Register scratch); 292 284 293 void record_klass_in_profile(Register receiver, Register scratch );285 void record_klass_in_profile(Register receiver, Register scratch, bool is_virtual_call); 294 286 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); 296 288 297 289 void update_mdp_by_offset(int offset_of_disp, Register scratch); … … 305 297 void profile_call(Register scratch); 306 298 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); 308 300 void profile_ret(TosState state, Register return_bci, Register scratch); 309 301 void profile_null_seen(Register scratch); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 44 44 Register Rtmp = O0; 45 45 46 #ifdef ASSERT47 if (TaggedStackInterpreter) {48 // check at least one tag is okay49 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 // ASSERT58 59 46 #ifdef _LP64 60 47 __ ldx(Llocals, Interpreter::local_offset_in_bytes(offset() + 1), Rtmp); … … 70 57 71 58 72 #ifdef _LP6473 59 void InterpreterRuntime::SignatureHandlerGenerator::pass_float() { 74 60 Argument jni_arg(jni_offset(), false); 61 #ifdef _LP64 75 62 FloatRegister Rtmp = F0; 76 63 __ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp); 77 64 __ 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); 79 69 #endif 70 } 80 71 81 72 … … 108 99 Address h_arg = Address(Llocals, Interpreter::local_offset_in_bytes(offset())); 109 100 __ ld_ptr(h_arg, Rtmp1); 110 #ifdef ASSERT111 if (TaggedStackInterpreter) {112 // check we have the obj and not the tag113 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 // ASSERT122 101 if (!do_NULL_check) { 123 102 __ add(h_arg.base(), h_arg.disp(), Rtmp2); … … 169 148 }; 170 149 171 #ifdef ASSERT172 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 // ASSERT177 178 150 virtual void pass_int() { 179 151 *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); 180 debug_only(verify_tag(frame::TagValue)); 181 _from -= Interpreter::stackElementSize(); 152 _from -= Interpreter::stackElementSize; 182 153 add_signature( non_float ); 183 154 } … … 187 158 intptr_t *from_addr = (intptr_t*)(_from + Interpreter::local_offset_in_bytes(0)); 188 159 *_to++ = (*from_addr == 0) ? NULL : (intptr_t) from_addr; 189 debug_only(verify_tag(frame::TagReference)); 190 _from -= Interpreter::stackElementSize(); 160 _from -= Interpreter::stackElementSize; 191 161 add_signature( non_float ); 192 162 } … … 195 165 virtual void pass_float() { 196 166 *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0)); 197 debug_only(verify_tag(frame::TagValue)); 198 _from -= Interpreter::stackElementSize(); 167 _from -= Interpreter::stackElementSize; 199 168 add_signature( float_sig ); 200 169 } … … 202 171 virtual void pass_double() { 203 172 *_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; 206 174 add_signature( double_sig ); 207 175 } … … 209 177 virtual void pass_long() { 210 178 _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 211 debug_only(verify_tag(frame::TagValue));212 179 _to += 1; 213 _from -= 2*Interpreter::stackElementSize ();180 _from -= 2*Interpreter::stackElementSize; 214 181 add_signature( long_sig ); 215 182 } … … 219 186 _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1)); 220 187 _to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0)); 221 debug_only(verify_tag(frame::TagValue));222 188 _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 226 199 #endif // _LP64 227 200 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 236 236 237 237 238 239 238 // Method handle invoker 240 239 // Dispatch a method of the form java.dyn.MethodHandles::invoke(...) … … 243 242 return generate_abstract_entry(); 244 243 } 245 return generate_abstract_entry(); //6815692// 246 } 247 248 244 245 return MethodHandles::generate_method_handle_interpreter_entry(_masm); 246 } 249 247 250 248 … … 395 393 396 394 395 bool AbstractInterpreter::can_be_compiled(methodHandle m) { 396 // No special entry points that preclude compilation 397 return true; 398 } 399 397 400 // This method tells the deoptimizer how big an interpreted frame must be: 398 401 int AbstractInterpreter::size_activation(methodOop method, -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 25 25 public: 26 26 27 // Support for Tagged Stacks27 static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; } 28 28 29 29 // 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; } 45 31 46 32 // 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; 50 36 } 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 1 1 /* 2 * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 77 77 void set_last_Java_sp(intptr_t* sp) { _last_Java_sp = sp; } 78 78 79 address last_Java_pc(void) { return _last_Java_pc; } 80 79 81 // These are only used by friends 80 82 private: -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2004-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jni_sparc.h
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * 5 5 * This code is free software; you can redistribute it and/or modify it 6 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Sundesignates this7 * published by the Free Software Foundation. Oracle designates this 8 8 * particular file as subject to the "Classpath" exception as provided 9 * by Sunin the LICENSE file that accompanied this code.9 * by Oracle in the LICENSE file that accompanied this code. 10 10 * 11 11 * This code is distributed in the hope that it will be useful, but WITHOUT … … 19 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 20 * 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 or23 * have anyquestions.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. 24 24 */ 25 25 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 30 30 address MethodHandleEntry::start_compiled_entry(MacroAssembler* _masm, 31 31 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. 32 35 __ align(wordSize); 33 36 address target = __ pc() + sizeof(Data); … … 60 63 // Code generation 61 64 address 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; 64 101 } 65 102 103 104 #ifdef ASSERT 105 static 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 128 void 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 207 void 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 272 extern "C" void print_method_handle(oop mh); 273 void 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? 294 int 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 // 66 312 // Generate an "entry" field for a method handle. 67 313 // This determines how the method handle will respond to calls. 68 314 void 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)); 70 952 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 322 322 323 323 // 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; 325 326 if (nm != NULL) { 326 327 RelocIterator iter(nm, instruction_address(), next_instruction_address()); … … 431 432 432 433 // 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; 434 436 if (nm != NULL) { 435 437 RelocIterator iter(nm, instruction_address(), next_instruction_address()); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 143 143 REGISTER_DEFINITION(Register, G4_scratch); 144 144 REGISTER_DEFINITION(Register, Gtemp); 145 REGISTER_DEFINITION(Register, Lentry_args); 146 147 // JSR 292 145 148 REGISTER_DEFINITION(Register, G5_method_type); 146 149 REGISTER_DEFINITION(Register, G3_method_handle); 147 REGISTER_DEFINITION(Register, L entry_args);150 REGISTER_DEFINITION(Register, L7_mh_SP_save); 148 151 149 152 #ifdef CC_INTERP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 117 117 __ restore(); 118 118 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 119 124 // G3_scratch contains handler address 120 125 // 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 1 1 /* 2 * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 108 108 // (as the stub's I's) when the runtime routine called by the stub creates its frame. 109 109 int i; 110 // Always make the frame size 16 byt raligned.110 // Always make the frame size 16 byte aligned. 111 111 int frame_size = round_to(additional_frame_words + register_save_size, 16); 112 112 // OopMap frame size is in c2 stack slots (sizeof(jint)) not bytes or words … … 202 202 __ stxfsr(SP, fsr_offset+STACK_BIAS); 203 203 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) 205 205 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 ) { 207 207 FloatRegister f = as_FloatRegister(i); 208 208 __ stf(FloatRegisterImpl::D, f, SP, offset+STACK_BIAS); 209 // Record as callee saved both halves of double registers (2 float registers). 209 210 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()); 213 212 offset += sizeof(double); 214 213 } … … 225 224 226 225 // 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 ) { 228 227 __ ldf(FloatRegisterImpl::D, SP, d00_offset+i*sizeof(float)+STACK_BIAS, as_FloatRegister(i)); 229 228 } … … 541 540 } 542 541 543 // Helper class mostly to avoid passing masm everywhere, and handle store544 // displacement overflow logic for LP64542 // Helper class mostly to avoid passing masm everywhere, and handle 543 // store displacement overflow logic. 545 544 class AdapterGenerator { 546 545 MacroAssembler *masm; 547 #ifdef _LP64548 546 Register Rdisp; 549 547 void set_Rdisp(Register r) { Rdisp = r; } 550 #endif // _LP64551 548 552 549 void patch_callers_callsite(); 553 void tag_c2i_arg(frame::Tag t, Register base, int st_off, Register scratch);554 550 555 551 // 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; } 557 553 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); 570 561 571 562 // Stores long into offset pointed to by base … … 654 645 } 655 646 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 648 RegisterOrConstant AdapterGenerator::arg_slot(const int st_off) { 649 RegisterOrConstant roc(arg_offset(st_off)); 650 return __ ensure_simm13_or_reg(roc, Rdisp); 651 } 652 653 RegisterOrConstant 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 697 658 698 659 // Stores long into offset pointed to by base … … 721 682 #endif // COMPILER2 722 683 #endif // _LP64 723 tag_c2i_arg(frame::TagCategory2, base, st_off, r);724 684 } 725 685 … … 727 687 const int st_off) { 728 688 __ st_ptr (r, base, arg_slot(st_off)); 729 tag_c2i_arg(frame::TagReference, base, st_off, r);730 689 } 731 690 … … 733 692 const int st_off) { 734 693 __ st (r, base, arg_slot(st_off)); 735 tag_c2i_arg(frame::TagValue, base, st_off, r);736 694 } 737 695 … … 748 706 __ stf(FloatRegisterImpl::S, r_2->as_FloatRegister(), base, arg_slot(st_off) ); 749 707 #endif 750 tag_c2i_arg(frame::TagCategory2, base, st_off, G1_scratch);751 708 } 752 709 … … 754 711 const int st_off) { 755 712 __ stf(FloatRegisterImpl::S, f, base, arg_slot(st_off)); 756 tag_c2i_arg(frame::TagValue, base, st_off, G1_scratch);757 713 } 758 714 … … 789 745 // space we need. Add in varargs area needed by the interpreter. Round up 790 746 // to stack alignment. 791 const int arg_size = total_args_passed * Interpreter::stackElementSize ();747 const int arg_size = total_args_passed * Interpreter::stackElementSize; 792 748 const int varargs_area = 793 749 (frame::varargs_offset - frame::register_save_words)*wordSize; … … 796 752 int bias = STACK_BIAS; 797 753 const int interp_arg_offset = frame::varargs_offset*wordSize + 798 (total_args_passed-1)*Interpreter::stackElementSize ();754 (total_args_passed-1)*Interpreter::stackElementSize; 799 755 800 756 Register base = SP; … … 817 773 // First write G1 (if used) to where ever it must go 818 774 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; 820 776 VMReg r_1 = regs[i].first(); 821 777 VMReg r_2 = regs[i].second(); … … 834 790 // Now write the args into the outgoing interpreter space 835 791 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; 837 793 VMReg r_1 = regs[i].first(); 838 794 VMReg r_2 = regs[i].second(); … … 854 810 #else 855 811 int ld_off = reg2offset(r_1) + extraspace + bias; 812 #endif // _LP64 856 813 #ifdef ASSERT 857 814 G1_forced = true; 858 815 #endif // ASSERT 859 #endif // _LP64860 816 r_1 = G1_scratch->as_VMReg();// as part of the load/store shuffle 861 817 if (!r_2->is_valid()) __ ld (base, ld_off, G1_scratch); … … 868 824 store_c2i_object(r, base, st_off); 869 825 } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) { 826 #ifndef _LP64 870 827 if (TieredCompilation) { 871 828 assert(G1_forced || sig_bt[i] != T_LONG, "should not use register args for longs"); 872 829 } 830 #endif // _LP64 873 831 store_c2i_long(r, base, st_off, r_2->is_stack()); 874 832 } else { … … 901 859 902 860 __ mov((frame::varargs_offset)*wordSize - 903 1*Interpreter::stackElementSize ()+bias+BytesPerWord, G1);861 1*Interpreter::stackElementSize+bias+BytesPerWord, G1); 904 862 // Jump to the interpreter just as if interpreter was doing it. 905 863 __ jmpl(G3_scratch, 0, G0); … … 951 909 // O6 - Adjusted or restored SP 952 910 // 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) 954 912 // F0-F7 - more outgoing args 955 913 … … 957 915 // Gargs is the incoming argument base, and also an outgoing argument. 958 916 __ sub(Gargs, BytesPerWord, Gargs); 959 960 #ifdef ASSERT961 {962 // on entry OsavedSP and SP should be equal963 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 #endif972 917 973 918 // ON ENTRY TO THE CODE WE ARE MAKING, WE HAVE AN INTERPRETED FRAME … … 1052 997 1053 998 // 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; 1056 1000 set_Rdisp(G1_scratch); 1057 #endif // _LP641058 1001 1059 1002 VMReg r_1 = regs[i].first(); … … 1075 1018 // In V9, longs are given 2 64-bit slots in the interpreter, but the 1076 1019 // data is passed in only 1 slot. 1077 Register slot = (sig_bt[i]==T_LONG) ?1020 RegisterOrConstant slot = (sig_bt[i] == T_LONG) ? 1078 1021 next_arg_slot(ld_off) : arg_slot(ld_off); 1079 1022 __ ldx(Gargs, slot, r); … … 1093 1036 // are passed on the stack, but need a stack-to-stack move through a 1094 1037 // 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) ? 1096 1039 next_arg_slot(ld_off) : arg_slot(ld_off); 1097 1040 __ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister()); … … 1110 1053 int st_off = reg2offset(regs[i].first()) + STACK_BIAS; 1111 1054 // 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); 1114 1058 } 1115 1059 } … … 1122 1066 if (regs[i].first()->is_Register() && regs[i].second()->is_valid()) { 1123 1067 // 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; 1125 1069 // Need to marshal 64-bit value from misaligned Lesp loads 1126 1070 Register r = regs[i].first()->as_Register()->after_restore(); … … 1193 1137 int comp_args_on_stack, // VMRegStackSlots 1194 1138 const BasicType *sig_bt, 1195 const VMRegPair *regs) { 1139 const VMRegPair *regs, 1140 AdapterFingerPrint* fingerprint) { 1196 1141 address i2c_entry = __ pc(); 1197 1142 … … 1262 1207 1263 1208 __ 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); 1265 1210 1266 1211 } … … 3063 3008 if (callee_locals < callee_parameters) 3064 3009 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; 3066 3011 return round_to(diff, WordsPerLong); 3067 3012 } … … 3217 3162 Register Oreturn1 = O1; 3218 3163 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; 3222 3166 int frame_size_words; 3223 3167 Address saved_Freturn0_addr(FP, -sizeof(double) + STACK_BIAS); … … 3269 3213 map = RegisterSaver::save_live_registers(masm, 0, &frame_size_words); 3270 3214 __ ba(false, cont); 3271 __ delayed()->mov(Deoptimization::Unpack_deopt, I5exception_tmp);3215 __ delayed()->mov(Deoptimization::Unpack_deopt, L0deopt_mode); 3272 3216 3273 3217 int exception_offset = __ offset() - start; … … 3320 3264 3321 3265 __ ba(false, cont); 3322 __ delayed()->mov(Deoptimization::Unpack_exception, I5exception_tmp);;3266 __ delayed()->mov(Deoptimization::Unpack_exception, L0deopt_mode);; 3323 3267 3324 3268 // … … 3330 3274 (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words); 3331 3275 3332 __ mov(Deoptimization::Unpack_reexecute, I5exception_tmp);3276 __ mov(Deoptimization::Unpack_reexecute, L0deopt_mode); 3333 3277 3334 3278 __ bind(cont); … … 3353 3297 // so this move will survive 3354 3298 3355 __ mov( I5exception_tmp, G4exception_tmp);3299 __ mov(L0deopt_mode, G4deopt_mode); 3356 3300 3357 3301 __ mov(O0, O2UnrollBlock->after_save()); … … 3360 3304 3361 3305 Label noException; 3362 __ cmp(G4 exception_tmp, Deoptimization::Unpack_exception); // Was exception pending?3306 __ cmp(G4deopt_mode, Deoptimization::Unpack_exception); // Was exception pending? 3363 3307 __ br(Assembler::notEqual, false, Assembler::pt, noException); 3364 3308 __ delayed()->nop(); … … 3394 3338 #endif 3395 3339 __ set_last_Java_frame(SP, noreg); 3396 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4 exception_tmp);3340 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, G4deopt_mode); 3397 3341 #else 3398 3342 // LP64 uses g4 in set_last_Java_frame 3399 __ mov(G4 exception_tmp, O1);3343 __ mov(G4deopt_mode, O1); 3400 3344 __ set_last_Java_frame(SP, G0); 3401 3345 __ call_VM_leaf(L7_thread_cache, CAST_FROM_FN_PTR(address, Deoptimization::unpack_frames), G2_thread, O1); … … 3450 3394 MacroAssembler* masm = new MacroAssembler(&buffer); 3451 3395 Register O2UnrollBlock = O2; 3452 Register O3tmp = O3;3453 3396 Register O2klass_index = O2; 3454 3397 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/sparc.ad
r2 r278 1 1 // 2 // Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.2 // Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 // … … 17 17 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 // 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 or21 // have anyquestions.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. 22 22 // 23 23 // … … 194 194 // the place in the sparc stack crawler that asserts on the 255 is 195 195 // fixed up. 196 reg_def R_D32 x(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_D34 x(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_D36 x(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_D38 x(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_D40 x(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_D42 x(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_D44 x(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_D46 x(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_D48 x(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_D50 x(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_D52 x(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_D54 x(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_D56 x(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_D58 x(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_D60 x(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_D62 x(SOC, SOC, Op_RegD,255, F62->as_VMReg());227 reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg()->next());196 reg_def R_D32 (SOC, SOC, Op_RegD, 1, F32->as_VMReg()); 197 reg_def R_D32x(SOC, SOC, Op_RegD,255, F32->as_VMReg()->next()); 198 reg_def R_D34 (SOC, SOC, Op_RegD, 3, F34->as_VMReg()); 199 reg_def R_D34x(SOC, SOC, Op_RegD,255, F34->as_VMReg()->next()); 200 reg_def R_D36 (SOC, SOC, Op_RegD, 5, F36->as_VMReg()); 201 reg_def R_D36x(SOC, SOC, Op_RegD,255, F36->as_VMReg()->next()); 202 reg_def R_D38 (SOC, SOC, Op_RegD, 7, F38->as_VMReg()); 203 reg_def R_D38x(SOC, SOC, Op_RegD,255, F38->as_VMReg()->next()); 204 reg_def R_D40 (SOC, SOC, Op_RegD, 9, F40->as_VMReg()); 205 reg_def R_D40x(SOC, SOC, Op_RegD,255, F40->as_VMReg()->next()); 206 reg_def R_D42 (SOC, SOC, Op_RegD, 11, F42->as_VMReg()); 207 reg_def R_D42x(SOC, SOC, Op_RegD,255, F42->as_VMReg()->next()); 208 reg_def R_D44 (SOC, SOC, Op_RegD, 13, F44->as_VMReg()); 209 reg_def R_D44x(SOC, SOC, Op_RegD,255, F44->as_VMReg()->next()); 210 reg_def R_D46 (SOC, SOC, Op_RegD, 15, F46->as_VMReg()); 211 reg_def R_D46x(SOC, SOC, Op_RegD,255, F46->as_VMReg()->next()); 212 reg_def R_D48 (SOC, SOC, Op_RegD, 17, F48->as_VMReg()); 213 reg_def R_D48x(SOC, SOC, Op_RegD,255, F48->as_VMReg()->next()); 214 reg_def R_D50 (SOC, SOC, Op_RegD, 19, F50->as_VMReg()); 215 reg_def R_D50x(SOC, SOC, Op_RegD,255, F50->as_VMReg()->next()); 216 reg_def R_D52 (SOC, SOC, Op_RegD, 21, F52->as_VMReg()); 217 reg_def R_D52x(SOC, SOC, Op_RegD,255, F52->as_VMReg()->next()); 218 reg_def R_D54 (SOC, SOC, Op_RegD, 23, F54->as_VMReg()); 219 reg_def R_D54x(SOC, SOC, Op_RegD,255, F54->as_VMReg()->next()); 220 reg_def R_D56 (SOC, SOC, Op_RegD, 25, F56->as_VMReg()); 221 reg_def R_D56x(SOC, SOC, Op_RegD,255, F56->as_VMReg()->next()); 222 reg_def R_D58 (SOC, SOC, Op_RegD, 27, F58->as_VMReg()); 223 reg_def R_D58x(SOC, SOC, Op_RegD,255, F58->as_VMReg()->next()); 224 reg_def R_D60 (SOC, SOC, Op_RegD, 29, F60->as_VMReg()); 225 reg_def R_D60x(SOC, SOC, Op_RegD,255, F60->as_VMReg()->next()); 226 reg_def R_D62 (SOC, SOC, Op_RegD, 31, F62->as_VMReg()); 227 reg_def R_D62x(SOC, SOC, Op_RegD,255, F62->as_VMReg()->next()); 228 228 229 229 … … 472 472 #define __ _masm. 473 473 474 // Block initializing store 475 #define ASI_BLK_INIT_QUAD_LDD_P 0xE2 476 474 477 // tertiary op of a LoadP or StoreP encoding 475 478 #define REGP_OP true … … 532 535 533 536 int 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; 535 541 } 536 542 … … 816 822 !(n->ideal_Opcode()==Op_PrefetchRead && ld_op==Op_LoadI) && 817 823 !(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) && 818 828 !(n->rule() == loadUB_rule)) { 819 829 verify_oops_warning(n, n->ideal_Opcode(), ld_op); … … 827 837 !(n->ideal_Opcode()==Op_StoreF && st_op==Op_StoreI) && 828 838 !(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) && 829 842 !(n->ideal_Opcode()==Op_StoreD && st_op==Op_StoreI && n->rule() == storeD0_rule)) { 830 843 verify_oops_warning(n, n->ideal_Opcode(), st_op); … … 921 934 } 922 935 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 form944 // set src2=R_O7 contains offset945 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 955 936 void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false, bool force_far_call = false) { 956 937 // The method which records debug information at every safepoint … … 1780 1761 const bool Matcher::clone_shift_expressions = false; 1781 1762 1763 bool Matcher::narrow_oop_use_complex_address() { 1764 NOT_LP64(ShouldNotCallThis()); 1765 assert(UseCompressedOops, "only for compressed oops code"); 1766 return false; 1767 } 1768 1782 1769 // Is it better to copy float constants, or load them directly from memory? 1783 1770 // Intel can load a float constant from a direct address, requiring no … … 1804 1791 const bool Matcher::strict_fp_requires_explicit_rounding = false; 1805 1792 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. 1795 bool Matcher::float_in_double() { return false; } 1808 1796 1809 1797 // Do ints take an entire long register or just half? … … 1884 1872 ShouldNotReachHere(); 1885 1873 return RegMask(); 1874 } 1875 1876 const RegMask Matcher::method_handle_invoke_SP_save_mask() { 1877 return L7_REGP_mask; 1886 1878 } 1887 1879 … … 1947 1939 %} 1948 1940 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 1954 1941 enc_class form3_mem_prefetch_read( memory mem ) %{ 1955 1942 emit_form3_mem_reg(cbuf, this, $primary, -1, … … 2469 2456 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type, 2470 2457 /*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); 2471 2468 %} 2472 2469 … … 2839 2836 2840 2837 2841 enc_class enc_String_Compare(o0RegP str1, o1RegP str2, g3Reg P tmp1, g4RegP tmp2, notemp_iRegI result) %{2838 enc_class enc_String_Compare(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, notemp_iRegI result) %{ 2842 2839 Label Ldone, Lloop; 2843 2840 MacroAssembler _masm(&cbuf); … … 2845 2842 Register str1_reg = reg_to_register_object($str1$$reg); 2846 2843 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); 2849 2846 Register result_reg = reg_to_register_object($result$$reg); 2850 2847 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"); 2874 2853 2875 2854 // Compute the minimum of the string lengths(str1_reg) and the 2876 2855 // difference of the string lengths (stack) 2877 2878 // discard string base pointers, after loading up the lengths2879 // __ ld(str1_reg, count_offset, str1_reg); // hoisted2880 // __ ld(str2_reg, count_offset, str2_reg); // hoisted2881 2856 2882 2857 // See if the lengths are different, and calculate min in str1_reg. 2883 2858 // Stash diff in O7 in case we need it for a tie-breaker. 2884 2859 Label Lskip; 2885 // __ subcc(str1_reg, str2_reg, O7); // hoisted2886 __ sll( str1_reg, exact_log2(sizeof(jchar)), str1_reg); // scale the limit2860 __ subcc(cnt1_reg, cnt2_reg, O7); 2861 __ sll(cnt1_reg, exact_log2(sizeof(jchar)), cnt1_reg); // scale the limit 2887 2862 __ 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 limit2863 // cnt2 is shorter, so use its count: 2864 __ delayed()->sll(cnt2_reg, exact_log2(sizeof(jchar)), cnt1_reg); // scale the limit 2890 2865 __ bind(Lskip); 2891 2866 2892 // reallocate str1_reg, str2_reg, result_reg2867 // reallocate cnt1_reg, cnt2_reg, result_reg 2893 2868 // 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; 2896 2871 Register chr1_reg = result_reg; 2897 // tmp{12} are the base pointers2872 // str{12} are the base pointers 2898 2873 2899 2874 // Is the minimum length zero? … … 2903 2878 2904 2879 // 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); 2907 2882 2908 2883 // Compare first characters … … 2916 2891 Label LSkip2; 2917 2892 // Check if the strings start at same location 2918 __ cmp( tmp1_reg, tmp2_reg);2893 __ cmp(str1_reg, str2_reg); 2919 2894 __ brx(Assembler::notEqual, true, Assembler::pt, LSkip2); 2920 2895 __ delayed()->nop(); … … 2933 2908 __ delayed()->mov(O7, result_reg); // result is difference in lengths 2934 2909 2935 // Shift tmp1_reg and tmp2_reg to the end of the arrays, negate limit2936 __ 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); 2938 2913 __ neg(chr1_reg, limit_reg); // limit = -(limit-2) 2939 2914 2940 2915 // Compare the rest of the characters 2941 __ lduh( tmp1_reg, limit_reg, chr1_reg);2916 __ lduh(str1_reg, limit_reg, chr1_reg); 2942 2917 __ bind(Lloop); 2943 // __ lduh( tmp1_reg, limit_reg, chr1_reg); // hoisted2944 __ lduh( tmp2_reg, limit_reg, chr2_reg);2918 // __ lduh(str1_reg, limit_reg, chr1_reg); // hoisted 2919 __ lduh(str2_reg, limit_reg, chr2_reg); 2945 2920 __ subcc(chr1_reg, chr2_reg, chr1_reg); 2946 2921 __ br(Assembler::notZero, false, Assembler::pt, Ldone); … … 2949 2924 // annul LDUH if branch is not taken to prevent access past end of string 2950 2925 __ br(Assembler::notZero, true, Assembler::pt, Lloop); 2951 __ delayed()->lduh( tmp1_reg, limit_reg, chr1_reg); // hoisted2926 __ delayed()->lduh(str1_reg, limit_reg, chr1_reg); // hoisted 2952 2927 2953 2928 // If strings are equal up to min length, return the length difference. … … 2958 2933 %} 2959 2934 2960 enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3Reg P tmp1, g4RegP tmp2, notemp_iRegI result) %{2961 Label Lword , Lword_loop, Lpost_word, Lchar, Lchar_loop, Ldone;2935 enc_class enc_String_Equals(o0RegP str1, o1RegP str2, g3RegI cnt, notemp_iRegI result) %{ 2936 Label Lword_loop, Lpost_word, Lchar, Lchar_loop, Ldone; 2962 2937 MacroAssembler _masm(&cbuf); 2963 2938 2964 2939 Register str1_reg = reg_to_register_object($str1$$reg); 2965 2940 Register str2_reg = reg_to_register_object($str2$$reg); 2966 Register tmp1_reg = reg_to_register_object($tmp1$$reg);2967 Register tmp 2_reg = reg_to_register_object($tmp2$$reg);2941 Register cnt_reg = reg_to_register_object($cnt$$reg); 2942 Register tmp1_reg = O7; 2968 2943 Register result_reg = reg_to_register_object($result$$reg); 2969 2944 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[] ? 3002 2952 __ brx(Assembler::equal, true, Assembler::pn, Ldone); 3003 2953 __ delayed()->add(G0, 1, result_reg); 3004 2954 2955 __ br_on_reg_cond(Assembler::rc_z, true, Assembler::pn, cnt_reg, Ldone); 2956 __ delayed()->add(G0, 1, result_reg); // count == 0 2957 3005 2958 //rename registers 3006 Register limit_reg = str1_reg; 3007 Register chr2_reg = str2_reg; 2959 Register limit_reg = cnt_reg; 3008 2960 Register chr1_reg = result_reg; 3009 // tmp{12} are the base pointers2961 Register chr2_reg = tmp1_reg; 3010 2962 3011 2963 //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); 3047 2975 __ ba(false,Ldone); 3048 2976 __ delayed()->add(G0, 1, result_reg); 3049 2977 2978 // char by char compare 3050 2979 __ 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); 3053 2982 __ neg(limit_reg); //negate count 3054 2983 3055 __ lduh(tmp1_reg, limit_reg, chr1_reg); 2984 __ lduh(str1_reg, limit_reg, chr1_reg); 2985 // Lchar_loop 3056 2986 __ bind(Lchar_loop); 3057 __ lduh( tmp2_reg, limit_reg, chr2_reg);2987 __ lduh(str2_reg, limit_reg, chr2_reg); 3058 2988 __ cmp(chr1_reg, chr2_reg); 3059 2989 __ br(Assembler::notEqual, true, Assembler::pt, Ldone); … … 3061 2991 __ inccc(limit_reg, sizeof(jchar)); 3062 2992 // 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 taken3064 __ delayed()->lduh( tmp1_reg, limit_reg, chr1_reg); // hoisted2993 __ br(Assembler::notZero, true, Assembler::pt, Lchar_loop); 2994 __ delayed()->lduh(str1_reg, limit_reg, chr1_reg); // hoisted 3065 2995 3066 2996 __ add(G0, 1, result_reg); //equal … … 3069 2999 %} 3070 3000 3071 enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, g4RegP tmp2,notemp_iRegI result) %{3001 enc_class enc_Array_Equals(o0RegP ary1, o1RegP ary2, g3RegP tmp1, notemp_iRegI result) %{ 3072 3002 Label Lvector, Ldone, Lloop; 3073 3003 MacroAssembler _masm(&cbuf); … … 3076 3006 Register ary2_reg = reg_to_register_object($ary2$$reg); 3077 3007 Register tmp1_reg = reg_to_register_object($tmp1$$reg); 3078 Register tmp2_reg = reg_to_register_object($tmp2$$reg);3008 Register tmp2_reg = O7; 3079 3009 Register result_reg = reg_to_register_object($result$$reg); 3080 3010 … … 3084 3014 // return true if the same array 3085 3015 __ cmp(ary1_reg, ary2_reg); 3086 __ br (Assembler::equal, true, Assembler::pn, Ldone);3016 __ brx(Assembler::equal, true, Assembler::pn, Ldone); 3087 3017 __ delayed()->add(G0, 1, result_reg); // equal 3088 3018 … … 3102 3032 __ delayed()->mov(G0, result_reg); // not equal 3103 3033 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); 3105 3035 __ delayed()->add(G0, 1, result_reg); // zero-length arrays are equal 3106 3036 … … 3110 3040 3111 3041 // renaming registers 3112 Register chr1_reg = tmp2_reg;// for characters in ary13113 Register chr2_reg = result_reg;// for characters in ary23042 Register chr1_reg = result_reg; // for characters in ary1 3043 Register chr2_reg = tmp2_reg; // for characters in ary2 3114 3044 Register limit_reg = tmp1_reg; // length 3115 3045 3116 3046 // set byte count 3117 3047 __ 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); 3151 3052 __ add(G0, 1, result_reg); // equals 3152 3053 … … 4400 4301 // multiple operand types with the same basic encoding and format. The classic 4401 4302 // case of this is memory operands. 4402 // Indirect is not included since its use is limited to Compare & Swap4403 4303 opclass memory( indirect, indOffset13, indIndex ); 4304 opclass indIndexMemory( indIndex ); 4404 4305 4405 4306 //----------PIPELINE----------------------------------------------------------- … … 5708 5609 ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST); 5709 5610 5710 size( 3*4);5611 size((3+1)*4); // set may use two instructions. 5711 5612 format %{ "LDUH $mem,$dst\t! ushort/char & 16-bit mask -> long\n\t" 5712 5613 "SET $mask,$tmp\n\t" … … 5852 5753 ins_cost(MEMORY_REF_COST + 2*DEFAULT_COST); 5853 5754 5854 size( 3*4);5755 size((3+1)*4); // set may use two instructions. 5855 5756 format %{ "LDUW $mem,$dst\t! int & 32-bit mask -> long\n\t" 5856 5757 "SET $mask,$tmp\n\t" … … 6239 6140 6240 6141 instruct prefetchw( memory mem ) %{ 6142 predicate(AllocatePrefetchStyle != 3 ); 6241 6143 match( PrefetchWrite mem ); 6242 6144 ins_cost(MEMORY_REF_COST); … … 6248 6150 %} 6249 6151 6152 // Use BIS instruction to prefetch. 6153 instruct 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 %} 6250 6169 6251 6170 //----------Store Instructions------------------------------------------------- … … 6761 6680 %} 6762 6681 6763 instruct cmovII _U_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{6682 instruct cmovIIu_reg(cmpOpU cmp, flagsRegU icc, iRegI dst, iRegI src) %{ 6764 6683 match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); 6765 6684 ins_cost(150); … … 6770 6689 %} 6771 6690 6772 instruct cmovII _U_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{6691 instruct cmovIIu_imm(cmpOpU cmp, flagsRegU icc, iRegI dst, immI11 src) %{ 6773 6692 match(Set dst (CMoveI (Binary cmp icc) (Binary dst src))); 6774 6693 ins_cost(140); … … 6816 6735 %} 6817 6736 6737 // This instruction also works with CmpN so we don't need cmovNN_reg. 6738 instruct 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 6818 6747 instruct cmovNF_reg(cmpOpF cmp, flagsRegF fcc, iRegN dst, iRegN src) %{ 6819 6748 match(Set dst (CMoveN (Binary cmp fcc) (Binary dst src))); … … 6853 6782 %} 6854 6783 6784 instruct 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 6855 6794 instruct 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 6804 instruct cmovPIu_imm(cmpOpU cmp, flagsRegU icc, iRegP dst, immP0 src) %{ 6856 6805 match(Set dst (CMoveP (Binary cmp icc) (Binary dst src))); 6857 6806 ins_cost(140); … … 6902 6851 %} 6903 6852 6853 instruct 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 6904 6864 // Conditional move, 6905 6865 instruct cmovFF_reg(cmpOpF cmp, flagsRegF fcc, regF dst, regF src) %{ … … 6925 6885 6926 6886 instruct 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 6897 instruct cmovDIu_reg(cmpOpU cmp, flagsRegU icc, regD dst, regD src) %{ 6927 6898 match(Set dst (CMoveD (Binary cmp icc) (Binary dst src))); 6928 6899 ins_cost(150); … … 6964 6935 6965 6936 instruct 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 6947 instruct cmovLIu_reg(cmpOpU cmp, flagsRegU icc, iRegL dst, iRegL src) %{ 6966 6948 match(Set dst (CMoveL (Binary cmp icc) (Binary dst src))); 6967 6949 ins_cost(150); … … 9258 9240 instruct CallStaticJavaDirect( method meth ) %{ 9259 9241 match(CallStaticJava); 9242 predicate(! ((CallStaticJavaNode*)n)->is_method_handle_invoke()); 9260 9243 effect(USE meth); 9261 9244 … … 9264 9247 format %{ "CALL,static ; NOP ==> " %} 9265 9248 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) 9254 instruct 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); 9266 9263 ins_pc_relative(1); 9267 9264 ins_pipe(simple_call); … … 9472 9469 %} 9473 9470 9474 instruct string_compare(o0RegP str1, o1RegP str2, g3Reg P tmp1, g4RegP tmp2, notemp_iRegI result,9475 o7RegI tmp 3, 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);9471 instruct 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); 9478 9475 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) ); 9481 9478 ins_pipe(long_memory_op); 9482 9479 %} 9483 9480 9484 instruct string_equals(o0RegP str1, o1RegP str2, g3Reg P tmp1, g4RegP tmp2, notemp_iRegI result,9485 o7RegI tmp 3, 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);9481 instruct 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); 9488 9485 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) ); 9491 9488 ins_pipe(long_memory_op); 9492 9489 %} 9493 9490 9494 instruct array_equals(o0RegP ary1, o1RegP ary2, g3Reg P tmp1, g4RegP tmp2, notemp_iRegI result,9495 flagsReg ccr) %{9491 instruct array_equals(o0RegP ary1, o1RegP ary2, g3RegI tmp1, notemp_iRegI result, 9492 o7RegI tmp2, flagsReg ccr) %{ 9496 9493 match(Set result (AryEq ary1 ary2)); 9497 9494 effect(USE_KILL ary1, USE_KILL ary2, KILL tmp1, KILL tmp2, KILL ccr); 9498 9495 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)); 9501 9498 ins_pipe(long_memory_op); 9502 9499 %} … … 9674 9671 instruct bytes_reverse_int(iRegI dst, stackSlotI src) %{ 9675 9672 match(Set dst (ReverseBytesI src)); 9676 effect(DEF dst, USE src);9677 9673 9678 9674 // Op cost is artificially doubled to make sure that load or store … … 9680 9676 // onto a stack slot. 9681 9677 ins_cost(2*DEFAULT_COST + MEMORY_REF_COST); 9682 size(8);9683 9678 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 %} 9686 9684 ins_pipe( iload_mem ); 9687 9685 %} … … 9689 9687 instruct bytes_reverse_long(iRegL dst, stackSlotL src) %{ 9690 9688 match(Set dst (ReverseBytesL src)); 9691 effect(DEF dst, USE src);9692 9689 9693 9690 // Op cost is artificially doubled to make sure that load or store … … 9695 9692 // onto a stack slot. 9696 9693 ins_cost(2*DEFAULT_COST + MEMORY_REF_COST); 9697 size(8);9698 9694 format %{ "LDXA $src, $dst\t!asi=primary_little" %} 9699 9695 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 %} 9702 9700 ins_pipe( iload_mem ); 9703 9701 %} 9704 9702 9703 instruct 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 9720 instruct 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 9705 9737 // Load Integer reversed byte order 9706 instruct loadI_reversed(iRegI dst, memory src) %{9738 instruct loadI_reversed(iRegI dst, indIndexMemory src) %{ 9707 9739 match(Set dst (ReverseBytesI (LoadI src))); 9708 9740 9709 9741 ins_cost(DEFAULT_COST + MEMORY_REF_COST); 9710 size( 8);9742 size(4); 9711 9743 format %{ "LDUWA $src, $dst\t!asi=primary_little" %} 9712 9744 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 %} 9715 9748 ins_pipe(iload_mem); 9716 9749 %} 9717 9750 9718 9751 // Load Long - aligned and reversed 9719 instruct loadL_reversed(iRegL dst, memory src) %{9752 instruct loadL_reversed(iRegL dst, indIndexMemory src) %{ 9720 9753 match(Set dst (ReverseBytesL (LoadL src))); 9721 9754 9722 ins_cost( DEFAULT_COST +MEMORY_REF_COST);9723 size( 8);9755 ins_cost(MEMORY_REF_COST); 9756 size(4); 9724 9757 format %{ "LDXA $src, $dst\t!asi=primary_little" %} 9725 9758 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 %} 9728 9762 ins_pipe(iload_mem); 9729 9763 %} 9730 9764 9765 // Load unsigned short / char reversed byte order 9766 instruct 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 9780 instruct 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 9731 9793 // Store Integer reversed byte order 9732 instruct storeI_reversed( memory dst, iRegI src) %{9794 instruct storeI_reversed(indIndexMemory dst, iRegI src) %{ 9733 9795 match(Set dst (StoreI dst (ReverseBytesI src))); 9734 9796 9735 9797 ins_cost(MEMORY_REF_COST); 9736 size( 8);9798 size(4); 9737 9799 format %{ "STWA $src, $dst\t!asi=primary_little" %} 9738 9800 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 %} 9741 9804 ins_pipe(istore_mem_reg); 9742 9805 %} 9743 9806 9744 9807 // Store Long reversed byte order 9745 instruct storeL_reversed( memory dst, iRegL src) %{9808 instruct storeL_reversed(indIndexMemory dst, iRegL src) %{ 9746 9809 match(Set dst (StoreL dst (ReverseBytesL src))); 9747 9810 9748 9811 ins_cost(MEMORY_REF_COST); 9749 size( 8);9812 size(4); 9750 9813 format %{ "STXA $src, $dst\t!asi=primary_little" %} 9751 9814 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 9822 instruct 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 9836 instruct 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 %} 9754 9846 ins_pipe(istore_mem_reg); 9755 9847 %} -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 140 140 __ add(t, frame::memory_parameter_word_sp_offset, t); // add space for save area (in words) 141 141 __ round_to(t, WordsPerLong); // make sure it is multiple of 2 (in words) 142 __ sll(t, Interpreter::logStackElementSize (), t);// compute number of bytes142 __ sll(t, Interpreter::logStackElementSize, t); // compute number of bytes 143 143 __ neg(t); // negate so it can be used with save 144 144 __ save(SP, t, SP); // setup new frame … … 192 192 Label loop; 193 193 __ BIND(loop); 194 // Store tag first.195 if (TaggedStackInterpreter) {196 __ ld_ptr(src, 0, tmp);197 __ add(src, BytesPerWord, src); // get next198 __ st_ptr(tmp, dst, Interpreter::tag_offset_in_bytes());199 }200 194 // Store parameter value 201 195 __ ld_ptr(src, 0, tmp); 202 196 __ add(src, BytesPerWord, src); 203 __ st_ptr(tmp, dst, Interpreter::value_offset_in_bytes());197 __ st_ptr(tmp, dst, 0); 204 198 __ deccc(cnt); 205 199 __ br(Assembler::greater, false, Assembler::pt, loop); 206 __ delayed()->sub(dst, Interpreter::stackElementSize (), dst);200 __ delayed()->sub(dst, Interpreter::stackElementSize, dst); 207 201 208 202 // done … … 221 215 const Register t = G3_scratch; 222 216 __ ld_ptr(parameter_size.as_in().as_address(), t); // get parameter size (in words) 223 __ sll(t, Interpreter::logStackElementSize (), t);// compute number of bytes217 __ sll(t, Interpreter::logStackElementSize, t); // compute number of bytes 224 218 __ sub(FP, t, Gargs); // setup parameter pointer 225 219 #ifdef _LP64 … … 380 374 __ add(O7->after_save(), frame::pc_return_offset, Lscratch); // save the issuing PC 381 375 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); 383 377 __ mov(O0, handler_reg); 384 378 __ restore(); // compensates for compiler weakness … … 1014 1008 __ delayed()->cmp(to_from, byte_count); 1015 1009 if (NOLp == NULL) 1016 __ brx(Assembler::greaterEqual , false, Assembler::pt, no_overlap_target);1010 __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, no_overlap_target); 1017 1011 else 1018 __ brx(Assembler::greaterEqual , false, Assembler::pt, (*NOLp));1012 __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, (*NOLp)); 1019 1013 __ delayed()->nop(); 1020 1014 } … … 1149 1143 __ ldx(from, 0, O3); 1150 1144 __ inc(from, 8); 1151 __ align( 16);1145 __ align(OptoLoopAlignment); 1152 1146 __ BIND(L_loop); 1153 1147 __ ldx(from, 0, O4); … … 1221 1215 __ andn(end_from, 7, end_from); // Align address 1222 1216 __ ldx(end_from, 0, O3); 1223 __ align( 16);1217 __ align(OptoLoopAlignment); 1224 1218 __ BIND(L_loop); 1225 1219 __ ldx(end_from, -8, O4); … … 1350 1344 __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1351 1345 __ delayed()->nop(); 1352 __ align( 16);1346 __ align(OptoLoopAlignment); 1353 1347 __ BIND(L_copy_byte_loop); 1354 1348 __ ldub(from, offset, O3); … … 1446 1440 } 1447 1441 // copy 4 elements (16 bytes) at a time 1448 __ align( 16);1442 __ align(OptoLoopAlignment); 1449 1443 __ BIND(L_aligned_copy); 1450 1444 __ dec(end_from, 16); … … 1462 1456 __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1463 1457 __ delayed()->nop(); 1464 __ align( 16);1458 __ align(OptoLoopAlignment); 1465 1459 __ BIND(L_copy_byte_loop); 1466 1460 __ dec(end_from); … … 1578 1572 __ br_zero(Assembler::zero, false, Assembler::pt, count, L_exit); 1579 1573 __ delayed()->nop(); 1580 __ align( 16);1574 __ align(OptoLoopAlignment); 1581 1575 __ BIND(L_copy_2_bytes_loop); 1582 1576 __ lduh(from, offset, O3); … … 1591 1585 __ retl(); 1592 1586 __ 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 } 1593 1810 return start; 1594 1811 } … … 1685 1902 } 1686 1903 // copy 4 elements (16 bytes) at a time 1687 __ align( 16);1904 __ align(OptoLoopAlignment); 1688 1905 __ BIND(L_aligned_copy); 1689 1906 __ dec(end_from, 16); … … 1782 1999 __ dec(count, 4); // The cmp at the beginning guaranty count >= 4 1783 2000 1784 __ align( 16);2001 __ align(OptoLoopAlignment); 1785 2002 __ BIND(L_copy_16_bytes); 1786 2003 __ ldx(from, 4, O4); … … 1908 2125 // 1909 2126 __ ldx(end_from, -4, O3); 1910 __ align( 16);2127 __ align(OptoLoopAlignment); 1911 2128 __ BIND(L_copy_16_bytes); 1912 2129 __ ldx(end_from, -12, O4); … … 1930 2147 1931 2148 // copy 4 elements (16 bytes) at a time 1932 __ align( 16);2149 __ align(OptoLoopAlignment); 1933 2150 __ BIND(L_aligned_copy); 1934 2151 __ dec(end_from, 16); … … 2001 2218 // count: O2 treated as signed 2002 2219 // 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 // 2003 2241 void generate_disjoint_long_copy_core(bool aligned) { 2004 2242 Label L_copy_8_bytes, L_copy_16_bytes, L_exit; … … 2013 2251 __ brx(Assembler::negative, false, Assembler::pn, L_copy_8_bytes ); 2014 2252 __ 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); 2016 2286 __ BIND(L_copy_16_bytes); 2017 2287 __ ldx(from, offset0, O3); … … 2024 2294 __ delayed()->inc(offset8, 16); 2025 2295 2296 // Copy last 8 bytes 2026 2297 __ BIND(L_copy_8_bytes); 2027 2298 __ inccc(count, 2); … … 2086 2357 __ delayed()->sllx(count, LogBytesPerLong, offset8); 2087 2358 __ sub(offset8, 8, offset0); 2088 __ align( 16);2359 __ align(OptoLoopAlignment); 2089 2360 __ BIND(L_copy_16_bytes); 2090 2361 __ ldx(from, offset8, O2); … … 2315 2586 __ restore(); 2316 2587 #endif 2588 2589 assert_clean_int(O2_count, G1); // Make sure 'count' is clean int. 2317 2590 2318 2591 #ifdef ASSERT … … 2330 2603 #endif //ASSERT 2331 2604 2332 assert_clean_int(O2_count, G1); // Make sure 'count' is clean int.2333 2334 2605 checkcast_copy_entry = __ pc(); 2335 2606 // caller can pass a 64-bit byte count here (from generic stub) … … 2352 2623 // (O2 = len; O2 != 0; O2--) --- number of oops *remaining* 2353 2624 // G3, G4, G5 --- current oop, oop.klass, oop.klass.super 2354 __ align( 16);2625 __ align(OptoLoopAlignment); 2355 2626 2356 2627 __ BIND(store_element); … … 2808 3079 StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy"); 2809 3080 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"); 2810 3088 } 2811 3089 … … 2863 3141 // arraycopy stubs used by compilers 2864 3142 generate_arraycopy_stubs(); 3143 3144 // Don't initialize the platform math functions since sparc 3145 // doesn't have intrinsics for these operations. 2865 3146 } 2866 3147 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 38 38 enum /* platform_dependent_constants */ { 39 39 // %%%%%%%% 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 45 enum method_handles_platform_dependent_constants { 46 method_handles_adapters_code_size = 6000 42 47 }; 43 48 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 151 151 152 152 153 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step, bool unbox) { 154 assert(!unbox, "NYI");//6815692// 153 address TemplateInterpreterGenerator::generate_return_entry_for(TosState state, int step) { 154 TosState incoming_state = state; 155 156 Label cont; 155 157 address compiled_entry = __ pc(); 156 Label cont;157 158 158 159 address entry = __ pc(); … … 167 168 // first which would move g1 -> O0/O1 and destroy the exception we were throwing. 168 169 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 175 175 176 176 __ bind(cont); … … 184 184 __ mov(Llast_SP, SP); // Remove any adapter added stack space. 185 185 186 186 Label L_got_cache, L_giant_index; 187 187 const Register cache = G3_scratch; 188 188 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 } 189 195 __ get_cache_and_index_at_bcp(cache, G1_scratch, 1); 196 __ bind(L_got_cache); 190 197 __ ld_ptr(cache, constantPoolCacheOopDesc::base_offset() + 191 198 ConstantPoolCacheEntry::flags_offset(), size); 192 199 __ and3(size, 0xFF, size); // argument size in words 193 __ sll(size, Interpreter::logStackElementSize (), size); // each argument size in bytes200 __ sll(size, Interpreter::logStackElementSize, size); // each argument size in bytes 194 201 __ add(Lesp, size, Lesp); // pop arguments 195 202 __ 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 } 196 211 197 212 return entry; … … 481 496 // 482 497 assert_different_registers(Gargs, Glocals_size, Gframe_size, O5_savedSP); 483 __ sll(Glocals_size, Interpreter::logStackElementSize (), Otmp1);498 __ sll(Glocals_size, Interpreter::logStackElementSize, Otmp1); 484 499 __ add(Gargs, Otmp1, Gargs); 485 500 … … 497 512 __ sub( Otmp1, Glocals_size, Glocals_size ); 498 513 __ round_to( Glocals_size, WordsPerLong ); 499 __ sll( Glocals_size, Interpreter::logStackElementSize (), Glocals_size );514 __ sll( Glocals_size, Interpreter::logStackElementSize, Glocals_size ); 500 515 501 516 // see if the frame is greater than one page in size. If so, … … 505 520 __ add( Gframe_size, extra_space, Gframe_size ); 506 521 __ round_to( Gframe_size, WordsPerLong ); 507 __ sll( Gframe_size, Interpreter::logStackElementSize (), Gframe_size);522 __ sll( Gframe_size, Interpreter::logStackElementSize, Gframe_size); 508 523 509 524 // Add in java locals size for stack overflow check only … … 1220 1235 __ lduh( size_of_locals, O2 ); 1221 1236 __ 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 ); 1224 1239 __ sub( Llocals, O2, O2 ); 1225 1240 __ sub( Llocals, O1, O1 ); … … 1456 1471 // callee_locals and max_stack are counts, not the size in frame. 1457 1472 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; 1460 1475 return (round_to((max_stack_words 1461 1476 //6815692//+ methodOopDesc::extra_stack_words() … … 1556 1571 // preallocate stack space 1557 1572 intptr_t* esp = monitors - 1 - 1558 (tempcount * Interpreter::stackElementWords ()) -1573 (tempcount * Interpreter::stackElementWords) - 1559 1574 popframe_extra_args; 1560 1575 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; 1563 1578 NEEDS_CLEANUP; 1564 1579 intptr_t* locals; … … 1648 1663 1649 1664 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"); 1651 1666 assert(interpreter_frame->interpreter_frame_monitor_end() == mp, "monitor_end matches"); 1652 1667 assert(((intptr_t *)interpreter_frame->interpreter_frame_monitor_begin()) == ((intptr_t *)mp)+monitor_size, "monitor_begin matches"); … … 1744 1759 // Compute size of arguments for saving when returning to deoptimized caller 1745 1760 __ lduh(Lmethod, in_bytes(methodOopDesc::size_of_parameters_offset()), Gtmp1); 1746 __ sll(Gtmp1, Interpreter::logStackElementSize (), Gtmp1);1761 __ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1); 1747 1762 __ sub(Llocals, Gtmp1, Gtmp2); 1748 1763 __ add(Gtmp2, wordSize, Gtmp2); … … 1824 1839 __ super_call_VM_leaf(L7_thread_cache, 1825 1840 CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), 1826 Oissuing_pc->after_save());1841 G2_thread, Oissuing_pc->after_save()); 1827 1842 1828 1843 // The caller's SP was adjusted upon method entry to accomodate -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 30 30 // if too small. 31 31 // 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 33 34 #ifdef _LP64 34 35 // The sethi() instruction generates lots more instructions when shell -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 319 319 } 320 320 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. 324 void 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 321 346 void TemplateTable::ldc2_w() { 322 347 transition(vtos, vtos); … … 581 606 void TemplateTable::iload(int n) { 582 607 transition(vtos, itos); 583 debug_only(__ verify_local_tag(frame::TagValue, Llocals, Otos_i, n));584 608 __ ld( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i ); 585 609 } … … 589 613 transition(vtos, ltos); 590 614 assert(n+1 < Argument::n_register_parameters, "would need more code"); 591 debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, Otos_l, n));592 615 __ load_unaligned_long(Llocals, Interpreter::local_offset_in_bytes(n+1), Otos_l); 593 616 } … … 597 620 transition(vtos, ftos); 598 621 assert(n < Argument::n_register_parameters, "would need more code"); 599 debug_only(__ verify_local_tag(frame::TagValue, Llocals, G3_scratch, n));600 622 __ ldf( FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(n), Ftos_f ); 601 623 } … … 605 627 transition(vtos, dtos); 606 628 FloatRegister dst = Ftos_d; 607 debug_only(__ verify_local_tag(frame::TagCategory2, Llocals, G3_scratch, n));608 629 __ load_unaligned_double(Llocals, Interpreter::local_offset_in_bytes(n+1), dst); 609 630 } … … 612 633 void TemplateTable::aload(int n) { 613 634 transition(vtos, atos); 614 debug_only(__ verify_local_tag(frame::TagReference, Llocals, Otos_i, n));615 635 __ ld_ptr( Llocals, Interpreter::local_offset_in_bytes(n), Otos_i ); 616 636 } … … 708 728 void TemplateTable::astore() { 709 729 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); 713 732 __ verify_oop_or_return_address(Otos_i, G3_scratch); 714 733 locals_index(G3_scratch); 715 __ store_local_ptr( G3_scratch, Otos_i, Otos_l2);734 __ store_local_ptr(G3_scratch, Otos_i); 716 735 } 717 736 … … 751 770 void TemplateTable::wide_astore() { 752 771 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); 756 774 __ verify_oop_or_return_address(Otos_i, G3_scratch); 757 775 locals_index_wide(G3_scratch); 758 __ store_local_ptr( G3_scratch, Otos_i, Otos_l2);776 __ store_local_ptr(G3_scratch, Otos_i); 759 777 } 760 778 … … 846 864 847 865 __ 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) 849 867 850 868 __ bind(is_null); … … 852 870 853 871 __ 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) 855 873 __ bind(done); 856 874 } … … 885 903 void TemplateTable::istore(int n) { 886 904 transition(itos, vtos); 887 __ tag_local(frame::TagValue, Llocals, Otos_i, n);888 905 __ st(Otos_i, Llocals, Interpreter::local_offset_in_bytes(n)); 889 906 } … … 893 910 transition(ltos, vtos); 894 911 assert(n+1 < Argument::n_register_parameters, "only handle register cases"); 895 __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);896 912 __ store_unaligned_long(Otos_l, Llocals, Interpreter::local_offset_in_bytes(n+1)); 897 913 … … 902 918 transition(ftos, vtos); 903 919 assert(n < Argument::n_register_parameters, "only handle register cases"); 904 __ tag_local(frame::TagValue, Llocals, Otos_l, n);905 920 __ stf(FloatRegisterImpl::S, Ftos_f, Llocals, Interpreter::local_offset_in_bytes(n)); 906 921 } … … 910 925 transition(dtos, vtos); 911 926 FloatRegister src = Ftos_d; 912 __ tag_local(frame::TagCategory2, Llocals, Otos_l, n);913 927 __ store_unaligned_double(src, Llocals, Interpreter::local_offset_in_bytes(n+1)); 914 928 } … … 917 931 void TemplateTable::astore(int n) { 918 932 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); 922 935 __ 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); 924 937 } 925 938 … … 927 940 void TemplateTable::pop() { 928 941 transition(vtos, vtos); 929 __ inc(Lesp, Interpreter::stackElementSize ());942 __ inc(Lesp, Interpreter::stackElementSize); 930 943 } 931 944 … … 933 946 void TemplateTable::pop2() { 934 947 transition(vtos, vtos); 935 __ inc(Lesp, 2 * Interpreter::stackElementSize ());948 __ inc(Lesp, 2 * Interpreter::stackElementSize); 936 949 } 937 950 … … 941 954 // stack: ..., a 942 955 // 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); 945 958 // stack: ..., a, a 946 959 } … … 950 963 transition(vtos, vtos); 951 964 // stack: ..., a, b 952 __ load_ptr _and_tag(1, G3_scratch, G4_scratch);// get a953 __ load_ptr _and_tag(0, Otos_l1, Otos_l2);// get b954 __ store_ptr _and_tag(1, Otos_l1, Otos_l2);// put b955 __ store_ptr _and_tag(0, G3_scratch, G4_scratch); // put a - like swap956 __ push_ptr(Otos_l1 , Otos_l2);// push b965 __ 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 957 970 // stack: ..., b, a, b 958 971 } … … 963 976 // stack: ..., a, b, c 964 977 // get c and push on stack, reuse registers 965 __ load_ptr _and_tag(0, G3_scratch, G4_scratch);// get c966 __ push_ptr(G3_scratch , G4_scratch);// push c with tag978 __ load_ptr( 0, G3_scratch); // get c 979 __ push_ptr(G3_scratch); // push c with tag 967 980 // stack: ..., a, b, c, c (c in reg) (Lesp - 4) 968 981 // (stack offsets n+1 now) 969 __ load_ptr _and_tag(3, Otos_l1, Otos_l2);// get a970 __ store_ptr _and_tag(3, G3_scratch, G4_scratch);// put c at 3982 __ load_ptr( 3, Otos_l1); // get a 983 __ store_ptr(3, G3_scratch); // put c at 3 971 984 // stack: ..., c, b, c, c (a in reg) 972 __ load_ptr _and_tag(2, G3_scratch, G4_scratch);// get b973 __ store_ptr _and_tag(2, Otos_l1, Otos_l2);// put a at 2985 __ load_ptr( 2, G3_scratch); // get b 986 __ store_ptr(2, Otos_l1); // put a at 2 974 987 // stack: ..., c, a, c, c (b in reg) 975 __ store_ptr _and_tag(1, G3_scratch, G4_scratch);// put b at 1988 __ store_ptr(1, G3_scratch); // put b at 1 976 989 // stack: ..., c, a, b, c 977 990 } … … 980 993 void TemplateTable::dup2() { 981 994 transition(vtos, vtos); 982 __ load_ptr _and_tag(1, G3_scratch, G4_scratch);// get a983 __ load_ptr _and_tag(0, Otos_l1, Otos_l2);// get b984 __ push_ptr(G3_scratch , G4_scratch);// push a985 __ push_ptr(Otos_l1 , Otos_l2);// push b995 __ 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 986 999 // stack: ..., a, b, a, b 987 1000 } … … 991 1004 transition(vtos, vtos); 992 1005 // stack: ..., a, b, c 993 __ load_ptr _and_tag(1, Lscratch, G1_scratch);// get b994 __ load_ptr _and_tag(2, Otos_l1, Otos_l2);// get a995 __ store_ptr _and_tag(2, Lscratch, G1_scratch);// put b at a1006 __ load_ptr( 1, Lscratch); // get b 1007 __ load_ptr( 2, Otos_l1); // get a 1008 __ store_ptr(2, Lscratch); // put b at a 996 1009 // stack: ..., b, b, c 997 __ load_ptr _and_tag(0, G3_scratch, G4_scratch);// get c998 __ store_ptr _and_tag(1, G3_scratch, G4_scratch);// put c at b1010 __ load_ptr( 0, G3_scratch); // get c 1011 __ store_ptr(1, G3_scratch); // put c at b 999 1012 // stack: ..., b, c, c 1000 __ store_ptr _and_tag(0, Otos_l1, Otos_l2);// put a at c1013 __ store_ptr(0, Otos_l1); // put a at c 1001 1014 // stack: ..., b, c, a 1002 __ push_ptr(Lscratch , G1_scratch);// push b1003 __ push_ptr(G3_scratch , G4_scratch);// push c1015 __ push_ptr(Lscratch); // push b 1016 __ push_ptr(G3_scratch); // push c 1004 1017 // stack: ..., b, c, a, b, c 1005 1018 } … … 1011 1024 transition(vtos, vtos); 1012 1025 // stack: ..., a, b, c, d 1013 __ load_ptr _and_tag(1, Lscratch, G1_scratch);// get c1014 __ load_ptr _and_tag(3, Otos_l1, Otos_l2);// get a1015 __ store_ptr _and_tag(3, Lscratch, G1_scratch);// put c at 31016 __ store_ptr _and_tag(1, Otos_l1, Otos_l2);// put a at 11026 __ 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 1017 1030 // stack: ..., c, b, a, d 1018 __ load_ptr _and_tag(2, G3_scratch, G4_scratch);// get b1019 __ load_ptr _and_tag(0, Otos_l1, Otos_l2);// get d1020 __ store_ptr _and_tag(0, G3_scratch, G4_scratch);// put b at 01021 __ store_ptr _and_tag(2, Otos_l1, Otos_l2);// put d at 21031 __ 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 1022 1035 // stack: ..., c, d, a, b 1023 __ push_ptr(Lscratch , G1_scratch);// push c1024 __ push_ptr(Otos_l1 , Otos_l2);// push d1036 __ push_ptr(Lscratch); // push c 1037 __ push_ptr(Otos_l1); // push d 1025 1038 // stack: ..., c, d, a, b, c, d 1026 1039 } … … 1030 1043 transition(vtos, vtos); 1031 1044 // stack: ..., a, b 1032 __ load_ptr _and_tag(1, G3_scratch, G4_scratch);// get a1033 __ load_ptr _and_tag(0, Otos_l1, Otos_l2);// get b1034 __ store_ptr _and_tag(0, G3_scratch, G4_scratch);// put b1035 __ store_ptr _and_tag(1, Otos_l1, Otos_l2);// put a1045 __ 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 1036 1049 // stack: ..., b, a 1037 1050 } … … 1046 1059 // %%%%% Mul may not exist: better to call .mul? 1047 1060 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; 1051 1064 case shl: __ sll(O1, Otos_i, Otos_i); break; 1052 1065 case shr: __ sra(O1, Otos_i, Otos_i); break; … … 1062 1075 switch (op) { 1063 1076 #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; 1069 1082 #else 1070 1083 case add: __ addcc(O3, Otos_l2, Otos_l2); __ addc(O2, Otos_l1, Otos_l1); break; 1071 1084 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; 1075 1088 #endif 1076 1089 default: ShouldNotReachHere(); … … 1308 1321 __ access_local_int(G3_scratch, Otos_i); 1309 1322 __ 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_scratch1323 __ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch 1311 1324 } 1312 1325 … … 1318 1331 __ access_local_int(G3_scratch, Otos_i); 1319 1332 __ 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_scratch1333 __ st(Otos_i, G3_scratch, 0); // access_local_int puts E.A. in G3_scratch 1321 1334 } 1322 1335 … … 1556 1569 __ add(Lbcp, O1_disp, Lbcp); 1557 1570 // 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); 1559 1572 // And away we go! 1560 1573 __ dispatch_next(vtos); … … 1962 1975 1963 1976 // ---------------------------------------------------------------------------- 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"); 1977 void TemplateTable::resolve_cache_and_index(int byte_no, 1978 Register result, 1979 Register Rcache, 1980 Register index, 1981 size_t index_size) { 1966 1982 // Depends on cpCacheOop layout! 1967 const int shift_count = (1 + byte_no)*BitsPerByte;1968 1983 Label resolved; 1969 1984 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 } 1979 2010 1980 2011 address entry; … … 1988 2019 case Bytecodes::_invokestatic : // fall through 1989 2020 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; 1990 2024 default : ShouldNotReachHere(); break; 1991 2025 } … … 1993 2027 __ call_VM(noreg, entry, O1); 1994 2028 // 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); 1996 2033 __ bind(resolved); 1997 2034 } … … 2002 2039 Register Rflags, 2003 2040 bool is_invokevirtual, 2004 bool is_invokevfinal) { 2041 bool is_invokevfinal, 2042 bool is_invokedynamic) { 2005 2043 // Uses both G3_scratch and G4_scratch 2006 2044 Register Rcache = G3_scratch; … … 2026 2064 if (is_invokevfinal) { 2027 2065 __ 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)); 2028 2070 } 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 2033 2075 if (Ritable_index != noreg) { 2034 2076 __ ld_ptr(Rcache, index_offset, Ritable_index); … … 2111 2153 ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset(); 2112 2154 2113 resolve_cache_and_index(byte_no, Rcache, index);2155 resolve_cache_and_index(byte_no, noreg, Rcache, index, sizeof(u2)); 2114 2156 jvmti_post_field_access(Rcache, index, is_static, false); 2115 2157 load_field_cp_cache_entry(Rclass, Rcache, index, Roffset, Rflags, is_static); … … 2476 2518 ByteSize cp_base_offset = constantPoolCacheOopDesc::base_offset(); 2477 2519 2478 resolve_cache_and_index(byte_no, Rcache, index);2520 resolve_cache_and_index(byte_no, noreg, Rcache, index, sizeof(u2)); 2479 2521 jvmti_post_field_mod(Rcache, index, is_static); 2480 2522 load_field_cp_cache_entry(Rclass, Rcache, index, Roffset, Rflags, is_static); … … 2743 2785 Register Rreceiver = Lscratch; 2744 2786 2745 __ ld_ptr(Llocals, Interpreter::value_offset_in_bytes(), Rreceiver);2787 __ ld_ptr(Llocals, 0, Rreceiver); 2746 2788 2747 2789 // access constant pool cache (is resolved) … … 2817 2859 void TemplateTable::invokevirtual(int byte_no) { 2818 2860 transition(vtos, vtos); 2861 assert(byte_no == f2_byte, "use this argument"); 2819 2862 2820 2863 Register Rscratch = G3_scratch; … … 2824 2867 Label notFinal; 2825 2868 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); 2827 2870 __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore 2828 2871 … … 2865 2908 void TemplateTable::fast_invokevfinal(int byte_no) { 2866 2909 transition(vtos, vtos); 2910 assert(byte_no == f2_byte, "use this argument"); 2867 2911 2868 2912 load_invoke_cp_cache_entry(byte_no, G5_method, noreg, Lscratch, true, 2869 /*is_invokevfinal*/true );2913 /*is_invokevfinal*/true, false); 2870 2914 __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore 2871 2915 invokevfinal_helper(G3_scratch, Lscratch); … … 2902 2946 void TemplateTable::invokespecial(int byte_no) { 2903 2947 transition(vtos, vtos); 2948 assert(byte_no == f1_byte, "use this argument"); 2904 2949 2905 2950 Register Rscratch = G3_scratch; … … 2907 2952 Register Rret = Lscratch; 2908 2953 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); 2910 2955 __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore 2911 2956 … … 2935 2980 void TemplateTable::invokestatic(int byte_no) { 2936 2981 transition(vtos, vtos); 2982 assert(byte_no == f1_byte, "use this argument"); 2937 2983 2938 2984 Register Rscratch = G3_scratch; … … 2940 2986 Register Rret = Lscratch; 2941 2987 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); 2943 2989 __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore 2944 2990 … … 2993 3039 void TemplateTable::invokeinterface(int byte_no) { 2994 3040 transition(vtos, vtos); 3041 assert(byte_no == f1_byte, "use this argument"); 2995 3042 2996 3043 Register Rscratch = G4_scratch; … … 3002 3049 assert_different_registers(Rscratch, G5_method); 3003 3050 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); 3005 3052 __ mov(SP, O5_savedSP); // record SP that we wanted the callee to restore 3006 3053 … … 3119 3166 void TemplateTable::invokedynamic(int byte_no) { 3120 3167 transition(vtos, vtos); 3168 assert(byte_no == f1_oop, "use this argument"); 3121 3169 3122 3170 if (!EnableInvokeDynamic) { … … 3131 3179 } 3132 3180 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); 3134 3217 } 3135 3218 … … 3154 3237 __ get_cpool_and_tags(Rscratch, G3_scratch); 3155 3238 // 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) 3156 3241 __ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch); 3157 3242 __ ldub(G3_scratch, Roffset, G3_scratch); … … 3159 3244 __ br(Assembler::notEqual, false, Assembler::pn, slow_case); 3160 3245 __ delayed()->sll(Roffset, LogBytesPerWord, Roffset); 3161 3246 // get instanceKlass 3162 3247 //__ sll(Roffset, LogBytesPerWord, Roffset); // executed in delay slot 3163 3248 __ add(Roffset, sizeof(constantPoolOopDesc), Roffset); … … 3650 3735 // put ndims * wordSize into Lscratch 3651 3736 __ ldub( Lbcp, 3, Lscratch); 3652 __ sll( Lscratch, Interpreter::logStackElementSize (), Lscratch);3737 __ sll( Lscratch, Interpreter::logStackElementSize, Lscratch); 3653 3738 // Lesp points past last_dim, so set to O1 to first_dim address 3654 3739 __ add( Lesp, Lscratch, O1); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2001, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ … … 66 66 } 67 67 #ifdef _LP64 68 // Single issue niagara1 is slower for CompressedOops69 // 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 }75 68 // 32-bit oops don't make sense for the 64-bit VM on sparc 76 69 // since the 32-bit VM has the same registers and smaller objects. … … 87 80 FLAG_SET_DEFAULT(InteriorEntryAlignment, 4); 88 81 } 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 89 97 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) { 90 98 FLAG_SET_DEFAULT(OptoLoopAlignment, 4); 91 99 } 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 } 97 106 } 98 107 … … 103 112 } 104 113 } 114 115 #ifdef COMPILER2 116 // Currently not supported anywhere. 117 FLAG_SET_DEFAULT(UseFPUForSpilling, false); 118 #endif 105 119 106 120 char buf[512]; -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
r2 r278 1 1 /* 2 * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
r2 r278 1 1 /* 2 * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */ -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
r2 r278 1 1 /* 2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.2 * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 18 * 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 or21 * have anyquestions.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. 22 22 * 23 23 */
Note:
See TracChangeset
for help on using the changeset viewer.
