Changeset 309 for trunk/openjdk/hotspot/src/cpu/sparc
- Timestamp:
- Feb 13, 2012, 10:07:12 PM (14 years ago)
- Location:
- trunk/openjdk
- Files:
-
- 83 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk
- Property svn:mergeinfo changed
/branches/vendor/oracle/openjdk6/b24 (added) merged: 308 /branches/vendor/oracle/openjdk6/current merged: 307
- Property svn:mergeinfo changed
-
trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_assembler_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "gc_interface/collectedHeap.inline.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "memory/cardTableModRefBS.hpp" 31 #include "memory/resourceArea.hpp" 32 #include "prims/methodHandles.hpp" 33 #include "runtime/biasedLocking.hpp" 34 #include "runtime/interfaceSupport.hpp" 35 #include "runtime/objectMonitor.hpp" 36 #include "runtime/os.hpp" 37 #include "runtime/sharedRuntime.hpp" 38 #include "runtime/stubRoutines.hpp" 39 #ifndef SERIALGC 40 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 41 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 42 #include "gc_implementation/g1/heapRegion.hpp" 43 #endif 27 44 28 45 // Convert the raw encoding form into the form expected by the … … 894 911 // Save & restore possible 64-bit Long arguments in G-regs 895 912 sllx(L0,32,G2); // Move old high G1 bits high in G2 896 s llx(G1, 0,G1);// Clear current high G1 bits913 srl(G1, 0,G1); // Clear current high G1 bits 897 914 or3 (G1,G2,G1); // Recover 64-bit G1 898 915 sllx(L6,32,G2); // Move old high G4 bits high in G2 899 s llx(G4, 0,G4);// Clear current high G4 bits916 srl(G4, 0,G4); // Clear current high G4 bits 900 917 or3 (G4,G2,G4); // Recover 64-bit G4 901 918 #endif … … 1312 1329 1313 1330 1314 int MacroAssembler:: size_of_sethi(address a, bool worst_case) {1331 int MacroAssembler::insts_for_sethi(address a, bool worst_case) { 1315 1332 #ifdef _LP64 1316 if (worst_case) return 7;1317 intptr_t iaddr = (intptr_t) a;1318 int hi32 = (int)(iaddr >> 32);1319 int l o32 = (int)(iaddr);1320 int inst_count;1321 if ( hi32 == 0 && lo32 >= 0)1322 inst_count = 1;1323 else if ( hi32 == -1)1324 inst_count = 2;1333 if (worst_case) return 7; 1334 intptr_t iaddr = (intptr_t) a; 1335 int msb32 = (int) (iaddr >> 32); 1336 int lsb32 = (int) (iaddr); 1337 int count; 1338 if (msb32 == 0 && lsb32 >= 0) 1339 count = 1; 1340 else if (msb32 == -1) 1341 count = 2; 1325 1342 else { 1326 inst_count = 2;1327 if ( hi32 & 0x3ff)1328 inst_count++;1329 if ( lo32 & 0xFFFFFC00 ) {1330 if ( (lo32 >> 20) & 0xfff ) inst_count += 2;1331 if ( (lo32 >> 10) & 0x3ff ) inst_count += 2;1343 count = 2; 1344 if (msb32 & 0x3ff) 1345 count++; 1346 if (lsb32 & 0xFFFFFC00 ) { 1347 if ((lsb32 >> 20) & 0xfff) count += 2; 1348 if ((lsb32 >> 10) & 0x3ff) count += 2; 1332 1349 } 1333 1350 } 1334 return BytesPerInstWord * inst_count;1351 return count; 1335 1352 #else 1336 return BytesPerInstWord;1353 return 1; 1337 1354 #endif 1338 1355 } 1339 1356 1340 int MacroAssembler::worst_case_size_of_set() { 1341 return size_of_sethi(NULL, true) + 1; 1342 } 1343 1344 1357 int MacroAssembler::worst_case_insts_for_set() { 1358 return insts_for_sethi(NULL, true) + 1; 1359 } 1360 1361 1362 // Keep in sync with MacroAssembler::insts_for_internal_set 1345 1363 void MacroAssembler::internal_set(const AddressLiteral& addrlit, Register d, bool ForceRelocatable) { 1346 1364 intptr_t value = addrlit.value(); … … 1364 1382 } 1365 1383 1384 // Keep in sync with MacroAssembler::internal_set 1385 int MacroAssembler::insts_for_internal_set(intptr_t value) { 1386 // can optimize 1387 if (-4096 <= value && value <= 4095) { 1388 return 1; 1389 } 1390 if (inv_hi22(hi22(value)) == value) { 1391 return insts_for_sethi((address) value); 1392 } 1393 int count = insts_for_sethi((address) value); 1394 AddressLiteral al(value); 1395 if (al.low10() != 0) { 1396 count++; 1397 } 1398 return count; 1399 } 1400 1366 1401 void MacroAssembler::set(const AddressLiteral& al, Register d) { 1367 1402 internal_set(al, d, false); … … 1426 1461 or3 (d, tmp, d); 1427 1462 } 1463 } 1464 1465 int MacroAssembler::insts_for_set64(jlong value) { 1466 v9_dep(); 1467 1468 int hi = (int) (value >> 32); 1469 int lo = (int) (value & ~0); 1470 int count = 0; 1471 1472 // (Matcher::isSimpleConstant64 knows about the following optimizations.) 1473 if (Assembler::is_simm13(lo) && value == lo) { 1474 count++; 1475 } else if (hi == 0) { 1476 count++; 1477 if (low10(lo) != 0) 1478 count++; 1479 } 1480 else if (hi == -1) { 1481 count += 2; 1482 } 1483 else if (lo == 0) { 1484 if (Assembler::is_simm13(hi)) { 1485 count++; 1486 } else { 1487 count++; 1488 if (low10(hi) != 0) 1489 count++; 1490 } 1491 count++; 1492 } 1493 else { 1494 count += 2; 1495 if (low10(hi) != 0) 1496 count++; 1497 if (low10(lo) != 0) 1498 count++; 1499 count += 2; 1500 } 1501 return count; 1428 1502 } 1429 1503 … … 3095 3169 Register temp_reg, 3096 3170 Label& wrong_method_type) { 3097 if (UseCompressedOops) unimplemented("coop"); // field accesses must decode3098 3171 assert_different_registers(mtype_reg, mh_reg, temp_reg); 3099 3172 // compare method type against that of the receiver 3100 3173 RegisterOrConstant mhtype_offset = delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg); 3101 l d_ptr(mh_reg, mhtype_offset, temp_reg);3174 load_heap_oop(mh_reg, mhtype_offset, temp_reg); 3102 3175 cmp(temp_reg, mtype_reg); 3103 3176 br(Assembler::notEqual, false, Assembler::pn, wrong_method_type); … … 3113 3186 Register temp_reg) { 3114 3187 assert_different_registers(vmslots_reg, mh_reg, temp_reg); 3115 if (UseCompressedOops) unimplemented("coop"); // field accesses must decode3116 3188 // load mh.type.form.vmslots 3117 3189 if (java_dyn_MethodHandle::vmslots_offset_in_bytes() != 0) { 3118 3190 // 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);3191 ld( Address(mh_reg, delayed_value(java_dyn_MethodHandle::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); 3120 3192 } else { 3121 3193 Register temp2_reg = vmslots_reg; 3122 l d_ptr(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg);3123 l d_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);3194 load_heap_oop(Address(mh_reg, delayed_value(java_dyn_MethodHandle::type_offset_in_bytes, temp_reg)), temp2_reg); 3195 load_heap_oop(Address(temp2_reg, delayed_value(java_dyn_MethodType::form_offset_in_bytes, temp_reg)), temp2_reg); 3196 ld( Address(temp2_reg, delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, temp_reg)), vmslots_reg); 3125 3197 } 3126 3198 } … … 3131 3203 assert_different_registers(mh_reg, temp_reg); 3132 3204 3133 if (UseCompressedOops) unimplemented("coop"); // field accesses must decode3134 3135 3205 // pick out the interpreted side of the handler 3206 // NOTE: vmentry is not an oop! 3136 3207 ld_ptr(mh_reg, delayed_value(java_dyn_MethodHandle::vmentry_offset_in_bytes, temp_reg), temp_reg); 3137 3208 … … 4032 4103 verify_oop(top); 4033 4104 4105 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t1); 4106 sub(top, t1, t1); // size of tlab's allocated portion 4107 incr_allocated_bytes(t1, t2, t3); 4108 4034 4109 // refill the tlab with an eden allocation 4035 4110 bind(do_refill); 4036 4111 ld_ptr(G2_thread, in_bytes(JavaThread::tlab_size_offset()), t1); 4037 4112 sll_ptr(t1, LogHeapWordSize, t1); 4038 // a dd object_size ??4113 // allocate new tlab, address returned in top 4039 4114 eden_allocate(top, t1, 0, t2, t3, slow_case); 4040 4115 … … 4062 4137 br(Assembler::always, false, Assembler::pt, retry); 4063 4138 delayed()->nop(); 4139 } 4140 4141 void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, 4142 Register t1, Register t2) { 4143 // Bump total bytes allocated by this thread 4144 assert(t1->is_global(), "must be global reg"); // so all 64 bits are saved on a context switch 4145 assert_different_registers(size_in_bytes.register_or_noreg(), t1, t2); 4146 // v8 support has gone the way of the dodo 4147 ldx(G2_thread, in_bytes(JavaThread::allocated_bytes_offset()), t1); 4148 add(t1, ensure_simm13_or_reg(size_in_bytes, t2), t1); 4149 stx(t1, G2_thread, in_bytes(JavaThread::allocated_bytes_offset())); 4064 4150 } 4065 4151 … … 4193 4279 static void generate_satb_log_enqueue(bool with_frame) { 4194 4280 BufferBlob* bb = BufferBlob::create("enqueue_with_frame", EnqueueCodeSize); 4195 CodeBuffer buf(bb ->instructions_begin(), bb->instructions_size());4281 CodeBuffer buf(bb); 4196 4282 MacroAssembler masm(&buf); 4197 4283 address start = masm.pc(); … … 4422 4508 static void generate_dirty_card_log_enqueue(jbyte* byte_map_base) { 4423 4509 BufferBlob* bb = BufferBlob::create("dirty_card_enqueue", EnqueueCodeSize*2); 4424 CodeBuffer buf(bb ->instructions_begin(), bb->instructions_size());4510 CodeBuffer buf(bb); 4425 4511 MacroAssembler masm(&buf); 4426 4512 address start = masm.pc(); … … 4654 4740 } 4655 4741 4742 void MacroAssembler::load_heap_oop(Register s1, RegisterOrConstant s2, Register d) { 4743 if (s2.is_constant()) load_heap_oop(s1, s2.as_constant(), d); 4744 else load_heap_oop(s1, s2.as_register(), d); 4745 } 4746 4656 4747 void MacroAssembler::store_heap_oop(Register d, Register s1, Register s2) { 4657 4748 if (UseCompressedOops) { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_HPP 26 #define CPU_SPARC_VM_ASSEMBLER_SPARC_HPP 24 27 25 28 class BiasedLockingCounters; … … 821 824 822 825 // test if x is within signed immediate range for nbits 823 static bool is_simm(int x, int nbits) { return -( 1 << nbits-1 ) <= x && x < ( 1<< nbits-1 ); }826 static bool is_simm(intptr_t x, int nbits) { return -( intptr_t(1) << nbits-1 ) <= x && x < ( intptr_t(1) << nbits-1 ); } 824 827 825 828 // test if -4096 <= x <= 4095 826 static bool is_simm13(int x) { return is_simm(x, 13); } 829 static bool is_simm13(intptr_t x) { return is_simm(x, 13); } 830 831 static bool is_in_wdisp_range(address a, address b, int nbits) { 832 intptr_t d = intptr_t(b) - intptr_t(a); 833 return is_simm(d, nbits + 2); 834 } 835 836 // test if label is in simm16 range in words (wdisp16). 837 bool is_in_wdisp16_range(Label& L) { 838 return is_in_wdisp_range(target(L), pc(), 16); 839 } 840 // test if the distance between two addresses fits in simm30 range in words 841 static bool is_in_wdisp30_range(address a, address b) { 842 return is_in_wdisp_range(a, b, 30); 843 } 827 844 828 845 enum ASIs { // page 72, v9 … … 1121 1138 inline void add(Register s1, int simm13a, Register d, RelocationHolder const& rspec); 1122 1139 inline void add(Register s1, RegisterOrConstant s2, Register d, int offset = 0); 1123 inline void add(const Address& a, Register d, int offset = 0) { add( a.base(), a.disp() + offset, d, a.rspec(offset)); }1140 inline void add(const Address& a, Register d, int offset = 0); 1124 1141 1125 1142 void addcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } … … 1613 1630 void sub( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); } 1614 1631 void sub( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } 1632 1633 // Note: offset is added to s2. 1634 inline void sub(Register s1, RegisterOrConstant s2, Register d, int offset = 0); 1635 1615 1636 void subcc( Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); } 1616 1637 void subcc( Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } … … 1790 1811 inline void br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); 1791 1812 inline void br( Condition c, bool a, Predict p, Label& L ); 1813 1792 1814 inline void fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt = relocInfo::none ); 1793 1815 inline void fb( Condition c, bool a, Predict p, Label& L ); … … 1830 1852 inline void jmp( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() ); 1831 1853 1854 // Check if the call target is out of wdisp30 range (relative to the code cache) 1855 static inline bool is_far_target(address d); 1832 1856 inline void call( address d, relocInfo::relocType rt = relocInfo::runtime_call_type ); 1833 1857 inline void call( Label& L, relocInfo::relocType rt = relocInfo::runtime_call_type ); … … 1871 1895 void patchable_sethi(const AddressLiteral& addrlit, Register d); 1872 1896 1873 // compute the size ofa sethi/set1874 static int size_of_sethi( address a, bool worst_case = false );1875 static int worst_case_ size_of_set();1897 // compute the number of instructions for a sethi/set 1898 static int insts_for_sethi( address a, bool worst_case = false ); 1899 static int worst_case_insts_for_set(); 1876 1900 1877 1901 // set may be either setsw or setuw (high 32 bits may be zero or sign) 1878 1902 private: 1879 1903 void internal_set(const AddressLiteral& al, Register d, bool ForceRelocatable); 1904 static int insts_for_internal_set(intptr_t value); 1880 1905 public: 1881 1906 void set(const AddressLiteral& addrlit, Register d); 1882 1907 void set(intptr_t value, Register d); 1883 1908 void set(address addr, Register d, RelocationHolder const& rspec); 1909 static int insts_for_set(intptr_t value) { return insts_for_internal_set(value); } 1910 1884 1911 void patchable_set(const AddressLiteral& addrlit, Register d); 1885 1912 void patchable_set(intptr_t value, Register d); 1886 1913 void set64(jlong value, Register d, Register tmp); 1914 static int insts_for_set64(jlong value); 1887 1915 1888 1916 // sign-extend 32 to 64 … … 2104 2132 void load_heap_oop(Register s1, Register s2, Register d); 2105 2133 void load_heap_oop(Register s1, int simm13a, Register d); 2134 void load_heap_oop(Register s1, RegisterOrConstant s2, Register d); 2106 2135 void store_heap_oop(Register d, Register s1, Register s2); 2107 2136 void store_heap_oop(Register d, Register s1, int simm13a); … … 2226 2255 void warn(const char* msg); // prints msg, but don't stop 2227 2256 void untested(const char* what = ""); 2228 void unimplemented(const char* what = "") { char* b = new char[1024]; sprintf(b, "unimplemented: %s", what); stop(b); }2257 void unimplemented(const char* what = "") { char* b = new char[1024]; jio_snprintf(b, 1024, "unimplemented: %s", what); stop(b); } 2229 2258 void should_not_reach_here() { stop("should not reach here"); } 2230 2259 void print_CPU_state(); … … 2371 2400 ); 2372 2401 void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); 2402 void incr_allocated_bytes(RegisterOrConstant size_in_bytes, 2403 Register t1, Register t2); 2373 2404 2374 2405 // interface method calling … … 2494 2525 inline bool AbstractAssembler::pd_check_instruction_mark() { return false; } 2495 2526 #endif 2527 2528 #endif // CPU_SPARC_VM_ASSEMBLER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP 26 #define CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP 27 28 #include "asm/assembler.inline.hpp" 29 #include "asm/codeBuffer.hpp" 30 #include "code/codeCache.hpp" 31 #include "runtime/handles.inline.hpp" 32 25 33 inline void MacroAssembler::pd_patch_instruction(address branch, address target) { 26 34 jint& stub_inst = *(jint*) branch; … … 207 215 208 216 // form effective addresses this way: 217 inline void Assembler::add(const Address& a, Register d, int offset) { 218 if (a.has_index()) add(a.base(), a.index(), d); 219 else { add(a.base(), a.disp() + offset, d, a.rspec(offset)); offset = 0; } 220 if (offset != 0) add(d, offset, d); 221 } 209 222 inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { 210 223 if (s2.is_register()) add(s1, s2.as_register(), d); … … 316 329 inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } 317 330 331 inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int offset) { 332 if (s2.is_register()) sub(s1, s2.as_register(), d); 333 else { sub(s1, s2.as_constant() + offset, d); offset = 0; } 334 if (offset != 0) sub(d, offset, d); 335 } 318 336 319 337 // pp 231 … … 571 589 inline void MacroAssembler::jmp( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, G0, rspec); } 572 590 591 inline bool MacroAssembler::is_far_target(address d) { 592 return !is_in_wdisp30_range(d, CodeCache::low_bound()) || !is_in_wdisp30_range(d, CodeCache::high_bound()); 593 } 594 573 595 // Call with a check to see if we need to deal with the added 574 596 // expense of relocation and if we overflow the displacement 575 // of the quick call instruction./ 576 // Check to see if we have to deal with relocations 597 // of the quick call instruction. 577 598 inline void MacroAssembler::call( address d, relocInfo::relocType rt ) { 578 599 #ifdef _LP64 … … 586 607 // Is this address within range of the call instruction? 587 608 // If not, use the expensive instruction sequence 588 disp = (intptr_t)d - (intptr_t)pc(); 589 if ( disp != (intptr_t)(int32_t)disp ) { 609 if (is_far_target(d)) { 590 610 relocate(rt); 591 611 AddressLiteral dest(d); 592 612 jumpl_to(dest, O7, O7); 593 } 594 else { 595 Assembler::call( d, rt ); 613 } else { 614 Assembler::call(d, rt); 596 615 } 597 616 #else … … 818 837 } 819 838 } 839 840 #endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "interp_masm_sparc.hpp" 28 #include "interpreter/bytecodeInterpreter.hpp" 29 #include "interpreter/bytecodeInterpreter.inline.hpp" 30 #include "interpreter/interpreter.hpp" 31 #include "interpreter/interpreterRuntime.hpp" 32 #include "oops/methodDataOop.hpp" 33 #include "oops/methodOop.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "prims/jvmtiExport.hpp" 36 #include "prims/jvmtiThreadState.hpp" 37 #include "runtime/deoptimization.hpp" 38 #include "runtime/frame.inline.hpp" 39 #include "runtime/sharedRuntime.hpp" 40 #include "runtime/stubRoutines.hpp" 41 #include "runtime/synchronizer.hpp" 42 #include "runtime/vframeArray.hpp" 43 #include "utilities/debug.hpp" 44 25 45 // KILL THIS FILE -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 08, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP 26 #define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP 24 27 25 28 // Platform specific for C++ based Interpreter … … 98 101 #define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ 99 102 ((VMJavaVal64*)(addr))->l) 103 104 #endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP 26 #define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP 24 27 25 28 // Inline interpreter functions for sparc … … 332 335 }; 333 336 #endif /* ALIGN_CONVERTER */ 337 338 #endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include " incls/_precompiled.incl"26 #include "in cls/_bytecodes_sparc.cpp.incl"25 #include "precompiled.hpp" 26 #include "interpreter/bytecodes.hpp" 27 27 28 28 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytecodes_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_BYTECODES_SPARC_HPP 26 #define CPU_SPARC_VM_BYTECODES_SPARC_HPP 27 25 28 #ifdef SPARC 26 29 #define NLOCALS_IN_REGS 6 … … 31 34 32 35 // (none) 36 37 #endif // CPU_SPARC_VM_BYTECODES_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/bytes_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 02, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_BYTES_SPARC_HPP 26 #define CPU_SPARC_VM_BYTES_SPARC_HPP 27 28 #include "memory/allocation.hpp" 24 29 25 30 class Bytes: AllStatic { … … 156 161 // 1.17 99/06/22 16:37:35 bytes_i486.hpp 157 162 //End 163 164 #endif // CPU_SPARC_VM_BYTES_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_CodeStubs_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_CodeStubs.hpp" 27 #include "c1/c1_FrameMap.hpp" 28 #include "c1/c1_LIRAssembler.hpp" 29 #include "c1/c1_MacroAssembler.hpp" 30 #include "c1/c1_Runtime1.hpp" 31 #include "nativeInst_sparc.hpp" 32 #include "runtime/sharedRuntime.hpp" 33 #include "vmreg_sparc.inline.hpp" 34 #ifndef SERIALGC 35 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 36 #endif 27 37 28 38 #define __ ce->masm()-> … … 33 43 , _index(index) 34 44 { 45 assert(info != NULL, "must have info"); 35 46 _info = new CodeEmitInfo(info); 36 47 } … … 58 69 } 59 70 60 #ifdef TIERED61 71 62 72 void CounterOverflowStub::emit_code(LIR_Assembler* ce) { … … 64 74 __ set(_bci, G4); 65 75 __ call(Runtime1::entry_for(Runtime1::counter_overflow_id), relocInfo::runtime_call_type); 66 __ delayed()-> nop();76 __ delayed()->mov_or_nop(_method->as_register(), G5); 67 77 ce->add_call_info_here(_info); 68 78 ce->verify_oop_map(_info); … … 72 82 } 73 83 74 #endif // TIERED75 84 76 85 void DivByZeroStub::emit_code(LIR_Assembler* ce) { … … 426 435 Register pre_val_reg = pre_val()->as_register(); 427 436 428 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false); 429 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 430 pre_val_reg, _continuation); 437 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); 438 if (__ is_in_wdisp16_range(_continuation)) { 439 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 440 pre_val_reg, _continuation); 441 } else { 442 __ cmp(pre_val_reg, G0); 443 __ brx(Assembler::equal, false, Assembler::pn, _continuation); 444 } 431 445 __ delayed()->nop(); 432 446 … … 454 468 Register addr_reg = addr()->as_pointer_register(); 455 469 Register new_val_reg = new_val()->as_register(); 456 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 457 new_val_reg, _continuation); 470 if (__ is_in_wdisp16_range(_continuation)) { 471 __ br_on_reg_cond(Assembler::rc_z, /*annul*/false, Assembler::pt, 472 new_val_reg, _continuation); 473 } else { 474 __ cmp(new_val_reg, G0); 475 __ brx(Assembler::equal, false, Assembler::pn, _continuation); 476 } 458 477 __ delayed()->nop(); 459 478 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Defs_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 09, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_C1_DEFS_SPARC_HPP 26 #define CPU_SPARC_VM_C1_DEFS_SPARC_HPP 24 27 25 28 // native word offsets from memory address (big endian) … … 66 69 pd_float_saved_as_double = false 67 70 }; 71 72 #endif // CPU_SPARC_VM_C1_DEFS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "precompiled.hpp" 26 #include "c1/c1_FpuStackSim.hpp" 27 #include "c1/c1_FrameMap.hpp" 28 #include "utilities/array.hpp" 29 #include "utilities/ostream.hpp" 30 25 31 // No FPU stack on SPARC -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FpuStackSim_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP 26 #define CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP 27 25 28 // No FPU stack on SPARC 26 29 class FpuStackSim; 30 31 #endif // CPU_SPARC_VM_C1_FPUSTACKSIM_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
r278 r309 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_c1_FrameMap_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_FrameMap.hpp" 27 #include "c1/c1_LIR.hpp" 28 #include "runtime/sharedRuntime.hpp" 29 #include "vmreg_sparc.inline.hpp" 27 30 28 31 … … 74 77 LIR_Opr FrameMap::in_long_opr; 75 78 LIR_Opr FrameMap::out_long_opr; 79 LIR_Opr FrameMap::g1_long_single_opr; 76 80 77 81 LIR_Opr FrameMap::F0_opr; … … 239 243 in_long_opr = as_long_opr(I0); 240 244 out_long_opr = as_long_opr(O0); 245 g1_long_single_opr = as_long_single_opr(G1); 241 246 242 247 G0_opr = as_opr(G0); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
r278 r309 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP 26 #define CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP 24 27 25 28 public: … … 104 107 static LIR_Opr in_long_opr; 105 108 static LIR_Opr out_long_opr; 109 static LIR_Opr g1_long_single_opr; 106 110 107 111 static LIR_Opr F0_opr; … … 114 118 static FloatRegister _fpu_regs [nof_fpu_regs]; 115 119 120 static LIR_Opr as_long_single_opr(Register r) { 121 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); 122 } 123 static LIR_Opr as_long_pair_opr(Register r) { 124 return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r)); 125 } 126 116 127 public: 117 128 118 129 #ifdef _LP64 119 130 static LIR_Opr as_long_opr(Register r) { 120 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));131 return as_long_single_opr(r); 121 132 } 122 133 static LIR_Opr as_pointer_opr(Register r) { 123 return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r));134 return as_long_single_opr(r); 124 135 } 125 136 #else 126 137 static LIR_Opr as_long_opr(Register r) { 127 return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r));138 return as_long_pair_opr(r); 128 139 } 129 140 static LIR_Opr as_pointer_opr(Register r) { … … 144 155 static bool is_caller_save_register (LIR_Opr reg); 145 156 static bool is_caller_save_register (Register r); 157 158 static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } 159 static int last_cpu_reg() { return pd_last_cpu_reg; } 160 161 #endif // CPU_SPARC_VM_C1_FRAMEMAP_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_c1_LIRAssembler_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_Compilation.hpp" 27 #include "c1/c1_LIRAssembler.hpp" 28 #include "c1/c1_MacroAssembler.hpp" 29 #include "c1/c1_Runtime1.hpp" 30 #include "c1/c1_ValueStack.hpp" 31 #include "ci/ciArrayKlass.hpp" 32 #include "ci/ciInstance.hpp" 33 #include "gc_interface/collectedHeap.hpp" 34 #include "memory/barrierSet.hpp" 35 #include "memory/cardTableModRefBS.hpp" 36 #include "nativeInst_sparc.hpp" 37 #include "oops/objArrayKlass.hpp" 38 #include "runtime/sharedRuntime.hpp" 27 39 28 40 #define __ _masm-> … … 87 99 ((src->is_double_fpu() || dst->is_double_fpu()) && op1->move_kind() != lir_move_normal)) { 88 100 return false; 101 } 102 103 if (UseCompressedOops) { 104 if (dst->is_address() && !dst->is_stack() && (dst->type() == T_OBJECT || dst->type() == T_ARRAY)) return false; 105 if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false; 89 106 } 90 107 … … 242 259 int count_offset = java_lang_String:: count_offset_in_bytes(); 243 260 244 __ l d_ptr(str0, value_offset, tmp0);261 __ load_heap_oop(str0, value_offset, tmp0); 245 262 __ ld(str0, offset_offset, tmp2); 246 263 __ add(tmp0, arrayOopDesc::base_offset_in_bytes(T_CHAR), tmp0); … … 251 268 add_debug_info_for_null_check_here(info); 252 269 253 __ l d_ptr(str1, value_offset, tmp1);270 __ load_heap_oop(str1, value_offset, tmp1); 254 271 __ add(tmp0, tmp2, tmp0); 255 272 … … 755 772 void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) { 756 773 add_debug_info_for_null_check_here(op->info()); 757 __ l d_ptr(O0, oopDesc::klass_offset_in_bytes(), G3_scratch);774 __ load_klass(O0, G3_scratch); 758 775 if (__ is_simm13(op->vtable_offset())) { 759 776 __ ld_ptr(G3_scratch, op->vtable_offset(), G5_method); … … 769 786 } 770 787 771 772 // load with 32-bit displacement 773 int LIR_Assembler::load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo *info) { 774 int load_offset = code_offset(); 775 if (Assembler::is_simm13(disp)) { 776 if (info != NULL) add_debug_info_for_null_check_here(info); 777 switch(ld_type) { 778 case T_BOOLEAN: // fall through 779 case T_BYTE : __ ldsb(s, disp, d); break; 780 case T_CHAR : __ lduh(s, disp, d); break; 781 case T_SHORT : __ ldsh(s, disp, d); break; 782 case T_INT : __ ld(s, disp, d); break; 783 case T_ADDRESS:// fall through 784 case T_ARRAY : // fall through 785 case T_OBJECT: __ ld_ptr(s, disp, d); break; 786 default : ShouldNotReachHere(); 787 } 788 } else { 789 __ set(disp, O7); 790 if (info != NULL) add_debug_info_for_null_check_here(info); 791 load_offset = code_offset(); 792 switch(ld_type) { 793 case T_BOOLEAN: // fall through 794 case T_BYTE : __ ldsb(s, O7, d); break; 795 case T_CHAR : __ lduh(s, O7, d); break; 796 case T_SHORT : __ ldsh(s, O7, d); break; 797 case T_INT : __ ld(s, O7, d); break; 798 case T_ADDRESS:// fall through 799 case T_ARRAY : // fall through 800 case T_OBJECT: __ ld_ptr(s, O7, d); break; 801 default : ShouldNotReachHere(); 802 } 803 } 804 if (ld_type == T_ARRAY || ld_type == T_OBJECT) __ verify_oop(d); 805 return load_offset; 806 } 807 808 809 // store with 32-bit displacement 810 void LIR_Assembler::store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info) { 811 if (Assembler::is_simm13(offset)) { 812 if (info != NULL) add_debug_info_for_null_check_here(info); 813 switch (type) { 814 case T_BOOLEAN: // fall through 815 case T_BYTE : __ stb(value, base, offset); break; 816 case T_CHAR : __ sth(value, base, offset); break; 817 case T_SHORT : __ sth(value, base, offset); break; 818 case T_INT : __ stw(value, base, offset); break; 819 case T_ADDRESS:// fall through 820 case T_ARRAY : // fall through 821 case T_OBJECT: __ st_ptr(value, base, offset); break; 822 default : ShouldNotReachHere(); 823 } 824 } else { 825 __ set(offset, O7); 826 if (info != NULL) add_debug_info_for_null_check_here(info); 827 switch (type) { 828 case T_BOOLEAN: // fall through 829 case T_BYTE : __ stb(value, base, O7); break; 830 case T_CHAR : __ sth(value, base, O7); break; 831 case T_SHORT : __ sth(value, base, O7); break; 832 case T_INT : __ stw(value, base, O7); break; 833 case T_ADDRESS:// fall through 834 case T_ARRAY : //fall through 835 case T_OBJECT: __ st_ptr(value, base, O7); break; 836 default : ShouldNotReachHere(); 837 } 838 } 839 // Note: Do the store before verification as the code might be patched! 840 if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(value); 841 } 842 843 844 // load float with 32-bit displacement 845 void LIR_Assembler::load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) { 846 FloatRegisterImpl::Width w; 847 switch(ld_type) { 848 case T_FLOAT : w = FloatRegisterImpl::S; break; 849 case T_DOUBLE: w = FloatRegisterImpl::D; break; 850 default : ShouldNotReachHere(); 851 } 852 853 if (Assembler::is_simm13(disp)) { 854 if (info != NULL) add_debug_info_for_null_check_here(info); 855 if (disp % BytesPerLong != 0 && w == FloatRegisterImpl::D) { 856 __ ldf(FloatRegisterImpl::S, s, disp + BytesPerWord, d->successor()); 857 __ ldf(FloatRegisterImpl::S, s, disp , d); 858 } else { 859 __ ldf(w, s, disp, d); 860 } 861 } else { 862 __ set(disp, O7); 863 if (info != NULL) add_debug_info_for_null_check_here(info); 864 __ ldf(w, s, O7, d); 865 } 866 } 867 868 869 // store float with 32-bit displacement 870 void LIR_Assembler::store(FloatRegister value, Register base, int offset, BasicType type, CodeEmitInfo *info) { 871 FloatRegisterImpl::Width w; 872 switch(type) { 873 case T_FLOAT : w = FloatRegisterImpl::S; break; 874 case T_DOUBLE: w = FloatRegisterImpl::D; break; 875 default : ShouldNotReachHere(); 876 } 877 878 if (Assembler::is_simm13(offset)) { 879 if (info != NULL) add_debug_info_for_null_check_here(info); 880 if (w == FloatRegisterImpl::D && offset % BytesPerLong != 0) { 881 __ stf(FloatRegisterImpl::S, value->successor(), base, offset + BytesPerWord); 882 __ stf(FloatRegisterImpl::S, value , base, offset); 883 } else { 884 __ stf(w, value, base, offset); 885 } 886 } else { 887 __ set(offset, O7); 888 if (info != NULL) add_debug_info_for_null_check_here(info); 889 __ stf(w, value, O7, base); 890 } 891 } 892 893 894 int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned) { 788 int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) { 895 789 int store_offset; 896 790 if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) { … … 898 792 // for offsets larger than a simm13 we setup the offset in O7 899 793 __ set(offset, O7); 900 store_offset = store(from_reg, base, O7, type); 901 } else { 902 if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register()); 794 store_offset = store(from_reg, base, O7, type, wide); 795 } else { 796 if (type == T_ARRAY || type == T_OBJECT) { 797 __ verify_oop(from_reg->as_register()); 798 } 903 799 store_offset = code_offset(); 904 800 switch (type) { … … 923 819 #endif 924 820 break; 925 case T_ADDRESS:// fall through 821 case T_ADDRESS: 822 __ st_ptr(from_reg->as_register(), base, offset); 823 break; 926 824 case T_ARRAY : // fall through 927 case T_OBJECT: __ st_ptr(from_reg->as_register(), base, offset); break; 825 case T_OBJECT: 826 { 827 if (UseCompressedOops && !wide) { 828 __ encode_heap_oop(from_reg->as_register(), G3_scratch); 829 store_offset = code_offset(); 830 __ stw(G3_scratch, base, offset); 831 } else { 832 __ st_ptr(from_reg->as_register(), base, offset); 833 } 834 break; 835 } 836 928 837 case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, offset); break; 929 838 case T_DOUBLE: … … 947 856 948 857 949 int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type) { 950 if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(from_reg->as_register()); 858 int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) { 859 if (type == T_ARRAY || type == T_OBJECT) { 860 __ verify_oop(from_reg->as_register()); 861 } 951 862 int store_offset = code_offset(); 952 863 switch (type) { … … 964 875 #endif 965 876 break; 966 case T_ADDRESS:// fall through 877 case T_ADDRESS: 878 __ st_ptr(from_reg->as_register(), base, disp); 879 break; 967 880 case T_ARRAY : // fall through 968 case T_OBJECT: __ st_ptr(from_reg->as_register(), base, disp); break; 881 case T_OBJECT: 882 { 883 if (UseCompressedOops && !wide) { 884 __ encode_heap_oop(from_reg->as_register(), G3_scratch); 885 store_offset = code_offset(); 886 __ stw(G3_scratch, base, disp); 887 } else { 888 __ st_ptr(from_reg->as_register(), base, disp); 889 } 890 break; 891 } 969 892 case T_FLOAT : __ stf(FloatRegisterImpl::S, from_reg->as_float_reg(), base, disp); break; 970 893 case T_DOUBLE: __ stf(FloatRegisterImpl::D, from_reg->as_double_reg(), base, disp); break; … … 975 898 976 899 977 int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned) {900 int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) { 978 901 int load_offset; 979 902 if (!Assembler::is_simm13(offset + (type == T_LONG) ? wordSize : 0)) { … … 982 905 // for offsets larger than a simm13 we setup the offset in O7 983 906 __ set(offset, O7); 984 load_offset = load(base, O7, to_reg, type );907 load_offset = load(base, O7, to_reg, type, wide); 985 908 } else { 986 909 load_offset = code_offset(); … … 1019 942 } 1020 943 break; 1021 case T_ADDRESS: // fall through944 case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break; 1022 945 case T_ARRAY : // fall through 1023 case T_OBJECT: __ ld_ptr(base, offset, to_reg->as_register()); break; 946 case T_OBJECT: 947 { 948 if (UseCompressedOops && !wide) { 949 __ lduw(base, offset, to_reg->as_register()); 950 __ decode_heap_oop(to_reg->as_register()); 951 } else { 952 __ ld_ptr(base, offset, to_reg->as_register()); 953 } 954 break; 955 } 1024 956 case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, offset, to_reg->as_float_reg()); break; 1025 957 case T_DOUBLE: … … 1037 969 default : ShouldNotReachHere(); 1038 970 } 1039 if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register()); 971 if (type == T_ARRAY || type == T_OBJECT) { 972 __ verify_oop(to_reg->as_register()); 973 } 1040 974 } 1041 975 return load_offset; … … 1043 977 1044 978 1045 int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type ) {979 int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide) { 1046 980 int load_offset = code_offset(); 1047 981 switch(type) { 1048 982 case T_BOOLEAN: // fall through 1049 case T_BYTE : __ ldsb(base, disp, to_reg->as_register()); break;1050 case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break;1051 case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break;1052 case T_INT : __ ld(base, disp, to_reg->as_register()); break;1053 case T_ADDRESS: // fall through983 case T_BYTE : __ ldsb(base, disp, to_reg->as_register()); break; 984 case T_CHAR : __ lduh(base, disp, to_reg->as_register()); break; 985 case T_SHORT : __ ldsh(base, disp, to_reg->as_register()); break; 986 case T_INT : __ ld(base, disp, to_reg->as_register()); break; 987 case T_ADDRESS: __ ld_ptr(base, disp, to_reg->as_register()); break; 1054 988 case T_ARRAY : // fall through 1055 case T_OBJECT: __ ld_ptr(base, disp, to_reg->as_register()); break; 989 case T_OBJECT: 990 { 991 if (UseCompressedOops && !wide) { 992 __ lduw(base, disp, to_reg->as_register()); 993 __ decode_heap_oop(to_reg->as_register()); 994 } else { 995 __ ld_ptr(base, disp, to_reg->as_register()); 996 } 997 break; 998 } 1056 999 case T_FLOAT: __ ldf(FloatRegisterImpl::S, base, disp, to_reg->as_float_reg()); break; 1057 1000 case T_DOUBLE: __ ldf(FloatRegisterImpl::D, base, disp, to_reg->as_double_reg()); break; … … 1067 1010 default : ShouldNotReachHere(); 1068 1011 } 1069 if (type == T_ARRAY || type == T_OBJECT) __ verify_oop(to_reg->as_register()); 1012 if (type == T_ARRAY || type == T_OBJECT) { 1013 __ verify_oop(to_reg->as_register()); 1014 } 1070 1015 return load_offset; 1071 1016 } 1072 1073 1074 // load/store with an Address1075 void LIR_Assembler::load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo *info, int offset) {1076 load(a.base(), a.disp() + offset, d, ld_type, info);1077 }1078 1079 1080 void LIR_Assembler::store(Register value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {1081 store(value, dest.base(), dest.disp() + offset, type, info);1082 }1083 1084 1085 // loadf/storef with an Address1086 void LIR_Assembler::load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info, int offset) {1087 load(a.base(), a.disp() + offset, d, ld_type, info);1088 }1089 1090 1091 void LIR_Assembler::store(FloatRegister value, const Address& dest, BasicType type, CodeEmitInfo *info, int offset) {1092 store(value, dest.base(), dest.disp() + offset, type, info);1093 }1094 1095 1096 // load/store with an Address1097 void LIR_Assembler::load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo *info) {1098 load(as_Address(a), d, ld_type, info);1099 }1100 1101 1102 void LIR_Assembler::store(Register value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {1103 store(value, as_Address(dest), type, info);1104 }1105 1106 1107 // loadf/storef with an Address1108 void LIR_Assembler::load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo *info) {1109 load(as_Address(a), d, ld_type, info);1110 }1111 1112 1113 void LIR_Assembler::store(FloatRegister value, LIR_Address* dest, BasicType type, CodeEmitInfo *info) {1114 store(value, as_Address(dest), type, info);1115 }1116 1117 1017 1118 1018 void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { … … 1120 1020 switch (c->type()) { 1121 1021 case T_INT: 1122 case T_FLOAT: 1022 case T_FLOAT: { 1023 Register src_reg = O7; 1024 int value = c->as_jint_bits(); 1025 if (value == 0) { 1026 src_reg = G0; 1027 } else { 1028 __ set(value, O7); 1029 } 1030 Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); 1031 __ stw(src_reg, addr.base(), addr.disp()); 1032 break; 1033 } 1123 1034 case T_ADDRESS: { 1124 1035 Register src_reg = O7; … … 1130 1041 } 1131 1042 Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); 1132 __ st w(src_reg, addr.base(), addr.disp());1043 __ st_ptr(src_reg, addr.base(), addr.disp()); 1133 1044 break; 1134 1045 } … … 1167 1078 1168 1079 1169 void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info 1080 void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) { 1170 1081 LIR_Const* c = src->as_constant_ptr(); 1171 1082 LIR_Address* addr = dest->as_address_ptr(); 1172 1083 Register base = addr->base()->as_pointer_register(); 1173 1174 if (info != NULL) { 1175 add_debug_info_for_null_check_here(info); 1176 } 1084 int offset = -1; 1085 1177 1086 switch (c->type()) { 1178 1087 case T_INT: … … 1188 1097 if (addr->index()->is_valid()) { 1189 1098 assert(addr->disp() == 0, "must be zero"); 1190 store(tmp, base, addr->index()->as_pointer_register(), type);1099 offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide); 1191 1100 } else { 1192 1101 assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses"); 1193 store(tmp, base, addr->disp(), type);1102 offset = store(tmp, base, addr->disp(), type, wide, false); 1194 1103 } 1195 1104 break; … … 1201 1110 Assembler::is_simm13(addr->disp() + 4), "can't handle larger addresses"); 1202 1111 1203 Register tmp = O7;1112 LIR_Opr tmp = FrameMap::O7_opr; 1204 1113 int value_lo = c->as_jint_lo_bits(); 1205 1114 if (value_lo == 0) { 1206 tmp = G0;1115 tmp = FrameMap::G0_opr; 1207 1116 } else { 1208 1117 __ set(value_lo, O7); 1209 1118 } 1210 store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT);1119 offset = store(tmp, base, addr->disp() + lo_word_offset_in_bytes, T_INT, wide, false); 1211 1120 int value_hi = c->as_jint_hi_bits(); 1212 1121 if (value_hi == 0) { 1213 tmp = G0;1122 tmp = FrameMap::G0_opr; 1214 1123 } else { 1215 1124 __ set(value_hi, O7); 1216 1125 } 1217 store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT);1126 offset = store(tmp, base, addr->disp() + hi_word_offset_in_bytes, T_INT, wide, false); 1218 1127 break; 1219 1128 } … … 1230 1139 if (addr->index()->is_valid()) { 1231 1140 assert(addr->disp() == 0, "must be zero"); 1232 store(tmp, base, addr->index()->as_pointer_register(), type);1141 offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide); 1233 1142 } else { 1234 1143 assert(Assembler::is_simm13(addr->disp()), "can't handle larger addresses"); 1235 store(tmp, base, addr->disp(), type);1144 offset = store(tmp, base, addr->disp(), type, wide, false); 1236 1145 } 1237 1146 … … 1240 1149 default: 1241 1150 Unimplemented(); 1151 } 1152 if (info != NULL) { 1153 assert(offset != -1, "offset should've been set"); 1154 add_debug_info_for_null_check(offset, info); 1242 1155 } 1243 1156 } … … 1325 1238 1326 1239 __ set(const_addrlit, O7); 1327 load(O7, 0, to_reg->as_register(), T_INT);1240 __ ld(O7, 0, to_reg->as_register()); 1328 1241 } 1329 1242 } … … 1418 1331 1419 1332 void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, 1420 LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) {1333 LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) { 1421 1334 1422 1335 LIR_Address* addr = src_opr->as_address_ptr(); … … 1464 1377 assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up"); 1465 1378 if (disp_reg == noreg) { 1466 offset = load(src, disp_value, to_reg, type, unaligned);1379 offset = load(src, disp_value, to_reg, type, wide, unaligned); 1467 1380 } else { 1468 1381 assert(!unaligned, "can't handle this"); 1469 offset = load(src, disp_reg, to_reg, type );1382 offset = load(src, disp_reg, to_reg, type, wide); 1470 1383 } 1471 1384 … … 1473 1386 patching_epilog(patch, patch_code, src, info); 1474 1387 } 1475 1476 1388 if (info != NULL) add_debug_info_for_null_check(offset, info); 1477 1389 } … … 1507 1419 1508 1420 bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; 1509 load(addr.base(), addr.disp(), dest, dest->type(), unaligned);1421 load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned); 1510 1422 } 1511 1423 … … 1519 1431 } 1520 1432 bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; 1521 store(from_reg, addr.base(), addr.disp(), from_reg->type(), unaligned);1433 store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned); 1522 1434 } 1523 1435 … … 1567 1479 void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, 1568 1480 LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, 1569 bool unaligned) {1481 bool wide, bool unaligned) { 1570 1482 LIR_Address* addr = dest->as_address_ptr(); 1571 1483 … … 1611 1523 assert(disp_reg != noreg || Assembler::is_simm13(disp_value), "should have set this up"); 1612 1524 if (disp_reg == noreg) { 1613 offset = store(from_reg, src, disp_value, type, unaligned);1525 offset = store(from_reg, src, disp_value, type, wide, unaligned); 1614 1526 } else { 1615 1527 assert(!unaligned, "can't handle this"); 1616 offset = store(from_reg, src, disp_reg, type );1528 offset = store(from_reg, src, disp_reg, type, wide); 1617 1529 } 1618 1530 … … 1627 1539 void LIR_Assembler::return_op(LIR_Opr result) { 1628 1540 // the poll may need a register so just pick one that isn't the return register 1629 #if def TIERED1541 #if defined(TIERED) && !defined(_LP64) 1630 1542 if (result->type_field() == LIR_OprDesc::long_type) { 1631 1543 // Must move the result to G1 … … 1634 1546 __ srl (I1, 0, I1); // Zero extend O1 (harmless?) 1635 1547 __ or3 (I1, G1, G1); // OR 64 bits into G1 1548 #ifdef ASSERT 1549 // mangle it so any problems will show up 1550 __ set(0xdeadbeef, I0); 1551 __ set(0xdeadbeef, I1); 1552 #endif 1636 1553 } 1637 1554 #endif // TIERED … … 1789 1706 1790 1707 1791 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result) { 1792 1708 void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) { 1793 1709 Assembler::Condition acond; 1794 1710 switch (condition) { … … 1821 1737 } 1822 1738 Label skip; 1823 __ br(acond, false, Assembler::pt, skip); 1739 #ifdef _LP64 1740 if (type == T_INT) { 1741 __ br(acond, false, Assembler::pt, skip); 1742 } else 1743 #endif 1744 __ brx(acond, false, Assembler::pt, skip); // checks icc on 32bit and xcc on 64bit 1824 1745 if (opr1->is_constant() && opr1->type() == T_INT) { 1825 1746 Register dest = result->as_register(); … … 2168 2089 if (flags & LIR_OpArrayCopy::src_null_check) { 2169 2090 __ tst(src); 2170 __ br (Assembler::equal, false, Assembler::pn, *stub->entry());2091 __ brx(Assembler::equal, false, Assembler::pn, *stub->entry()); 2171 2092 __ delayed()->nop(); 2172 2093 } … … 2174 2095 if (flags & LIR_OpArrayCopy::dst_null_check) { 2175 2096 __ tst(dst); 2176 __ br (Assembler::equal, false, Assembler::pn, *stub->entry());2097 __ brx(Assembler::equal, false, Assembler::pn, *stub->entry()); 2177 2098 __ delayed()->nop(); 2178 2099 } … … 2216 2137 2217 2138 if (flags & LIR_OpArrayCopy::type_check) { 2218 __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp); 2219 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2220 __ cmp(tmp, tmp2); 2221 __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry()); 2139 if (UseCompressedOops) { 2140 // We don't need decode because we just need to compare 2141 __ lduw(src, oopDesc::klass_offset_in_bytes(), tmp); 2142 __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2143 __ cmp(tmp, tmp2); 2144 __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry()); 2145 } else { 2146 __ ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp); 2147 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2148 __ cmp(tmp, tmp2); 2149 __ brx(Assembler::notEqual, false, Assembler::pt, *stub->entry()); 2150 } 2222 2151 __ delayed()->nop(); 2223 2152 } … … 2234 2163 Label known_ok, halt; 2235 2164 jobject2reg(op->expected_type()->constant_encoding(), tmp); 2236 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2237 if (basic_type != T_OBJECT) { 2238 __ cmp(tmp, tmp2); 2239 __ br(Assembler::notEqual, false, Assembler::pn, halt); 2240 __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); 2241 __ cmp(tmp, tmp2); 2242 __ br(Assembler::equal, false, Assembler::pn, known_ok); 2243 __ delayed()->nop(); 2165 if (UseCompressedOops) { 2166 // tmp holds the default type. It currently comes uncompressed after the 2167 // load of a constant, so encode it. 2168 __ encode_heap_oop(tmp); 2169 // load the raw value of the dst klass, since we will be comparing 2170 // uncompressed values directly. 2171 __ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2172 if (basic_type != T_OBJECT) { 2173 __ cmp(tmp, tmp2); 2174 __ br(Assembler::notEqual, false, Assembler::pn, halt); 2175 // load the raw value of the src klass. 2176 __ delayed()->lduw(src, oopDesc::klass_offset_in_bytes(), tmp2); 2177 __ cmp(tmp, tmp2); 2178 __ br(Assembler::equal, false, Assembler::pn, known_ok); 2179 __ delayed()->nop(); 2180 } else { 2181 __ cmp(tmp, tmp2); 2182 __ br(Assembler::equal, false, Assembler::pn, known_ok); 2183 __ delayed()->cmp(src, dst); 2184 __ brx(Assembler::equal, false, Assembler::pn, known_ok); 2185 __ delayed()->nop(); 2186 } 2244 2187 } else { 2245 __ cmp(tmp, tmp2); 2246 __ br(Assembler::equal, false, Assembler::pn, known_ok); 2247 __ delayed()->cmp(src, dst); 2248 __ br(Assembler::equal, false, Assembler::pn, known_ok); 2249 __ delayed()->nop(); 2188 __ ld_ptr(dst, oopDesc::klass_offset_in_bytes(), tmp2); 2189 if (basic_type != T_OBJECT) { 2190 __ cmp(tmp, tmp2); 2191 __ brx(Assembler::notEqual, false, Assembler::pn, halt); 2192 __ delayed()->ld_ptr(src, oopDesc::klass_offset_in_bytes(), tmp2); 2193 __ cmp(tmp, tmp2); 2194 __ brx(Assembler::equal, false, Assembler::pn, known_ok); 2195 __ delayed()->nop(); 2196 } else { 2197 __ cmp(tmp, tmp2); 2198 __ brx(Assembler::equal, false, Assembler::pn, known_ok); 2199 __ delayed()->cmp(src, dst); 2200 __ brx(Assembler::equal, false, Assembler::pn, known_ok); 2201 __ delayed()->nop(); 2202 } 2250 2203 } 2251 2204 __ bind(halt); … … 2406 2359 op->tmp4()->as_register() == O1 && 2407 2360 op->klass()->as_register() == G5, "must be"); 2361 2362 LP64_ONLY( __ signx(op->len()->as_register()); ) 2408 2363 if (UseSlowPath || 2409 2364 (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || … … 2426 2381 2427 2382 2383 void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias, 2384 ciMethodData *md, ciProfileData *data, 2385 Register recv, Register tmp1, Label* update_done) { 2386 uint i; 2387 for (i = 0; i < VirtualCallData::row_limit(); i++) { 2388 Label next_test; 2389 // See if the receiver is receiver[n]. 2390 Address receiver_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - 2391 mdo_offset_bias); 2392 __ ld_ptr(receiver_addr, tmp1); 2393 __ verify_oop(tmp1); 2394 __ cmp(recv, tmp1); 2395 __ brx(Assembler::notEqual, false, Assembler::pt, next_test); 2396 __ delayed()->nop(); 2397 Address data_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - 2398 mdo_offset_bias); 2399 __ ld_ptr(data_addr, tmp1); 2400 __ add(tmp1, DataLayout::counter_increment, tmp1); 2401 __ st_ptr(tmp1, data_addr); 2402 __ ba(false, *update_done); 2403 __ delayed()->nop(); 2404 __ bind(next_test); 2405 } 2406 2407 // Didn't find receiver; find next empty slot and fill it in 2408 for (i = 0; i < VirtualCallData::row_limit(); i++) { 2409 Label next_test; 2410 Address recv_addr(mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - 2411 mdo_offset_bias); 2412 __ ld_ptr(recv_addr, tmp1); 2413 __ br_notnull(tmp1, false, Assembler::pt, next_test); 2414 __ delayed()->nop(); 2415 __ st_ptr(recv, recv_addr); 2416 __ set(DataLayout::counter_increment, tmp1); 2417 __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - 2418 mdo_offset_bias); 2419 __ ba(false, *update_done); 2420 __ delayed()->nop(); 2421 __ bind(next_test); 2422 } 2423 } 2424 2425 2426 void LIR_Assembler::setup_md_access(ciMethod* method, int bci, 2427 ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) { 2428 md = method->method_data_or_null(); 2429 assert(md != NULL, "Sanity"); 2430 data = md->bci_to_data(bci); 2431 assert(data != NULL, "need data for checkcast"); 2432 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); 2433 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) { 2434 // The offset is large so bias the mdo by the base of the slot so 2435 // that the ld can use simm13s to reference the slots of the data 2436 mdo_offset_bias = md->byte_offset_of_slot(data, DataLayout::header_offset()); 2437 } 2438 } 2439 2440 void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, Label* failure, Label* obj_is_null) { 2441 // we always need a stub for the failure case. 2442 CodeStub* stub = op->stub(); 2443 Register obj = op->object()->as_register(); 2444 Register k_RInfo = op->tmp1()->as_register(); 2445 Register klass_RInfo = op->tmp2()->as_register(); 2446 Register dst = op->result_opr()->as_register(); 2447 Register Rtmp1 = op->tmp3()->as_register(); 2448 ciKlass* k = op->klass(); 2449 2450 2451 if (obj == k_RInfo) { 2452 k_RInfo = klass_RInfo; 2453 klass_RInfo = obj; 2454 } 2455 2456 ciMethodData* md; 2457 ciProfileData* data; 2458 int mdo_offset_bias = 0; 2459 if (op->should_profile()) { 2460 ciMethod* method = op->profiled_method(); 2461 assert(method != NULL, "Should have method"); 2462 setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias); 2463 2464 Label not_null; 2465 __ br_notnull(obj, false, Assembler::pn, not_null); 2466 __ delayed()->nop(); 2467 Register mdo = k_RInfo; 2468 Register data_val = Rtmp1; 2469 jobject2reg(md->constant_encoding(), mdo); 2470 if (mdo_offset_bias > 0) { 2471 __ set(mdo_offset_bias, data_val); 2472 __ add(mdo, data_val, mdo); 2473 } 2474 Address flags_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias); 2475 __ ldub(flags_addr, data_val); 2476 __ or3(data_val, BitData::null_seen_byte_constant(), data_val); 2477 __ stb(data_val, flags_addr); 2478 __ ba(false, *obj_is_null); 2479 __ delayed()->nop(); 2480 __ bind(not_null); 2481 } else { 2482 __ br_null(obj, false, Assembler::pn, *obj_is_null); 2483 __ delayed()->nop(); 2484 } 2485 2486 Label profile_cast_failure, profile_cast_success; 2487 Label *failure_target = op->should_profile() ? &profile_cast_failure : failure; 2488 Label *success_target = op->should_profile() ? &profile_cast_success : success; 2489 2490 // patching may screw with our temporaries on sparc, 2491 // so let's do it before loading the class 2492 if (k->is_loaded()) { 2493 jobject2reg(k->constant_encoding(), k_RInfo); 2494 } else { 2495 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); 2496 } 2497 assert(obj != k_RInfo, "must be different"); 2498 2499 // get object class 2500 // not a safepoint as obj null check happens earlier 2501 __ load_klass(obj, klass_RInfo); 2502 if (op->fast_check()) { 2503 assert_different_registers(klass_RInfo, k_RInfo); 2504 __ cmp(k_RInfo, klass_RInfo); 2505 __ brx(Assembler::notEqual, false, Assembler::pt, *failure_target); 2506 __ delayed()->nop(); 2507 } else { 2508 bool need_slow_path = true; 2509 if (k->is_loaded()) { 2510 if (k->super_check_offset() != sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()) 2511 need_slow_path = false; 2512 // perform the fast part of the checking logic 2513 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, noreg, 2514 (need_slow_path ? success_target : NULL), 2515 failure_target, NULL, 2516 RegisterOrConstant(k->super_check_offset())); 2517 } else { 2518 // perform the fast part of the checking logic 2519 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, 2520 failure_target, NULL); 2521 } 2522 if (need_slow_path) { 2523 // call out-of-line instance of __ check_klass_subtype_slow_path(...): 2524 assert(klass_RInfo == G3 && k_RInfo == G1, "incorrect call setup"); 2525 __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); 2526 __ delayed()->nop(); 2527 __ cmp(G3, 0); 2528 __ br(Assembler::equal, false, Assembler::pn, *failure_target); 2529 __ delayed()->nop(); 2530 // Fall through to success case 2531 } 2532 } 2533 2534 if (op->should_profile()) { 2535 Register mdo = klass_RInfo, recv = k_RInfo, tmp1 = Rtmp1; 2536 assert_different_registers(obj, mdo, recv, tmp1); 2537 __ bind(profile_cast_success); 2538 jobject2reg(md->constant_encoding(), mdo); 2539 if (mdo_offset_bias > 0) { 2540 __ set(mdo_offset_bias, tmp1); 2541 __ add(mdo, tmp1, mdo); 2542 } 2543 __ load_klass(obj, recv); 2544 type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, success); 2545 // Jump over the failure case 2546 __ ba(false, *success); 2547 __ delayed()->nop(); 2548 // Cast failure case 2549 __ bind(profile_cast_failure); 2550 jobject2reg(md->constant_encoding(), mdo); 2551 if (mdo_offset_bias > 0) { 2552 __ set(mdo_offset_bias, tmp1); 2553 __ add(mdo, tmp1, mdo); 2554 } 2555 Address data_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias); 2556 __ ld_ptr(data_addr, tmp1); 2557 __ sub(tmp1, DataLayout::counter_increment, tmp1); 2558 __ st_ptr(tmp1, data_addr); 2559 __ ba(false, *failure); 2560 __ delayed()->nop(); 2561 } 2562 __ ba(false, *success); 2563 __ delayed()->nop(); 2564 } 2565 2428 2566 void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { 2429 2567 LIR_Code code = op->code(); … … 2436 2574 2437 2575 __ verify_oop(value); 2438 2439 2576 CodeStub* stub = op->stub(); 2440 Label done; 2441 __ cmp(value, 0); 2442 __ br(Assembler::equal, false, Assembler::pn, done); 2443 __ delayed()->nop(); 2444 load(array, oopDesc::klass_offset_in_bytes(), k_RInfo, T_OBJECT, op->info_for_exception()); 2445 load(value, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL); 2577 // check if it needs to be profiled 2578 ciMethodData* md; 2579 ciProfileData* data; 2580 int mdo_offset_bias = 0; 2581 if (op->should_profile()) { 2582 ciMethod* method = op->profiled_method(); 2583 assert(method != NULL, "Should have method"); 2584 setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias); 2585 } 2586 Label profile_cast_success, profile_cast_failure, done; 2587 Label *success_target = op->should_profile() ? &profile_cast_success : &done; 2588 Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); 2589 2590 if (op->should_profile()) { 2591 Label not_null; 2592 __ br_notnull(value, false, Assembler::pn, not_null); 2593 __ delayed()->nop(); 2594 Register mdo = k_RInfo; 2595 Register data_val = Rtmp1; 2596 jobject2reg(md->constant_encoding(), mdo); 2597 if (mdo_offset_bias > 0) { 2598 __ set(mdo_offset_bias, data_val); 2599 __ add(mdo, data_val, mdo); 2600 } 2601 Address flags_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias); 2602 __ ldub(flags_addr, data_val); 2603 __ or3(data_val, BitData::null_seen_byte_constant(), data_val); 2604 __ stb(data_val, flags_addr); 2605 __ ba(false, done); 2606 __ delayed()->nop(); 2607 __ bind(not_null); 2608 } else { 2609 __ br_null(value, false, Assembler::pn, done); 2610 __ delayed()->nop(); 2611 } 2612 add_debug_info_for_null_check_here(op->info_for_exception()); 2613 __ load_klass(array, k_RInfo); 2614 __ load_klass(value, klass_RInfo); 2446 2615 2447 2616 // get instance klass 2448 load(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc), k_RInfo, T_OBJECT, NULL);2617 __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)), k_RInfo); 2449 2618 // perform the fast part of the checking logic 2450 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, &done, stub->entry(), NULL);2619 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL); 2451 2620 2452 2621 // call out-of-line instance of __ check_klass_subtype_slow_path(...): … … 2455 2624 __ delayed()->nop(); 2456 2625 __ cmp(G3, 0); 2457 __ br(Assembler::equal, false, Assembler::pn, * stub->entry());2626 __ br(Assembler::equal, false, Assembler::pn, *failure_target); 2458 2627 __ delayed()->nop(); 2628 // fall through to the success case 2629 2630 if (op->should_profile()) { 2631 Register mdo = klass_RInfo, recv = k_RInfo, tmp1 = Rtmp1; 2632 assert_different_registers(value, mdo, recv, tmp1); 2633 __ bind(profile_cast_success); 2634 jobject2reg(md->constant_encoding(), mdo); 2635 if (mdo_offset_bias > 0) { 2636 __ set(mdo_offset_bias, tmp1); 2637 __ add(mdo, tmp1, mdo); 2638 } 2639 __ load_klass(value, recv); 2640 type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done); 2641 __ ba(false, done); 2642 __ delayed()->nop(); 2643 // Cast failure case 2644 __ bind(profile_cast_failure); 2645 jobject2reg(md->constant_encoding(), mdo); 2646 if (mdo_offset_bias > 0) { 2647 __ set(mdo_offset_bias, tmp1); 2648 __ add(mdo, tmp1, mdo); 2649 } 2650 Address data_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias); 2651 __ ld_ptr(data_addr, tmp1); 2652 __ sub(tmp1, DataLayout::counter_increment, tmp1); 2653 __ st_ptr(tmp1, data_addr); 2654 __ ba(false, *stub->entry()); 2655 __ delayed()->nop(); 2656 } 2459 2657 __ bind(done); 2460 } else if (op->code() == lir_checkcast) { 2461 // we always need a stub for the failure case. 2462 CodeStub* stub = op->stub(); 2658 } else if (code == lir_checkcast) { 2463 2659 Register obj = op->object()->as_register(); 2464 Register k_RInfo = op->tmp1()->as_register();2465 Register klass_RInfo = op->tmp2()->as_register();2466 2660 Register dst = op->result_opr()->as_register(); 2467 Register Rtmp1 = op->tmp3()->as_register(); 2468 ciKlass* k = op->klass(); 2469 2470 if (obj == k_RInfo) { 2471 k_RInfo = klass_RInfo; 2472 klass_RInfo = obj; 2473 } 2474 if (op->profiled_method() != NULL) { 2475 ciMethod* method = op->profiled_method(); 2476 int bci = op->profiled_bci(); 2477 2478 // We need two temporaries to perform this operation on SPARC, 2479 // so to keep things simple we perform a redundant test here 2480 Label profile_done; 2481 __ cmp(obj, 0); 2482 __ br(Assembler::notEqual, false, Assembler::pn, profile_done); 2483 __ delayed()->nop(); 2484 // Object is null; update methodDataOop 2485 ciMethodData* md = method->method_data(); 2486 if (md == NULL) { 2487 bailout("out of memory building methodDataOop"); 2488 return; 2489 } 2490 ciProfileData* data = md->bci_to_data(bci); 2491 assert(data != NULL, "need data for checkcast"); 2492 assert(data->is_BitData(), "need BitData for checkcast"); 2493 Register mdo = k_RInfo; 2494 Register data_val = Rtmp1; 2495 jobject2reg(md->constant_encoding(), mdo); 2496 2497 int mdo_offset_bias = 0; 2498 if (!Assembler::is_simm13(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) { 2499 // The offset is large so bias the mdo by the base of the slot so 2500 // that the ld can use simm13s to reference the slots of the data 2501 mdo_offset_bias = md->byte_offset_of_slot(data, DataLayout::header_offset()); 2502 __ set(mdo_offset_bias, data_val); 2503 __ add(mdo, data_val, mdo); 2504 } 2505 2506 2507 Address flags_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias); 2508 __ ldub(flags_addr, data_val); 2509 __ or3(data_val, BitData::null_seen_byte_constant(), data_val); 2510 __ stb(data_val, flags_addr); 2511 __ bind(profile_done); 2512 } 2513 2514 Label done; 2515 // patching may screw with our temporaries on sparc, 2516 // so let's do it before loading the class 2517 if (k->is_loaded()) { 2518 jobject2reg(k->constant_encoding(), k_RInfo); 2519 } else { 2520 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); 2521 } 2522 assert(obj != k_RInfo, "must be different"); 2523 __ cmp(obj, 0); 2524 __ br(Assembler::equal, false, Assembler::pn, done); 2525 __ delayed()->nop(); 2526 2527 // get object class 2528 // not a safepoint as obj null check happens earlier 2529 load(obj, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL); 2530 if (op->fast_check()) { 2531 assert_different_registers(klass_RInfo, k_RInfo); 2532 __ cmp(k_RInfo, klass_RInfo); 2533 __ br(Assembler::notEqual, false, Assembler::pt, *stub->entry()); 2534 __ delayed()->nop(); 2535 __ bind(done); 2536 } else { 2537 bool need_slow_path = true; 2538 if (k->is_loaded()) { 2539 if (k->super_check_offset() != sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()) 2540 need_slow_path = false; 2541 // perform the fast part of the checking logic 2542 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, noreg, 2543 (need_slow_path ? &done : NULL), 2544 stub->entry(), NULL, 2545 RegisterOrConstant(k->super_check_offset())); 2546 } else { 2547 // perform the fast part of the checking logic 2548 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, 2549 &done, stub->entry(), NULL); 2550 } 2551 if (need_slow_path) { 2552 // call out-of-line instance of __ check_klass_subtype_slow_path(...): 2553 assert(klass_RInfo == G3 && k_RInfo == G1, "incorrect call setup"); 2554 __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); 2555 __ delayed()->nop(); 2556 __ cmp(G3, 0); 2557 __ br(Assembler::equal, false, Assembler::pn, *stub->entry()); 2558 __ delayed()->nop(); 2559 } 2560 __ bind(done); 2561 } 2661 Label success; 2662 emit_typecheck_helper(op, &success, op->stub()->entry(), &success); 2663 __ bind(success); 2562 2664 __ mov(obj, dst); 2563 2665 } else if (code == lir_instanceof) { 2564 2666 Register obj = op->object()->as_register(); 2565 Register k_RInfo = op->tmp1()->as_register();2566 Register klass_RInfo = op->tmp2()->as_register();2567 2667 Register dst = op->result_opr()->as_register(); 2568 Register Rtmp1 = op->tmp3()->as_register(); 2569 ciKlass* k = op->klass(); 2570 2571 Label done; 2572 if (obj == k_RInfo) { 2573 k_RInfo = klass_RInfo; 2574 klass_RInfo = obj; 2575 } 2576 // patching may screw with our temporaries on sparc, 2577 // so let's do it before loading the class 2578 if (k->is_loaded()) { 2579 jobject2reg(k->constant_encoding(), k_RInfo); 2580 } else { 2581 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); 2582 } 2583 assert(obj != k_RInfo, "must be different"); 2584 __ cmp(obj, 0); 2585 __ br(Assembler::equal, true, Assembler::pn, done); 2586 __ delayed()->set(0, dst); 2587 2588 // get object class 2589 // not a safepoint as obj null check happens earlier 2590 load(obj, oopDesc::klass_offset_in_bytes(), klass_RInfo, T_OBJECT, NULL); 2591 if (op->fast_check()) { 2592 __ cmp(k_RInfo, klass_RInfo); 2593 __ br(Assembler::equal, true, Assembler::pt, done); 2594 __ delayed()->set(1, dst); 2595 __ set(0, dst); 2596 __ bind(done); 2597 } else { 2598 bool need_slow_path = true; 2599 if (k->is_loaded()) { 2600 if (k->super_check_offset() != sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()) 2601 need_slow_path = false; 2602 // perform the fast part of the checking logic 2603 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, O7, noreg, 2604 (need_slow_path ? &done : NULL), 2605 (need_slow_path ? &done : NULL), NULL, 2606 RegisterOrConstant(k->super_check_offset()), 2607 dst); 2608 } else { 2609 assert(dst != klass_RInfo && dst != k_RInfo, "need 3 registers"); 2610 // perform the fast part of the checking logic 2611 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, O7, dst, 2612 &done, &done, NULL, 2613 RegisterOrConstant(-1), 2614 dst); 2615 } 2616 if (need_slow_path) { 2617 // call out-of-line instance of __ check_klass_subtype_slow_path(...): 2618 assert(klass_RInfo == G3 && k_RInfo == G1, "incorrect call setup"); 2619 __ call(Runtime1::entry_for(Runtime1::slow_subtype_check_id), relocInfo::runtime_call_type); 2620 __ delayed()->nop(); 2621 __ mov(G3, dst); 2622 } 2623 __ bind(done); 2624 } 2668 Label success, failure, done; 2669 emit_typecheck_helper(op, &success, &failure, &failure); 2670 __ bind(failure); 2671 __ set(0, dst); 2672 __ ba(false, done); 2673 __ delayed()->nop(); 2674 __ bind(success); 2675 __ set(1, dst); 2676 __ bind(done); 2625 2677 } else { 2626 2678 ShouldNotReachHere(); … … 2643 2695 __ mov(cmp_value_lo, t1); 2644 2696 __ mov(new_value_lo, t2); 2697 // perform the compare and swap operation 2698 __ casx(addr, t1, t2); 2699 // generate condition code - if the swap succeeded, t2 ("new value" reg) was 2700 // overwritten with the original value in "addr" and will be equal to t1. 2701 __ cmp(t1, t2); 2645 2702 #else 2646 2703 // move high and low halves of long values into single registers … … 2651 2708 __ srl(new_value_lo, 0, new_value_lo); 2652 2709 __ or3(t2, new_value_lo, t2); // t2 holds 64-bit value to swap 2653 #endif2654 2710 // perform the compare and swap operation 2655 2711 __ casx(addr, t1, t2); 2656 2712 // generate condition code - if the swap succeeded, t2 ("new value" reg) was 2657 2713 // overwritten with the original value in "addr" and will be equal to t1. 2658 __ cmp(t1, t2); 2659 2714 // Produce icc flag for 32bit. 2715 __ sub(t1, t2, t2); 2716 __ srlx(t2, 32, t1); 2717 __ orcc(t2, t1, G0); 2718 #endif 2660 2719 } else if (op->code() == lir_cas_int || op->code() == lir_cas_obj) { 2661 2720 Register addr = op->addr()->as_pointer_register(); … … 2666 2725 __ mov(cmp_value, t1); 2667 2726 __ mov(new_value, t2); 2668 #ifdef _LP642669 2727 if (op->code() == lir_cas_obj) { 2670 __ casx(addr, t1, t2); 2671 } else 2672 #endif 2673 { 2728 if (UseCompressedOops) { 2729 __ encode_heap_oop(t1); 2730 __ encode_heap_oop(t2); 2674 2731 __ cas(addr, t1, t2); 2675 } 2732 } else { 2733 __ cas_ptr(addr, t1, t2); 2734 } 2735 } else { 2736 __ cas(addr, t1, t2); 2737 } 2676 2738 __ cmp(t1, t2); 2677 2739 } else { … … 2770 2832 2771 2833 // Update counter for all call types 2772 ciMethodData* md = method->method_data(); 2773 if (md == NULL) { 2774 bailout("out of memory building methodDataOop"); 2775 return; 2776 } 2834 ciMethodData* md = method->method_data_or_null(); 2835 assert(md != NULL, "Sanity"); 2777 2836 ciProfileData* data = md->bci_to_data(bci); 2778 2837 assert(data->is_CounterData(), "need CounterData for calls"); 2779 2838 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); 2839 Register mdo = op->mdo()->as_register(); 2840 #ifdef _LP64 2841 assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated"); 2842 Register tmp1 = op->tmp1()->as_register_lo(); 2843 #else 2780 2844 assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated"); 2781 Register mdo = op->mdo()->as_register();2782 2845 Register tmp1 = op->tmp1()->as_register(); 2846 #endif 2783 2847 jobject2reg(md->constant_encoding(), mdo); 2784 2848 int mdo_offset_bias = 0; … … 2797 2861 // invokeinterface bytecodes 2798 2862 if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) && 2799 Tier1ProfileVirtualCalls) {2863 C1ProfileVirtualCalls) { 2800 2864 assert(op->recv()->is_single_cpu(), "recv must be allocated"); 2801 2865 Register recv = op->recv()->as_register(); … … 2803 2867 assert(data->is_VirtualCallData(), "need VirtualCallData for virtual calls"); 2804 2868 ciKlass* known_klass = op->known_holder(); 2805 if ( Tier1OptimizeVirtualCallProfiling && known_klass != NULL) {2869 if (C1OptimizeVirtualCallProfiling && known_klass != NULL) { 2806 2870 // We know the type that will be seen at this call site; we can 2807 2871 // statically update the methodDataOop rather than needing to do … … 2818 2882 VirtualCallData::receiver_count_offset(i)) - 2819 2883 mdo_offset_bias); 2820 __ ld uw(data_addr, tmp1);2884 __ ld_ptr(data_addr, tmp1); 2821 2885 __ add(tmp1, DataLayout::counter_increment, tmp1); 2822 __ st w(tmp1, data_addr);2886 __ st_ptr(tmp1, data_addr); 2823 2887 return; 2824 2888 } … … 2839 2903 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - 2840 2904 mdo_offset_bias); 2841 __ ld uw(data_addr, tmp1);2905 __ ld_ptr(data_addr, tmp1); 2842 2906 __ add(tmp1, DataLayout::counter_increment, tmp1); 2843 __ st w(tmp1, data_addr);2907 __ st_ptr(tmp1, data_addr); 2844 2908 return; 2845 2909 } 2846 2910 } 2847 2911 } else { 2848 load(Address(recv, oopDesc::klass_offset_in_bytes()), recv, T_OBJECT);2912 __ load_klass(recv, recv); 2849 2913 Label update_done; 2850 uint i; 2851 for (i = 0; i < VirtualCallData::row_limit(); i++) { 2852 Label next_test; 2853 // See if the receiver is receiver[n]. 2854 Address receiver_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - 2855 mdo_offset_bias); 2856 __ ld_ptr(receiver_addr, tmp1); 2857 __ verify_oop(tmp1); 2858 __ cmp(recv, tmp1); 2859 __ brx(Assembler::notEqual, false, Assembler::pt, next_test); 2860 __ delayed()->nop(); 2861 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - 2862 mdo_offset_bias); 2863 __ lduw(data_addr, tmp1); 2864 __ add(tmp1, DataLayout::counter_increment, tmp1); 2865 __ stw(tmp1, data_addr); 2866 __ br(Assembler::always, false, Assembler::pt, update_done); 2867 __ delayed()->nop(); 2868 __ bind(next_test); 2869 } 2870 2871 // Didn't find receiver; find next empty slot and fill it in 2872 for (i = 0; i < VirtualCallData::row_limit(); i++) { 2873 Label next_test; 2874 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - 2875 mdo_offset_bias); 2876 load(recv_addr, tmp1, T_OBJECT); 2877 __ tst(tmp1); 2878 __ brx(Assembler::notEqual, false, Assembler::pt, next_test); 2879 __ delayed()->nop(); 2880 __ st_ptr(recv, recv_addr); 2881 __ set(DataLayout::counter_increment, tmp1); 2882 __ st_ptr(tmp1, mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - 2883 mdo_offset_bias); 2884 __ br(Assembler::always, false, Assembler::pt, update_done); 2885 __ delayed()->nop(); 2886 __ bind(next_test); 2887 } 2914 type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &update_done); 2888 2915 // Receiver did not match any saved receiver and there is no empty row for it. 2889 2916 // Increment total counter to indicate polymorphic case. 2890 __ ld uw(counter_addr, tmp1);2917 __ ld_ptr(counter_addr, tmp1); 2891 2918 __ add(tmp1, DataLayout::counter_increment, tmp1); 2892 __ st w(tmp1, counter_addr);2919 __ st_ptr(tmp1, counter_addr); 2893 2920 2894 2921 __ bind(update_done); … … 2896 2923 } else { 2897 2924 // Static call 2898 __ ld uw(counter_addr, tmp1);2925 __ ld_ptr(counter_addr, tmp1); 2899 2926 __ add(tmp1, DataLayout::counter_increment, tmp1); 2900 __ stw(tmp1, counter_addr); 2901 } 2902 } 2903 2927 __ st_ptr(tmp1, counter_addr); 2928 } 2929 } 2904 2930 2905 2931 void LIR_Assembler::align_backward_branch_target() { … … 3078 3104 // use normal move for all other volatiles since they don't need 3079 3105 // special handling to remain atomic. 3080 move_op(src, dest, type, lir_patch_none, info, false, false );3106 move_op(src, dest, type, lir_patch_none, info, false, false, false); 3081 3107 } 3082 3108 } … … 3095 3121 } 3096 3122 3097 // Macro toPack two sequential registers containing 32 bit values3123 // Pack two sequential registers containing 32 bit values 3098 3124 // into a single 64 bit register. 3099 // rs and rs->successor() are packed into rd 3100 // rd and rs may be the same register. 3101 // Note: rs and rs->successor() are destroyed. 3102 void LIR_Assembler::pack64( Register rs, Register rd ) { 3125 // src and src->successor() are packed into dst 3126 // src and dst may be the same register. 3127 // Note: src is destroyed 3128 void LIR_Assembler::pack64(LIR_Opr src, LIR_Opr dst) { 3129 Register rs = src->as_register(); 3130 Register rd = dst->as_register_lo(); 3103 3131 __ sllx(rs, 32, rs); 3104 3132 __ srl(rs->successor(), 0, rs->successor()); … … 3106 3134 } 3107 3135 3108 // Macro to unpack a 64 bit value in a register into3136 // Unpack a 64 bit value in a register into 3109 3137 // two sequential registers. 3110 // rd is unpacked into rd and rd->successor() 3111 void LIR_Assembler::unpack64( Register rd ) { 3112 __ mov(rd, rd->successor()); 3113 __ srax(rd, 32, rd); 3114 __ sra(rd->successor(), 0, rd->successor()); 3138 // src is unpacked into dst and dst->successor() 3139 void LIR_Assembler::unpack64(LIR_Opr src, LIR_Opr dst) { 3140 Register rs = src->as_register_lo(); 3141 Register rd = dst->as_register_hi(); 3142 assert_different_registers(rs, rd, rd->successor()); 3143 __ srlx(rs, 32, rd); 3144 __ srl (rs, 0, rd->successor()); 3115 3145 } 3116 3146 … … 3119 3149 LIR_Address* addr = addr_opr->as_address_ptr(); 3120 3150 assert(addr->index()->is_illegal() && addr->scale() == LIR_Address::times_1 && Assembler::is_simm13(addr->disp()), "can't handle complex addresses yet"); 3121 __ add(addr->base()->as_register(), addr->disp(), dest->as_register()); 3151 3152 __ add(addr->base()->as_pointer_register(), addr->disp(), dest->as_pointer_register()); 3122 3153 } 3123 3154 … … 3190 3221 } 3191 3222 #endif 3192 continue; 3223 } else { 3224 LIR_Op* delay_op = new LIR_OpDelay(new LIR_Op0(lir_nop), op->as_OpJavaCall()->info()); 3225 inst->insert_before(i + 1, delay_op); 3226 i++; 3193 3227 } 3194 3228 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); 3229 #if defined(TIERED) && !defined(_LP64) 3230 // fixup the return value from G1 to O0/O1 for long returns. 3231 // It's done here instead of in LIRGenerator because there's 3232 // such a mismatch between the single reg and double reg 3233 // calling convention. 3234 LIR_OpJavaCall* callop = op->as_OpJavaCall(); 3235 if (callop->result_opr() == FrameMap::out_long_opr) { 3236 LIR_OpJavaCall* call; 3237 LIR_OprList* arguments = new LIR_OprList(callop->arguments()->length()); 3238 for (int a = 0; a < arguments->length(); a++) { 3239 arguments[a] = callop->arguments()[a]; 3240 } 3241 if (op->code() == lir_virtual_call) { 3242 call = new LIR_OpJavaCall(op->code(), callop->method(), callop->receiver(), FrameMap::g1_long_single_opr, 3243 callop->vtable_offset(), arguments, callop->info()); 3244 } else { 3245 call = new LIR_OpJavaCall(op->code(), callop->method(), callop->receiver(), FrameMap::g1_long_single_opr, 3246 callop->addr(), arguments, callop->info()); 3247 } 3248 inst->at_put(i - 1, call); 3249 inst->insert_before(i + 1, new LIR_Op1(lir_unpack64, FrameMap::g1_long_single_opr, callop->result_opr(), 3250 T_LONG, lir_patch_none, NULL)); 3251 } 3252 #endif 3197 3253 break; 3198 3254 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 06, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP 26 #define CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP 27 25 28 private: 26 29 … … 38 41 // 39 42 40 // some load/store variants return the code_offset for proper positioning of debug info for null checks 43 int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned); 44 int store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide); 41 45 42 // load/store with 32 bit displacement 43 int load(Register s, int disp, Register d, BasicType ld_type, CodeEmitInfo* info = NULL); 44 void store(Register value, Register base, int offset, BasicType type, CodeEmitInfo *info = NULL); 45 46 // loadf/storef with 32 bit displacement 47 void load(Register s, int disp, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL); 48 void store(FloatRegister d, Register s1, int disp, BasicType st_type, CodeEmitInfo* info = NULL); 49 50 // convienence methods for calling load/store with an Address 51 void load(const Address& a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0); 52 void store(Register d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0); 53 void load(const Address& a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL, int offset = 0); 54 void store(FloatRegister d, const Address& a, BasicType st_type, CodeEmitInfo* info = NULL, int offset = 0); 55 56 // convienence methods for calling load/store with an LIR_Address 57 void load(LIR_Address* a, Register d, BasicType ld_type, CodeEmitInfo* info = NULL); 58 void store(Register d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL); 59 void load(LIR_Address* a, FloatRegister d, BasicType ld_type, CodeEmitInfo* info = NULL); 60 void store(FloatRegister d, LIR_Address* a, BasicType st_type, CodeEmitInfo* info = NULL); 61 62 int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool unaligned = false); 63 int store(LIR_Opr from_reg, Register base, Register disp, BasicType type); 64 65 int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool unaligned = false); 66 int load(Register base, Register disp, LIR_Opr to_reg, BasicType type); 46 int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned); 47 int load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide); 67 48 68 49 void monitorexit(LIR_Opr obj_opr, LIR_Opr lock_opr, Register hdr, int monitor_no); … … 72 53 static bool is_single_instruction(LIR_Op* op); 73 54 55 // Record the type of the receiver in ReceiverTypeData 56 void type_profile_helper(Register mdo, int mdo_offset_bias, 57 ciMethodData *md, ciProfileData *data, 58 Register recv, Register tmp1, Label* update_done); 59 // Setup pointers to MDO, MDO slot, also compute offset bias to access the slot. 60 void setup_md_access(ciMethod* method, int bci, 61 ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias); 74 62 public: 75 void pack64( Register rs, Register rd);76 void unpack64( Register rd);63 void pack64(LIR_Opr src, LIR_Opr dst); 64 void unpack64(LIR_Opr src, LIR_Opr dst); 77 65 78 66 enum { … … 84 72 exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4), 85 73 deopt_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(10*4) }; 74 75 #endif // CPU_SPARC_VM_C1_LIRASSEMBLER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_c1_LIRGenerator_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_Compilation.hpp" 27 #include "c1/c1_FrameMap.hpp" 28 #include "c1/c1_Instruction.hpp" 29 #include "c1/c1_LIRAssembler.hpp" 30 #include "c1/c1_LIRGenerator.hpp" 31 #include "c1/c1_Runtime1.hpp" 32 #include "c1/c1_ValueStack.hpp" 33 #include "ci/ciArray.hpp" 34 #include "ci/ciObjArrayKlass.hpp" 35 #include "ci/ciTypeArrayKlass.hpp" 36 #include "runtime/sharedRuntime.hpp" 37 #include "runtime/stubRoutines.hpp" 38 #include "vmreg_sparc.inline.hpp" 27 39 28 40 #ifdef ASSERT … … 228 240 } 229 241 230 231 void LIRGenerator::increment_counter(address counter, int step) { 242 LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { 243 LIR_Opr r; 244 if (type == T_LONG) { 245 r = LIR_OprFact::longConst(x); 246 } else if (type == T_INT) { 247 r = LIR_OprFact::intConst(x); 248 } else { 249 ShouldNotReachHere(); 250 } 251 if (!Assembler::is_simm13(x)) { 252 LIR_Opr tmp = new_register(type); 253 __ move(r, tmp); 254 return tmp; 255 } 256 return r; 257 } 258 259 void LIRGenerator::increment_counter(address counter, BasicType type, int step) { 232 260 LIR_Opr pointer = new_pointer_register(); 233 261 __ move(LIR_OprFact::intptrConst(counter), pointer); 234 LIR_Address* addr = new LIR_Address(pointer, T_INT);262 LIR_Address* addr = new LIR_Address(pointer, type); 235 263 increment_counter(addr, step); 236 264 } 237 265 238 266 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { 239 LIR_Opr temp = new_register( T_INT);267 LIR_Opr temp = new_register(addr->type()); 240 268 __ move(addr, temp); 241 LIR_Opr c = LIR_OprFact::intConst(step); 242 if (Assembler::is_simm13(step)) { 243 __ add(temp, c, temp); 244 } else { 245 LIR_Opr temp2 = new_register(T_INT); 246 __ move(c, temp2); 247 __ add(temp, temp2, temp); 248 } 269 __ add(temp, load_immediate(step, addr->type()), temp); 249 270 __ move(temp, addr); 250 271 } 251 252 272 253 273 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { … … 304 324 305 325 void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { 306 assert(x->is_ root(),"");326 assert(x->is_pinned(),""); 307 327 bool needs_range_check = true; 308 328 bool use_length = x->length() != NULL; … … 379 399 380 400 void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { 381 assert(x->is_ root(),"");401 assert(x->is_pinned(),""); 382 402 LIRItem obj(x->obj(), this); 383 403 obj.load_item(); … … 391 411 CodeEmitInfo* info_for_exception = NULL; 392 412 if (x->needs_null_check()) { 393 info_for_exception = state_for(x , x->lock_stack_before());413 info_for_exception = state_for(x); 394 414 } 395 415 … … 402 422 403 423 void LIRGenerator::do_MonitorExit(MonitorExit* x) { 404 assert(x->is_ root(),"");424 assert(x->is_pinned(),""); 405 425 LIRItem obj(x->obj(), this); 406 426 obj.dont_load_item(); … … 612 632 right.load_item(); 613 633 LIR_Opr reg = rlock_result(x); 614 615 634 if (x->x()->type()->is_float_kind()) { 616 635 Bytecodes::Code code = x->op(); … … 644 663 // generate conditional move of boolean result 645 664 LIR_Opr result = rlock_result(x); 646 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result );665 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result, T_LONG); 647 666 } 648 667 … … 681 700 ShouldNotReachHere(); 682 701 } 683 684 702 // generate conditional move of boolean result 685 703 LIR_Opr result = rlock_result(x); 686 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 704 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), 705 result, as_BasicType(type)); 687 706 if (type == objectType) { // Write-barrier needed for Object fields. 688 707 // Precise card mark since could either be object or array … … 865 884 // O0 as result register. 866 885 const LIR_Opr reg = result_register_for(x->type()); 867 886 #ifndef PRODUCT 868 887 if (PrintNotLoaded && !x->klass()->is_loaded()) { 869 tty->print_cr(" ###class not loaded at new bci %d", x->bci()); 870 } 888 tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci()); 889 } 890 #endif 871 891 CodeEmitInfo* info = state_for(x, x->state()); 872 892 LIR_Opr tmp1 = FrameMap::G1_oop_opr; … … 1012 1032 LIR_Opr out_reg = rlock_result(x); 1013 1033 CodeStub* stub; 1014 CodeEmitInfo* info_for_exception = state_for(x , x->state()->copy_locks());1034 CodeEmitInfo* info_for_exception = state_for(x); 1015 1035 1016 1036 if (x->is_incompatible_class_change_check()) { … … 1041 1061 LIR_Opr tmp2 = FrameMap::G3_oop_opr; 1042 1062 LIR_Opr tmp3 = FrameMap::G4_oop_opr; 1043 __ instanceof(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3, x->direct_compare(), patching_info); 1063 __ instanceof(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3, 1064 x->direct_compare(), patching_info, 1065 x->profiled_method(), x->profiled_bci()); 1044 1066 } 1045 1067 … … 1090 1112 if (x->is_safepoint()) { 1091 1113 // increment backedge counter if needed 1092 increment_backedge_counter(state_for(x, x->state_before())); 1093 1114 increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci()); 1094 1115 __ safepoint(new_register(T_INT), state_for(x, x->state_before())); 1095 1116 } 1096 1117 1097 1118 __ cmp(lir_cond(cond), left, right); 1119 // Generate branch profiling. Profiling code doesn't kill flags. 1098 1120 profile_branch(x, cond); 1099 1121 move_to_phi(x->state()); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_LinearScan_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_Instruction.hpp" 27 #include "c1/c1_LinearScan.hpp" 28 #include "utilities/bitMap.inline.hpp" 27 29 28 30 void LinearScan::allocate_fpu_stack() { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2005, 20 06, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP 26 #define CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP 24 27 25 28 inline bool LinearScan::is_processed_reg_num(int reg_num) { … … 65 68 _last_reg = pd_last_callee_saved_reg; 66 69 return true; 67 } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT ) {70 } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || cur->type() == T_ADDRESS) { 68 71 _first_reg = pd_first_cpu_reg; 69 72 _last_reg = pd_last_allocatable_cpu_reg; … … 72 75 return false; 73 76 } 77 78 #endif // CPU_SPARC_VM_C1_LINEARSCAN_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_MacroAssembler_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_MacroAssembler.hpp" 27 #include "c1/c1_Runtime1.hpp" 28 #include "classfile/systemDictionary.hpp" 29 #include "gc_interface/collectedHeap.hpp" 30 #include "interpreter/interpreter.hpp" 31 #include "oops/arrayOop.hpp" 32 #include "oops/markOop.hpp" 33 #include "runtime/basicLock.hpp" 34 #include "runtime/biasedLocking.hpp" 35 #include "runtime/os.hpp" 36 #include "runtime/stubRoutines.hpp" 27 37 28 38 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { … … 31 41 // Note: needs more testing of out-of-line vs. inline slow case 32 42 verify_oop(receiver); 33 l d_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg);43 load_klass(receiver, temp_reg); 34 44 cmp(temp_reg, iCache); 35 45 brx(Assembler::equal, true, Assembler::pt, L); … … 157 167 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise 158 168 int con_size_in_bytes, // object size in bytes if known at compile time 159 Register t1, // temp register 169 Register t1, // temp register, must be global register for incr_allocated_bytes 160 170 Register t2, // temp register 161 171 Label& slow_case // continuation point if fast allocation fails 162 172 ) { 173 RegisterOrConstant size_in_bytes = var_size_in_bytes->is_valid() 174 ? RegisterOrConstant(var_size_in_bytes) : RegisterOrConstant(con_size_in_bytes); 163 175 if (UseTLAB) { 164 176 tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); 165 177 } else { 166 178 eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); 179 incr_allocated_bytes(size_in_bytes, t1, t2); 167 180 } 168 181 } … … 176 189 set((intx)markOopDesc::prototype(), t1); 177 190 } 178 st_ptr(t1 , obj, oopDesc::mark_offset_in_bytes ()); 179 st_ptr(klass, obj, oopDesc::klass_offset_in_bytes ()); 180 if (len->is_valid()) st(len , obj, arrayOopDesc::length_offset_in_bytes()); 191 st_ptr(t1, obj, oopDesc::mark_offset_in_bytes()); 192 if (UseCompressedOops) { 193 // Save klass 194 mov(klass, t1); 195 encode_heap_oop_not_null(t1); 196 stw(t1, obj, oopDesc::klass_offset_in_bytes()); 197 } else { 198 st_ptr(klass, obj, oopDesc::klass_offset_in_bytes()); 199 } 200 if (len->is_valid()) st(len, obj, arrayOopDesc::length_offset_in_bytes()); 201 else if (UseCompressedOops) { 202 store_klass_gap(G0, obj); 203 } 181 204 } 182 205 … … 195 218 Register obj, // result: pointer to object after successful allocation 196 219 Register t1, // temp register 197 Register t2, // temp register 220 Register t2, // temp register, must be a global register for try_allocate 198 221 Register t3, // temp register 199 222 int hdr_size, // object header size in words … … 226 249 Register t2 // temp register 227 250 ) { 228 const int hdr_size_in_bytes = instanceOopDesc:: base_offset_in_bytes();251 const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; 229 252 230 253 initialize_header(obj, klass, noreg, t1, t2); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP 26 #define CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP 24 27 25 28 void pd_init() { /* nothing to do */ } … … 85 88 void invalidate_registers(bool iregisters, bool lregisters, bool oregisters, 86 89 Register preserve1 = noreg, Register preserve2 = noreg); 90 91 #endif // CPU_SPARC_VM_C1_MACROASSEMBLER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_Runtime1_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "c1/c1_Defs.hpp" 27 #include "c1/c1_MacroAssembler.hpp" 28 #include "c1/c1_Runtime1.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "nativeInst_sparc.hpp" 31 #include "oops/compiledICHolderOop.hpp" 32 #include "oops/oop.inline.hpp" 33 #include "prims/jvmtiExport.hpp" 34 #include "register_sparc.hpp" 35 #include "runtime/sharedRuntime.hpp" 36 #include "runtime/signature.hpp" 37 #include "runtime/vframeArray.hpp" 38 #include "vmreg_sparc.inline.hpp" 27 39 28 40 // Implementation of StubAssembler … … 332 344 333 345 restore_live_registers(sasm); 334 __ restore(); 335 __ br(Assembler::always, false, Assembler::pt, deopt_blob->unpack_with_reexecution(), relocInfo::runtime_call_type); 336 __ delayed()->nop(); 346 347 AddressLiteral dest(deopt_blob->unpack_with_reexecution()); 348 __ jump_to(dest, O0); 349 __ delayed()->restore(); 337 350 338 351 __ bind(no_deopt); … … 437 450 // get the instance size 438 451 __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); 452 439 453 __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); 454 440 455 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); 441 456 __ verify_oop(O0_obj); … … 448 463 __ ld(G5_klass, klassOopDesc::header_size() * HeapWordSize + Klass::layout_helper_offset_in_bytes(), G1_obj_size); 449 464 __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); 465 __ incr_allocated_bytes(G1_obj_size, G3_t1, G4_t2); 466 450 467 __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); 451 468 __ verify_oop(O0_obj); … … 466 483 break; 467 484 468 #ifdef TIERED469 485 case counter_overflow_id: 470 // G4 contains bci 471 oop_maps = generate_stub_call(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), G4); 472 break; 473 #endif // TIERED 486 // G4 contains bci, G5 contains method 487 oop_maps = generate_stub_call(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), G4, G5); 488 break; 474 489 475 490 case new_type_array_id: … … 564 579 565 580 __ eden_allocate(O0_obj, G1_arr_size, 0, G3_t1, O1_t2, slow_path); // preserves G1_arr_size 581 __ incr_allocated_bytes(G1_arr_size, G3_t1, O1_t2); 566 582 567 583 __ initialize_header(O0_obj, G5_klass, G4_length, G3_t1, O1_t2); … … 603 619 Label register_finalizer; 604 620 Register t = O1; 605 __ l d_ptr(O0, oopDesc::klass_offset_in_bytes(), t);621 __ load_klass(O0, t); 606 622 __ ld(t, Klass::access_flags_offset_in_bytes() + sizeof(oopDesc), t); 607 623 __ set(JVM_ACC_HAS_FINALIZER, G3); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c1_globals_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP 26 #define CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP 27 28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/macros.hpp" 30 25 31 // Sets the default values for platform dependent flags used by the client compiler. 26 32 // (see c1_globals.hpp) … … 35 41 define_pd_global(bool, TieredCompilation, false); 36 42 define_pd_global(intx, CompileThreshold, 1000 ); // Design center runs on 1.3.1 37 define_pd_global(intx, Tier2CompileThreshold, 1500 );38 define_pd_global(intx, Tier3CompileThreshold, 2000 );39 define_pd_global(intx, Tier4CompileThreshold, 2500 );40 41 43 define_pd_global(intx, BackEdgeThreshold, 100000); 42 define_pd_global(intx, Tier2BackEdgeThreshold, 100000);43 define_pd_global(intx, Tier3BackEdgeThreshold, 100000);44 define_pd_global(intx, Tier4BackEdgeThreshold, 100000);45 44 46 45 define_pd_global(intx, OnStackReplacePercentage, 1400 ); … … 69 68 70 69 define_pd_global(intx, SafepointPollOffset, 0 ); 70 71 #endif // CPU_SPARC_VM_C1_GLOBALS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP 26 #define CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP 27 28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/macros.hpp" 30 25 31 // Sets the default values for platform dependent flags used by the server compiler. 26 32 // (see c2_globals.hpp). Alpha-sorted. … … 38 44 #endif // CC_INTERP 39 45 define_pd_global(bool, TieredCompilation, false); 40 #ifdef TIERED41 define_pd_global(intx, CompileThreshold, 1000);42 define_pd_global(intx, BackEdgeThreshold, 14000);43 #else44 46 define_pd_global(intx, CompileThreshold, 10000); 45 47 define_pd_global(intx, BackEdgeThreshold, 140000); 46 #endif // TIERED47 48 define_pd_global(intx, Tier2CompileThreshold, 10000); // unused level49 define_pd_global(intx, Tier3CompileThreshold, 10000);50 define_pd_global(intx, Tier4CompileThreshold, 40000);51 52 define_pd_global(intx, Tier2BackEdgeThreshold, 100000);53 define_pd_global(intx, Tier3BackEdgeThreshold, 100000);54 define_pd_global(intx, Tier4BackEdgeThreshold, 100000);55 48 56 49 define_pd_global(intx, OnStackReplacePercentage, 140); … … 102 95 // Ergonomics related flags 103 96 define_pd_global(bool, NeverActAsServerClassMachine, false); 97 98 #endif // CPU_SPARC_VM_C2_GLOBALS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/c2_init_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_c2_init_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "opto/compile.hpp" 27 #include "opto/node.hpp" 27 28 28 29 // processor dependent initialization for sparc -
trunk/openjdk/hotspot/src/cpu/sparc/vm/codeBuffer_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 05, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_CODEBUFFER_SPARC_HPP 26 #define CPU_SPARC_VM_CODEBUFFER_SPARC_HPP 27 25 28 private: 26 29 void pd_initialize() {} … … 31 34 // Heuristic for pre-packing the pt/pn bit of a predicted branch. 32 35 bool is_backward_branch(Label& L) { 33 return L.is_bound() && code_end() <= locator_address(L.loc());36 return L.is_bound() && insts_end() <= locator_address(L.loc()); 34 37 } 38 39 #endif // CPU_SPARC_VM_CODEBUFFER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/copy_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 08, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_COPY_SPARC_HPP 26 #define CPU_SPARC_VM_COPY_SPARC_HPP 24 27 25 28 // Inline functions for memory copy and fill. … … 187 190 (void)memset(to, 0, count); 188 191 } 192 193 #endif // CPU_SPARC_VM_COPY_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP 26 #define CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP 27 25 28 static address frame_manager_return; 26 29 static address frame_manager_sync_return; … … 33 36 const Register prev_state, 34 37 bool native); 38 39 #endif // CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2007, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_cppInterpreter_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/cppInterpreter.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "interpreter/interpreterGenerator.hpp" 31 #include "interpreter/interpreterRuntime.hpp" 32 #include "oops/arrayOop.hpp" 33 #include "oops/methodDataOop.hpp" 34 #include "oops/methodOop.hpp" 35 #include "oops/oop.inline.hpp" 36 #include "prims/jvmtiExport.hpp" 37 #include "prims/jvmtiThreadState.hpp" 38 #include "runtime/arguments.hpp" 39 #include "runtime/deoptimization.hpp" 40 #include "runtime/frame.inline.hpp" 41 #include "runtime/interfaceSupport.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "runtime/stubRoutines.hpp" 44 #include "runtime/synchronizer.hpp" 45 #include "runtime/timer.hpp" 46 #include "runtime/vframeArray.hpp" 47 #include "utilities/debug.hpp" 48 #ifdef SHARK 49 #include "shark/shark_globals.hpp" 50 #endif 27 51 28 52 #ifdef CC_INTERP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp
r278 r309 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP 26 #define CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP 27 25 28 // Size of interpreter code. Increase if too small. Interpreter will 26 29 // fail with a guarantee ("not enough space for interpreter generation"); … … 38 41 const static int InterpreterCodeSize = 180 * K; 39 42 #endif 43 44 #endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/debug_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_debug_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "code/codeCache.hpp" 27 #include "code/nmethod.hpp" 28 #include "runtime/frame.hpp" 29 #include "runtime/init.hpp" 30 #include "runtime/os.hpp" 31 #include "utilities/debug.hpp" 32 #include "utilities/top.hpp" 27 33 28 34 #ifndef PRODUCT -
trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_depChecker_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "compiler/disassembler.hpp" 27 #include "depChecker_sparc.hpp" 27 28 28 29 // Nothing to do on Sparc -
trunk/openjdk/hotspot/src/cpu/sparc/vm/depChecker_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_DEPCHECKER_SPARC_HPP 26 #define CPU_SPARC_VM_DEPCHECKER_SPARC_HPP 27 25 28 // Nothing to do on Sparc 29 30 #endif // CPU_SPARC_VM_DEPCHECKER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/disassembler_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 08, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP 26 #define CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP 27 25 28 static int pd_instruction_alignment() { 26 29 return sizeof(int); … … 31 34 (VM_Version::v8_instructions_work()? "" : "v9only") : "v8only"); 32 35 } 36 37 #endif // CPU_SPARC_VM_DISASSEMBLER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/dump_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2004, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_dump_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "assembler_sparc.inline.hpp" 27 #include "memory/compactingPermGenGen.hpp" 28 #include "memory/generation.inline.hpp" 29 #include "memory/space.inline.hpp" 27 30 28 31 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.cpp
r278 r309 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_frame_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "interpreter/interpreter.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "oops/markOop.hpp" 29 #include "oops/methodOop.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/frame.inline.hpp" 32 #include "runtime/handles.inline.hpp" 33 #include "runtime/javaCalls.hpp" 34 #include "runtime/monitorChunk.hpp" 35 #include "runtime/signature.hpp" 36 #include "runtime/stubCodeGenerator.hpp" 37 #include "runtime/stubRoutines.hpp" 38 #include "vmreg_sparc.inline.hpp" 39 #ifdef COMPILER1 40 #include "c1/c1_Runtime1.hpp" 41 #include "runtime/vframeArray.hpp" 42 #endif 27 43 28 44 void RegisterMap::pd_clear() { … … 254 270 255 271 // Could just be some random pointer within the codeBlob 256 if (!sender.cb()->instructions_contains(sender_pc)) return false; 272 if (!sender.cb()->code_contains(sender_pc)) { 273 return false; 274 } 257 275 258 276 // We should never be able to see an adapter if the current frame is something from code cache 259 260 if ( sender_blob->is_adapter_blob()) { 277 if (sender_blob->is_adapter_blob()) { 261 278 return false; 262 279 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 06, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_FRAME_SPARC_HPP 26 #define CPU_SPARC_VM_FRAME_SPARC_HPP 27 28 #include "runtime/synchronizer.hpp" 29 #include "utilities/top.hpp" 24 30 25 31 // A frame represents a physical stack frame (an activation). Frames can be … … 264 270 265 271 private: 266 267 constantPoolCacheOop* frame::interpreter_frame_cpoolcache_addr() const; 272 constantPoolCacheOop* interpreter_frame_cpoolcache_addr() const; 268 273 269 274 #ifndef CC_INTERP … … 311 316 #endif 312 317 } 318 319 #endif // CPU_SPARC_VM_FRAME_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP 26 #define CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP 24 27 25 28 // Inline functions for SPARC frames: … … 296 299 *((oop*) map->location(O0->as_VMReg())) = obj; 297 300 } 301 302 #endif // CPU_SPARC_VM_FRAME_SPARC_INLINE_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1999, 20 04, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP 26 #define CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP 27 25 28 // Size of Sparc Instructions 26 29 const int BytesPerInstWord = 4; 27 30 28 31 const int StackAlignmentInBytes = (2*wordSize); 32 33 #endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/globals_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 09, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_GLOBALS_SPARC_HPP 26 #define CPU_SPARC_VM_GLOBALS_SPARC_HPP 27 28 #include "utilities/globalDefinitions.hpp" 29 #include "utilities/macros.hpp" 24 30 25 31 // Sets the default values for platform dependent flags used by the runtime system. … … 63 69 define_pd_global(bool, RewriteBytecodes, true); 64 70 define_pd_global(bool, RewriteFrequentPairs, true); 71 72 define_pd_global(bool, UseMembar, false); 73 74 #endif // CPU_SPARC_VM_GLOBALS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_icBuffer_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "code/icBuffer.hpp" 29 #include "gc_interface/collectedHeap.inline.hpp" 30 #include "interpreter/bytecodes.hpp" 31 #include "memory/resourceArea.hpp" 32 #include "nativeInst_sparc.hpp" 33 #include "oops/oop.inline.hpp" 34 #include "oops/oop.inline2.hpp" 27 35 28 36 int InlineCacheBuffer::ic_stub_code_size() { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 04, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_icache_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "assembler_sparc.inline.hpp" 27 #include "runtime/icache.hpp" 27 28 28 29 #define __ _masm-> -
trunk/openjdk/hotspot/src/cpu/sparc/vm/icache_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 04, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_ICACHE_SPARC_HPP 26 #define CPU_SPARC_VM_ICACHE_SPARC_HPP 27 25 28 // Interface for updating the instruction cache. Whenever the VM modifies 26 29 // code, part of the processor instruction cache potentially has to be flushed. … … 37 40 // Use default implementation 38 41 }; 42 43 #endif // CPU_SPARC_VM_ICACHE_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_interp_masm_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "interp_masm_sparc.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreterRuntime.hpp" 29 #include "oops/arrayOop.hpp" 30 #include "oops/markOop.hpp" 31 #include "oops/methodDataOop.hpp" 32 #include "oops/methodOop.hpp" 33 #include "prims/jvmtiExport.hpp" 34 #include "prims/jvmtiRedefineClassesTrace.hpp" 35 #include "prims/jvmtiThreadState.hpp" 36 #include "runtime/basicLock.hpp" 37 #include "runtime/biasedLocking.hpp" 38 #include "runtime/sharedRuntime.hpp" 39 #ifdef TARGET_OS_FAMILY_linux 40 # include "thread_linux.inline.hpp" 41 #endif 42 #ifdef TARGET_OS_FAMILY_solaris 43 # include "thread_solaris.inline.hpp" 44 #endif 27 45 28 46 #ifndef CC_INTERP … … 1278 1296 // specified register to its value. 1279 1297 1280 void InterpreterMacroAssembler::set_method_data_pointer _offset(Register Roff) {1298 void InterpreterMacroAssembler::set_method_data_pointer() { 1281 1299 assert(ProfileInterpreter, "must be profiling interpreter"); 1282 1300 Label get_continue; … … 1285 1303 test_method_data_pointer(get_continue); 1286 1304 add(ImethodDataPtr, in_bytes(methodDataOopDesc::data_offset()), ImethodDataPtr); 1287 if (Roff != noreg)1288 // Roff contains a method data index ("mdi"). It defaults to zero.1289 add(ImethodDataPtr, Roff, ImethodDataPtr);1290 1305 bind(get_continue); 1291 1306 } … … 1298 1313 1299 1314 // Test MDO to avoid the call if it is NULL. 1300 ld_ptr(Lmethod, methodOopDesc::method_data_offset(), ImethodDataPtr);1315 ld_ptr(Lmethod, in_bytes(methodOopDesc::method_data_offset()), ImethodDataPtr); 1301 1316 test_method_data_pointer(zero_continue); 1302 1317 call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::bcp_to_di), Lmethod, Lbcp); 1303 set_method_data_pointer_offset(O0); 1318 add(ImethodDataPtr, in_bytes(methodDataOopDesc::data_offset()), ImethodDataPtr); 1319 add(ImethodDataPtr, O0, ImethodDataPtr); 1304 1320 bind(zero_continue); 1305 1321 } … … 1352 1368 1353 1369 void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocation_count, 1354 Register cur_bcp,1355 1370 Register Rtmp, 1356 1371 Label &profile_continue) { … … 1383 1398 1384 1399 // Build it now. 1385 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method) , cur_bcp);1386 set_method_data_pointer_ offset(O0);1400 call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); 1401 set_method_data_pointer_for_bcp(); 1387 1402 ba(false, profile_continue); 1388 1403 delayed()->nop(); … … 2432 2447 #endif // CC_INTERP 2433 2448 } 2449 2450 // Jump if ((*counter_addr += increment) & mask) satisfies the condition. 2451 void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, 2452 int increment, int mask, 2453 Register scratch1, Register scratch2, 2454 Condition cond, Label *where) { 2455 ld(counter_addr, scratch1); 2456 add(scratch1, increment, scratch1); 2457 if (is_simm13(mask)) { 2458 andcc(scratch1, mask, G0); 2459 } else { 2460 set(mask, scratch2); 2461 andcc(scratch1, scratch2, G0); 2462 } 2463 br(cond, false, Assembler::pn, *where); 2464 delayed()->st(scratch1, counter_addr); 2465 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_INTERP_MASM_SPARC_HPP 26 #define CPU_SPARC_VM_INTERP_MASM_SPARC_HPP 27 28 #include "assembler_sparc.inline.hpp" 29 #include "interpreter/invocationCounter.hpp" 24 30 25 31 // This file specializes the assember with interpreter-specific macros … … 264 270 #ifndef CC_INTERP 265 271 // Interpreter profiling operations 266 void set_method_data_pointer() { set_method_data_pointer_offset(noreg); }272 void set_method_data_pointer(); 267 273 void set_method_data_pointer_for_bcp(); 268 void set_method_data_pointer_offset(Register mdi_reg);269 274 void test_method_data_pointer(Label& zero_continue); 270 275 void verify_method_data_pointer(); 271 void test_invocation_counter_for_mdp(Register invocation_count, Register cur_bcp, RegisterRtmp, Label &profile_continue);276 void test_invocation_counter_for_mdp(Register invocation_count, Register Rtmp, Label &profile_continue); 272 277 273 278 void set_mdp_data_at(int constant, Register value); … … 279 284 Register bumped_count, Register scratch2, 280 285 bool decrement = false); 286 void increment_mask_and_jump(Address counter_addr, 287 int increment, int mask, 288 Register scratch1, Register scratch2, 289 Condition cond, Label *where); 281 290 void set_mdp_flag_at(int flag_constant, Register scratch); 282 291 void test_mdp_data_at(int offset, Register value, Label& not_equal_continue, … … 322 331 void save_return_value(TosState state, bool is_native_call); 323 332 void restore_return_value(TosState state, bool is_native_call); 333 324 334 }; 335 336 #endif // CPU_SPARC_VM_INTERP_MASM_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP 26 #define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP 27 25 28 friend class AbstractInterpreterGenerator; 26 29 … … 40 43 void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); 41 44 void generate_counter_overflow(Label& Lcontinue); 45 46 #endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_interpreterRT_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "interpreter/interpreter.hpp" 27 #include "interpreter/interpreterRuntime.hpp" 28 #include "memory/allocation.inline.hpp" 29 #include "memory/universe.inline.hpp" 30 #include "oops/methodOop.hpp" 31 #include "oops/oop.inline.hpp" 32 #include "runtime/handles.inline.hpp" 33 #include "runtime/icache.hpp" 34 #include "runtime/interfaceSupport.hpp" 35 #include "runtime/signature.hpp" 27 36 28 37 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreterRT_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 05, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP 26 #define CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP 27 28 #include "memory/allocation.hpp" 24 29 25 30 static int binary_search(int key, LookupswitchPair* array, int n); … … 55 60 void generate( uint64_t fingerprint ); 56 61 }; 62 63 #endif // CPU_SPARC_VM_INTERPRETERRT_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_interpreter_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterGenerator.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "interpreter/templateTable.hpp" 32 #include "oops/arrayOop.hpp" 33 #include "oops/methodDataOop.hpp" 34 #include "oops/methodOop.hpp" 35 #include "oops/oop.inline.hpp" 36 #include "prims/jvmtiExport.hpp" 37 #include "prims/jvmtiThreadState.hpp" 38 #include "prims/methodHandles.hpp" 39 #include "runtime/arguments.hpp" 40 #include "runtime/deoptimization.hpp" 41 #include "runtime/frame.inline.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "runtime/stubRoutines.hpp" 44 #include "runtime/synchronizer.hpp" 45 #include "runtime/timer.hpp" 46 #include "runtime/vframeArray.hpp" 47 #include "utilities/debug.hpp" 48 #ifdef COMPILER1 49 #include "c1/c1_Runtime1.hpp" 50 #endif 27 51 28 52 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp
r278 r309 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_INTERPRETER_SPARC_HPP 26 #define CPU_SPARC_VM_INTERPRETER_SPARC_HPP 27 25 28 public: 26 29 … … 35 38 return stackElementWords * i; 36 39 } 40 41 #endif // CPU_SPARC_VM_INTERPRETER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 05, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP 26 #define CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP 24 27 25 28 private: … … 98 101 OrderAccess::fence(); 99 102 } 103 104 #endif // CPU_SPARC_VM_JAVAFRAMEANCHOR_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2004, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_jniFastGetField_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "assembler_sparc.inline.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "prims/jniFastGetField.hpp" 29 #include "prims/jvm_misc.hpp" 30 #include "runtime/safepoint.hpp" 27 31 28 32 // TSO ensures that loads are blocking and ordered with respect to … … 51 55 } 52 56 ResourceMark rm; 53 BufferBlob* b = BufferBlob::create(name, BUFFER_SIZE*wordSize); 54 address fast_entry = b->instructions_begin(); 55 CodeBuffer cbuf(fast_entry, b->instructions_size()); 57 BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize); 58 CodeBuffer cbuf(blob); 56 59 MacroAssembler* masm = new MacroAssembler(&cbuf); 60 address fast_entry = __ pc(); 57 61 58 62 Label label1, label2; … … 130 134 const char *name = "jni_fast_GetLongField"; 131 135 ResourceMark rm; 132 BufferBlob* b = BufferBlob::create(name, BUFFER_SIZE*wordSize); 133 address fast_entry = b->instructions_begin(); 134 CodeBuffer cbuf(fast_entry, b->instructions_size()); 136 BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize); 137 CodeBuffer cbuf(blob); 135 138 MacroAssembler* masm = new MacroAssembler(&cbuf); 139 address fast_entry = __ pc(); 136 140 137 141 Label label1, label2; … … 202 206 } 203 207 ResourceMark rm; 204 BufferBlob* b = BufferBlob::create(name, BUFFER_SIZE*wordSize); 205 address fast_entry = b->instructions_begin(); 206 CodeBuffer cbuf(fast_entry, b->instructions_size()); 208 BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE*wordSize); 209 CodeBuffer cbuf(blob); 207 210 MacroAssembler* masm = new MacroAssembler(&cbuf); 211 address fast_entry = __ pc(); 208 212 209 213 Label label1, label2; -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jniTypes_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 02, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_JNITYPES_SPARC_HPP 26 #define CPU_SPARC_VM_JNITYPES_SPARC_HPP 27 28 #include "memory/allocation.hpp" 29 #include "oops/oop.hpp" 30 #include "prims/jni.h" 24 31 25 32 // This file holds platform-dependent routines used to write primitive jni … … 107 114 108 115 }; 116 117 #endif // CPU_SPARC_VM_JNITYPES_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/jni_sparc.h
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * -
trunk/openjdk/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2008, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_methodHandles_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "interpreter/interpreter.hpp" 27 #include "memory/allocation.inline.hpp" 28 #include "prims/methodHandles.hpp" 27 29 28 30 #define __ _masm-> 31 32 #ifdef PRODUCT 33 #define BLOCK_COMMENT(str) /* nothing */ 34 #else 35 #define BLOCK_COMMENT(str) __ block_comment(str) 36 #endif 37 38 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") 29 39 30 40 address MethodHandleEntry::start_compiled_entry(MacroAssembler* _masm, … … 63 73 // Code generation 64 74 address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* _masm) { 65 // I5_savedSP : sender SP (must preserve)75 // I5_savedSP/O5_savedSP: sender SP (must preserve) 66 76 // G4 (Gargs): incoming argument list (must preserve) 67 // G5_method: invoke methodOop ; becomes method type.77 // G5_method: invoke methodOop 68 78 // G3_method_handle: receiver method handle (must load from sp[MethodTypeForm.vmslots]) 69 // O0, O1 : garbage temps, blown away70 Register O0_ argslot= O0;79 // O0, O1, O2, O3, O4: garbage temps, blown away 80 Register O0_mtype = O0; 71 81 Register O1_scratch = O1; 82 Register O2_scratch = O2; 83 Register O3_scratch = O3; 84 Register O4_argslot = O4; 85 Register O4_argbase = O4; 72 86 73 87 // emit WrongMethodType path first, to enable back-branch from main path 74 88 Label wrong_method_type; 75 89 __ bind(wrong_method_type); 90 Label invoke_generic_slow_path; 91 assert(methodOopDesc::intrinsic_id_size_in_bytes() == sizeof(u1), "");; 92 __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); 93 __ cmp(O1_scratch, (int) vmIntrinsics::_invokeExact); 94 __ brx(Assembler::notEqual, false, Assembler::pt, invoke_generic_slow_path); 95 __ delayed()->nop(); 96 __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType 97 // mov(G3_method_handle, G3_method_handle); // already in this register 76 98 __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch); 77 99 __ delayed()->nop(); … … 81 103 address entry_point = __ pc(); 82 104 83 // fetch the MethodType from the method handle into G5_method_type105 // fetch the MethodType from the method handle 84 106 { 85 107 Register tem = G5_method; 86 assert(tem == G5_method_type, "yes, it's the same register");87 108 for (jint* pchase = methodOopDesc::method_type_offsets_chain(); (*pchase) != -1; pchase++) { 88 __ ld_ptr(Address(tem, *pchase), G5_method_type); 109 __ ld_ptr(Address(tem, *pchase), O0_mtype); 110 tem = O0_mtype; // in case there is another indirection 89 111 } 90 112 } 91 113 92 114 // 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); 115 __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O4_argslot); 116 __ ldsw( Address(O4_argslot, __ delayed_value(java_dyn_MethodTypeForm::vmslots_offset_in_bytes, O1_scratch)), O4_argslot); 117 __ add(Gargs, __ argument_offset(O4_argslot, 1), O4_argbase); 118 // Note: argument_address uses its input as a scratch register! 119 __ ld_ptr(Address(O4_argbase, -Interpreter::stackElementSize), G3_method_handle); 120 121 trace_method_handle(_masm, "invokeExact"); 122 123 __ check_method_handle_type(O0_mtype, G3_method_handle, O1_scratch, wrong_method_type); 98 124 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 125 126 // for invokeGeneric (only), apply argument and result conversions on the fly 127 __ bind(invoke_generic_slow_path); 128 #ifdef ASSERT 129 { Label L; 130 __ ldub(Address(G5_method, methodOopDesc::intrinsic_id_offset_in_bytes()), O1_scratch); 131 __ cmp(O1_scratch, (int) vmIntrinsics::_invokeGeneric); 132 __ brx(Assembler::equal, false, Assembler::pt, L); 133 __ delayed()->nop(); 134 __ stop("bad methodOop::intrinsic_id"); 135 __ bind(L); 136 } 137 #endif //ASSERT 138 139 // make room on the stack for another pointer: 140 insert_arg_slots(_masm, 2 * stack_move_unit(), _INSERT_REF_MASK, O4_argbase, O1_scratch, O2_scratch, O3_scratch); 141 // load up an adapter from the calling type (Java weaves this) 142 Register O2_form = O2_scratch; 143 Register O3_adapter = O3_scratch; 144 __ load_heap_oop(Address(O0_mtype, __ delayed_value(java_dyn_MethodType::form_offset_in_bytes, O1_scratch)), O2_form); 145 // load_heap_oop(Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter); 146 // deal with old JDK versions: 147 __ add( Address(O2_form, __ delayed_value(java_dyn_MethodTypeForm::genericInvoker_offset_in_bytes, O1_scratch)), O3_adapter); 148 __ cmp(O3_adapter, O2_form); 149 Label sorry_no_invoke_generic; 150 __ brx(Assembler::lessUnsigned, false, Assembler::pn, sorry_no_invoke_generic); 151 __ delayed()->nop(); 152 153 __ load_heap_oop(Address(O3_adapter, 0), O3_adapter); 154 __ tst(O3_adapter); 155 __ brx(Assembler::zero, false, Assembler::pn, sorry_no_invoke_generic); 156 __ delayed()->nop(); 157 __ st_ptr(O3_adapter, Address(O4_argbase, 1 * Interpreter::stackElementSize)); 158 // As a trusted first argument, pass the type being called, so the adapter knows 159 // the actual types of the arguments and return values. 160 // (Generic invokers are shared among form-families of method-type.) 161 __ st_ptr(O0_mtype, Address(O4_argbase, 0 * Interpreter::stackElementSize)); 162 // FIXME: assert that O3_adapter is of the right method-type. 163 __ mov(O3_adapter, G3_method_handle); 164 trace_method_handle(_masm, "invokeGeneric"); 165 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 166 167 __ bind(sorry_no_invoke_generic); // no invokeGeneric implementation available! 168 __ mov(O0_mtype, G5_method_type); // required by throw_WrongMethodType 169 // mov(G3_method_handle, G3_method_handle); // already in this register 170 __ jump_to(AddressLiteral(Interpreter::throw_WrongMethodType_entry()), O1_scratch); 171 __ delayed()->nop(); 99 172 100 173 return entry_point; … … 106 179 // Verify that argslot lies within (Gargs, FP]. 107 180 Label L_ok, L_bad; 181 BLOCK_COMMENT("{ verify_argslot"); 108 182 #ifdef _LP64 109 183 __ add(FP, STACK_BIAS, temp_reg); … … 120 194 __ stop(error_message); 121 195 __ bind(L_ok); 196 BLOCK_COMMENT("} verify_argslot"); 122 197 } 123 198 #endif … … 176 251 // temp[-size] = temp[0] 177 252 // argslot -= size; 253 BLOCK_COMMENT("insert_arg_slots {"); 178 254 RegisterOrConstant offset = __ regcon_sll_ptr(arg_slots, LogBytesPerWord, temp3_reg); 179 255 … … 188 264 { 189 265 Label loop; 190 __ bind(loop);266 __ BIND(loop); 191 267 // pull one word down each time through the loop 192 268 __ ld_ptr(Address(temp_reg, 0), temp2_reg); … … 200 276 // Now move the argslot down, to point to the opened-up space. 201 277 __ add(argslot_reg, offset, argslot_reg); 278 BLOCK_COMMENT("} insert_arg_slots"); 202 279 } 203 280 … … 236 313 #endif // ASSERT 237 314 315 BLOCK_COMMENT("remove_arg_slots {"); 238 316 // Pull up everything shallower than argslot. 239 317 // Then remove the excess space on the stack. … … 247 325 { 248 326 Label loop; 249 __ bind(loop);327 __ BIND(loop); 250 328 // pull one word up each time through the loop 251 329 __ ld_ptr(Address(temp_reg, 0), temp2_reg); … … 266 344 RegisterOrConstant masked_offset = __ regcon_andn_ptr(offset, TwoWordAlignmentMask, temp_reg); 267 345 __ add(SP, masked_offset, SP); 346 BLOCK_COMMENT("} remove_arg_slots"); 268 347 } 269 348 … … 272 351 extern "C" void print_method_handle(oop mh); 273 352 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 353 oopDesc* mh) { 288 354 printf("MH %s mh="INTPTR_FORMAT"\n", adaptername, (intptr_t) mh); 289 355 print_method_handle(mh); 356 } 357 void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { 358 if (!TraceMethodHandles) return; 359 BLOCK_COMMENT("trace_method_handle {"); 360 // save: Gargs, O5_savedSP 361 __ save_frame(16); 362 __ set((intptr_t) adaptername, O0); 363 __ mov(G3_method_handle, O1); 364 __ mov(G3_method_handle, L3); 365 __ mov(Gargs, L4); 366 __ mov(G5_method_type, L5); 367 __ call_VM_leaf(L7, CAST_FROM_FN_PTR(address, trace_method_handle_stub)); 368 369 __ mov(L3, G3_method_handle); 370 __ mov(L4, Gargs); 371 __ mov(L5, G5_method_type); 372 __ restore(); 373 BLOCK_COMMENT("} trace_method_handle"); 290 374 } 291 375 #endif // PRODUCT … … 319 403 // - O5_savedSP: sender SP (must preserve) 320 404 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; 405 const Register O0_argslot = O0; 406 const Register O1_scratch = O1; 407 const Register O2_scratch = O2; 408 const Register O3_scratch = O3; 409 const Register G5_index = G5; 410 411 // Argument registers for _raise_exception. 412 const Register O0_code = O0; 413 const Register O1_actual = O1; 414 const Register O2_required = O2; 326 415 327 416 guarantee(java_dyn_MethodHandle::vmentry_offset_in_bytes() != 0, "must have offsets"); … … 349 438 350 439 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 440 441 trace_method_handle(_masm, entry_name(ek)); 363 442 364 443 switch ((int) ek) { … … 366 445 { 367 446 // 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. 447 // exception. Since we use a C2I adapter to set up the 448 // interpreter state, arguments are expected in compiler 449 // argument registers. 450 assert(raise_exception_method(), "must be set"); 451 address c2i_entry = raise_exception_method()->get_c2i_entry(); 452 assert(c2i_entry, "method must be linked"); 371 453 372 454 __ mov(O5_savedSP, SP); // Cut the stack back to where the caller started. 373 455 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; 456 Label L_no_method; 389 457 // FIXME: fill in _raise_exception_method with a suitable sun.dyn method 390 458 __ set(AddressLiteral((address) &_raise_exception_method), G5_method); 391 459 __ ld_ptr(Address(G5_method, 0), G5_method); 392 460 __ tst(G5_method); 393 __ brx(Assembler::zero, false, Assembler::pn, no_method);461 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); 394 462 __ delayed()->nop(); 395 463 396 int jobject_oop_offset = 0;464 const int jobject_oop_offset = 0; 397 465 __ ld_ptr(Address(G5_method, jobject_oop_offset), G5_method); 398 466 __ tst(G5_method); 399 __ brx(Assembler::zero, false, Assembler::pn, no_method);467 __ brx(Assembler::zero, false, Assembler::pn, L_no_method); 400 468 __ delayed()->nop(); 401 469 402 470 __ verify_oop(G5_method); 403 __ jump_ indirect_to(G5_method_fie, O1_scratch);471 __ jump_to(AddressLiteral(c2i_entry), O3_scratch); 404 472 __ delayed()->nop(); 405 473 406 474 // If we get here, the Java runtime did not do its job of creating the exception. 407 475 // Do something that is at least causes a valid throw from the interpreter. 408 __ bind( no_method);409 __ unimplemented(" _raise_exception no method");476 __ bind(L_no_method); 477 __ unimplemented("call throw_WrongMethodType_entry"); 410 478 } 411 479 break; … … 414 482 case _invokespecial_mh: 415 483 { 416 __ l d_ptr(G3_mh_vmtarget, G5_method); // target is a methodOop484 __ load_heap_oop(G3_mh_vmtarget, G5_method); // target is a methodOop 417 485 __ verify_oop(G5_method); 418 486 // Same as TemplateTable::invokestatic or invokespecial, … … 469 537 __ load_method_handle_vmslots(O0_argslot, G3_method_handle, O1_scratch); 470 538 Register O1_intf = O1_scratch; 471 __ l d_ptr(G3_mh_vmtarget, O1_intf);539 __ load_heap_oop(G3_mh_vmtarget, O1_intf); 472 540 __ ldsw(G3_dmh_vmindex, G5_index); 473 541 __ ld_ptr(__ argument_address(O0_argslot, -1), G3_method_handle); … … 497 565 // For historical reasons, it will be IncompatibleClassChangeError. 498 566 __ unimplemented("not tested yet"); 499 __ ld_ptr(Address(O1_intf, java_mirror_offset), O 3_scratch); // required interface500 __ mov( O0_klass, O2_scratch);// bad receiver501 __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O 0_argslot);502 __ delayed()->mov(Bytecodes::_invokeinterface, O1_scratch);// who is complaining?567 __ ld_ptr(Address(O1_intf, java_mirror_offset), O2_required); // required interface 568 __ mov( O0_klass, O1_actual); // bad receiver 569 __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O3_scratch); 570 __ delayed()->mov(Bytecodes::_invokeinterface, O0_code); // who is complaining? 503 571 } 504 572 break; … … 524 592 525 593 // Store bound argument into the new stack slot: 526 __ l d_ptr(G3_bmh_argument, O1_scratch);594 __ load_heap_oop(G3_bmh_argument, O1_scratch); 527 595 if (arg_type == T_OBJECT) { 528 596 __ st_ptr(O1_scratch, Address(O0_argslot, 0)); … … 542 610 543 611 if (direct_to_method) { 544 __ l d_ptr(G3_mh_vmtarget, G5_method); // target is a methodOop612 __ load_heap_oop(G3_mh_vmtarget, G5_method); // target is a methodOop 545 613 __ verify_oop(G5_method); 546 614 __ jump_indirect_to(G5_method_fie, O1_scratch); 547 615 __ delayed()->nop(); 548 616 } else { 549 __ l d_ptr(G3_mh_vmtarget, G3_method_handle); // target is a methodOop617 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); // target is a methodOop 550 618 __ verify_oop(G3_method_handle); 551 619 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); … … 557 625 case _adapter_retype_raw: 558 626 // Immediately jump to the next MH layer: 559 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);627 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 560 628 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 561 629 // This is OK when all parameter types widen. … … 573 641 574 642 // What class are we casting to? 575 __ l d_ptr(G3_amh_argument, G5_klass); // This is a Class object!576 __ l d_ptr(Address(G5_klass, java_lang_Class::klass_offset_in_bytes()), G5_klass);643 __ load_heap_oop(G3_amh_argument, G5_klass); // This is a Class object! 644 __ load_heap_oop(Address(G5_klass, java_lang_Class::klass_offset_in_bytes()), G5_klass); 577 645 578 646 Label done; … … 590 658 591 659 // 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? 660 __ load_heap_oop(G3_amh_argument, O2_required); // required class 661 __ ld_ptr( vmarg, O1_actual); // bad object 662 __ jump_to(AddressLiteral(from_interpreted_entry(_raise_exception)), O3_scratch); 663 __ delayed()->mov(Bytecodes::_checkcast, O0_code); // who is complaining? 597 664 598 665 __ bind(done); 599 666 // Get the new MH: 600 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);667 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 601 668 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 602 669 } … … 616 683 // Perform an in-place conversion to int or an int subword. 617 684 __ ldsw(G3_amh_vmargslot, O0_argslot); 685 Address value; 618 686 Address vmarg = __ argument_address(O0_argslot); 619 Address value;620 687 bool value_left_justified = false; 621 688 622 689 switch (ek) { 623 690 case _adapter_opt_i2i: 691 value = vmarg; 692 break; 624 693 case _adapter_opt_l2i: 625 __ unimplemented(entry_name(ek)); 626 value = vmarg; 694 { 695 // just delete the extra slot 696 #ifdef _LP64 697 // In V9, longs are given 2 64-bit slots in the interpreter, but the 698 // data is passed in only 1 slot. 699 // Keep the second slot. 700 __ add(Gargs, __ argument_offset(O0_argslot, -1), O0_argslot); 701 remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch); 702 value = Address(O0_argslot, 4); // Get least-significant 32-bit of 64-bit value. 703 vmarg = Address(O0_argslot, Interpreter::stackElementSize); 704 #else 705 // Keep the first slot. 706 __ add(Gargs, __ argument_offset(O0_argslot), O0_argslot); 707 remove_arg_slots(_masm, -stack_move_unit(), O0_argslot, O1_scratch, O2_scratch, O3_scratch); 708 value = Address(O0_argslot, 0); 709 vmarg = value; 710 #endif 711 } 627 712 break; 628 713 case _adapter_opt_unboxi: … … 677 762 678 763 // Get the new MH: 679 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);764 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 680 765 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 681 766 } … … 722 807 } 723 808 724 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);809 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 725 810 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 726 811 } … … 852 937 } 853 938 854 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);939 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 855 940 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 856 941 } … … 896 981 __ delayed()->nop(); // FILLME 897 982 898 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);983 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 899 984 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 900 985 } … … 914 999 remove_arg_slots(_masm, G5_stack_move, O0_argslot, O1_scratch, O2_scratch, O3_scratch); 915 1000 916 __ l d_ptr(G3_mh_vmtarget, G3_method_handle);1001 __ load_heap_oop(G3_mh_vmtarget, G3_method_handle); 917 1002 __ jump_to_method_handle_entry(G3_method_handle, O1_scratch); 918 1003 } -
trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp
r278 r309 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_nativeInst_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "assembler_sparc.inline.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "nativeInst_sparc.hpp" 29 #include "oops/oop.inline.hpp" 30 #include "runtime/handles.hpp" 31 #include "runtime/sharedRuntime.hpp" 32 #include "runtime/stubRoutines.hpp" 33 #include "utilities/ostream.hpp" 34 #ifdef COMPILER1 35 #include "c1/c1_Runtime1.hpp" 36 #endif 27 37 28 38 … … 194 204 a->call( a->pc(), relocInfo::none ); 195 205 a->delayed()->nop(); 196 nc = nativeCall_at( cb. code_begin() );206 nc = nativeCall_at( cb.insts_begin() ); 197 207 nc->print(); 198 208 199 209 nc = nativeCall_overwriting_at( nc->next_instruction_address() ); 200 210 for (idx = 0; idx < ARRAY_SIZE(offsets); idx++) { 201 nc->set_destination( cb. code_begin() + offsets[idx] );202 assert(nc->destination() == (cb. code_begin() + offsets[idx]), "check unit test");211 nc->set_destination( cb.insts_begin() + offsets[idx] ); 212 assert(nc->destination() == (cb.insts_begin() + offsets[idx]), "check unit test"); 203 213 nc->print(); 204 214 } 205 215 206 nc = nativeCall_before( cb. code_begin() + 8 );216 nc = nativeCall_before( cb.insts_begin() + 8 ); 207 217 nc->print(); 208 218 … … 369 379 a->add(O2, al2.low10(), O2); 370 380 371 nm = nativeMovConstReg_at( cb. code_begin() );381 nm = nativeMovConstReg_at( cb.insts_begin() ); 372 382 nm->print(); 373 383 … … 481 491 a->add(O2, al2.low10(), O2); 482 492 483 nm = nativeMovConstRegPatching_at( cb. code_begin() );493 nm = nativeMovConstRegPatching_at( cb.insts_begin() ); 484 494 nm->print(); 485 495 … … 617 627 a->stf( FloatRegisterImpl::S, F15, O0, I3 ); idx++; 618 628 619 nm = nativeMovRegMem_at( cb. code_begin() );629 nm = nativeMovRegMem_at( cb.insts_begin() ); 620 630 nm->print(); 621 631 nm->set_offset( low10(0) ); … … 761 771 a->stf( FloatRegisterImpl::S, F15, O0, I3 ); idx++; 762 772 763 nm = nativeMovRegMemPatching_at( cb. code_begin() );773 nm = nativeMovRegMemPatching_at( cb.insts_begin() ); 764 774 nm->print(); 765 775 nm->set_offset( low10(0) ); … … 850 860 a->delayed()->nop(); 851 861 852 nj = nativeJump_at( cb. code_begin() );862 nj = nativeJump_at( cb.insts_begin() ); 853 863 nj->print(); 854 864 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/nativeInst_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 08, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP 26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP 27 28 #include "asm/assembler.hpp" 29 #include "memory/allocation.hpp" 30 #include "runtime/icache.hpp" 31 #include "runtime/os.hpp" 32 #include "utilities/top.hpp" 24 33 25 34 // We have interface for the following instructions: … … 914 923 static void insert(address code_pos); 915 924 }; 925 926 #endif // CPU_SPARC_VM_NATIVEINST_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/registerMap_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 07, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_REGISTERMAP_SPARC_HPP 26 #define CPU_SPARC_VM_REGISTERMAP_SPARC_HPP 24 27 25 28 // machine-dependent implemention for register maps … … 52 55 // When popping out of compiled frames, we make all IRegs disappear. 53 56 void make_integer_regs_unsaved() { _location_valid[0] = 0; } 57 58 #endif // CPU_SPARC_VM_REGISTERMAP_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp
r278 r309 26 26 #define DONT_USE_REGISTER_DEFINES 27 27 28 #include "incls/_precompiled.incl" 29 #include "incls/_register_definitions_sparc.cpp.incl" 28 #include "precompiled.hpp" 29 #include "asm/assembler.hpp" 30 #include "asm/register.hpp" 31 #include "interp_masm_sparc.hpp" 32 #include "register_sparc.hpp" 30 33 31 34 REGISTER_DEFINITION(Register, noreg); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include " incls/_precompiled.incl"26 #include " incls/_register_sparc.cpp.incl"25 #include "precompiled.hpp" 26 #include "register_sparc.hpp" 27 27 28 28 const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers << 1; -
trunk/openjdk/hotspot/src/cpu/sparc/vm/register_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 07, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_REGISTER_SPARC_HPP 26 #define CPU_SPARC_VM_REGISTER_SPARC_HPP 27 28 #include "asm/register.hpp" 29 #include "vm_version_sparc.hpp" 24 30 25 31 // forward declaration … … 441 447 } 442 448 }; 449 450 #endif // CPU_SPARC_VM_REGISTER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_relocInfo_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.inline.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "code/relocInfo.hpp" 29 #include "nativeInst_sparc.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/safepoint.hpp" 27 32 28 33 void Relocation::pd_set_data_value(address x, intptr_t o) { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/relocInfo_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 08, Oracle and/or its affiliates. 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 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_RELOCINFO_SPARC_HPP 26 #define CPU_SPARC_VM_RELOCINFO_SPARC_HPP 24 27 25 28 // machine-dependent parts of class relocInfo … … 50 53 // 1.9 99/07/16 11:12:11 relocInfo_i486.hpp 51 54 //End 55 56 #endif // CPU_SPARC_VM_RELOCINFO_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/runtime_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_runtime_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #ifdef COMPILER2 27 #include "asm/assembler.hpp" 28 #include "assembler_sparc.inline.hpp" 29 #include "classfile/systemDictionary.hpp" 30 #include "code/vmreg.hpp" 31 #include "interpreter/interpreter.hpp" 32 #include "nativeInst_sparc.hpp" 33 #include "opto/runtime.hpp" 34 #include "runtime/interfaceSupport.hpp" 35 #include "runtime/sharedRuntime.hpp" 36 #include "runtime/stubRoutines.hpp" 37 #include "runtime/vframeArray.hpp" 38 #include "utilities/globalDefinitions.hpp" 39 #include "vmreg_sparc.inline.hpp" 40 #endif 27 41 28 42 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_sharedRuntime_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "code/debugInfoRec.hpp" 29 #include "code/icBuffer.hpp" 30 #include "code/vtableStubs.hpp" 31 #include "interpreter/interpreter.hpp" 32 #include "oops/compiledICHolderOop.hpp" 33 #include "prims/jvmtiRedefineClassesTrace.hpp" 34 #include "runtime/sharedRuntime.hpp" 35 #include "runtime/vframeArray.hpp" 36 #include "vmreg_sparc.inline.hpp" 37 #ifdef COMPILER1 38 #include "c1/c1_Runtime1.hpp" 39 #endif 40 #ifdef COMPILER2 41 #include "opto/runtime.hpp" 42 #endif 43 #ifdef SHARK 44 #include "compiler/compileBroker.hpp" 45 #include "shark/sharkCompiler.hpp" 46 #endif 27 47 28 48 #define __ masm-> … … 3332 3352 #if !defined(_LP64) 3333 3353 #if defined(COMPILER2) 3334 if (!TieredCompilation) { 3335 // 32-bit 1-register longs return longs in G1 3336 __ stx(Greturn1, saved_Greturn1_addr); 3337 } 3354 // 32-bit 1-register longs return longs in G1 3355 __ stx(Greturn1, saved_Greturn1_addr); 3338 3356 #endif 3339 3357 __ set_last_Java_frame(SP, noreg); … … 3348 3366 __ ldf(FloatRegisterImpl::D, saved_Freturn0_addr, Freturn0); 3349 3367 3350 // In tiered we never use C2 to compile methods returning longs so3351 // the result is where we expect it already.3352 3353 3368 #if !defined(_LP64) && defined(COMPILER2) 3354 3369 // In 32 bit, C2 returns longs in G1 so restore the saved G1 into 3355 // I0/I1 if the return value is long. In the tiered world there is 3356 // a mismatch between how C1 and C2 return longs compiles and so 3357 // currently compilation of methods which return longs is disabled 3358 // for C2 and so is this code. Eventually C1 and C2 will do the 3359 // same thing for longs in the tiered world. 3360 if (!TieredCompilation) { 3361 Label not_long; 3362 __ cmp(O0,T_LONG); 3363 __ br(Assembler::notEqual, false, Assembler::pt, not_long); 3364 __ delayed()->nop(); 3365 __ ldd(saved_Greturn1_addr,I0); 3366 __ bind(not_long); 3367 } 3370 // I0/I1 if the return value is long. 3371 Label not_long; 3372 __ cmp(O0,T_LONG); 3373 __ br(Assembler::notEqual, false, Assembler::pt, not_long); 3374 __ delayed()->nop(); 3375 __ ldd(saved_Greturn1_addr,I0); 3376 __ bind(not_long); 3368 3377 #endif 3369 3378 __ ret(); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/sparc.ad
r278 r309 1 1 // 2 // Copyright (c) 1998, 201 0, Oracle and/or its affiliates. All rights reserved.2 // Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 // … … 576 576 int MachCallRuntimeNode::ret_addr_offset() { 577 577 #ifdef _LP64 578 return NativeFarCall::instruction_size; // farcall; delay slot 578 if (MacroAssembler::is_far_target(entry_point())) { 579 return NativeFarCall::instruction_size; 580 } else { 581 return NativeCall::instruction_size; 582 } 579 583 #else 580 584 return NativeCall::instruction_size; // call; delay slot … … 668 672 } 669 673 674 static inline jdouble replicate_immI(int con, int count, int width) { 675 // Load a constant replicated "count" times with width "width" 676 int bit_width = width * 8; 677 jlong elt_val = con; 678 elt_val &= (((jlong) 1) << bit_width) - 1; // mask off sign bits 679 jlong val = elt_val; 680 for (int i = 0; i < count - 1; i++) { 681 val <<= bit_width; 682 val |= elt_val; 683 } 684 jdouble dval = *((jdouble*) &val); // coerce to double type 685 return dval; 686 } 687 670 688 // Standard Sparc opcode form2 field breakdown 671 689 static inline void emit2_19(CodeBuffer &cbuf, int f30, int f29, int f25, int f22, int f20, int f19, int f0 ) { … … 678 696 (f19 << 19) | 679 697 (f0 << 0); 680 *((int*)(cbuf.code_end())) = op; 681 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 698 cbuf.insts()->emit_int32(op); 682 699 } 683 700 … … 690 707 (f22 << 22) | 691 708 (f0 << 0); 692 *((int*)(cbuf.code_end())) = op; 693 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 709 cbuf.insts()->emit_int32(op); 694 710 } 695 711 … … 702 718 (f5 << 5) | 703 719 (f0 << 0); 704 *((int*)(cbuf.code_end())) = op; 705 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 720 cbuf.insts()->emit_int32(op); 706 721 } 707 722 … … 715 730 (1 << 13) | // bit to indicate immediate-mode 716 731 (simm13<<0); 717 *((int*)(cbuf.code_end())) = op; 718 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 732 cbuf.insts()->emit_int32(op); 719 733 } 720 734 … … 911 925 } 912 926 913 uint *code = (uint*)cbuf.code_end(); 914 *code = instr; 915 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 927 cbuf.insts()->emit_int32(instr); 916 928 917 929 #ifdef ASSERT … … 934 946 } 935 947 936 void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false , bool force_far_call = false) {948 void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false) { 937 949 // The method which records debug information at every safepoint 938 950 // expects the call to be the first instruction in the snippet as … … 956 968 #endif /* ASSERT */ 957 969 958 #ifdef _LP64 959 // Calls to the runtime or native may not be reachable from compiled code, 960 // so we generate the far call sequence on 64 bit sparc. 961 // This code sequence is relocatable to any address, even on LP64. 962 if ( force_far_call ) { 963 __ relocate(rtype); 964 AddressLiteral dest(entry_point); 965 __ jumpl_to(dest, O7, O7); 966 } 967 else 968 #endif 969 { 970 __ call((address)entry_point, rtype); 971 } 970 __ call((address)entry_point, rtype); 972 971 973 972 if (preserve_g2) __ delayed()->mov(G2, L7); … … 1015 1014 1016 1015 //============================================================================= 1016 const bool Matcher::constant_table_absolute_addressing = false; 1017 const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask; 1018 1019 void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { 1020 Compile* C = ra_->C; 1021 Compile::ConstantTable& constant_table = C->constant_table(); 1022 MacroAssembler _masm(&cbuf); 1023 1024 Register r = as_Register(ra_->get_encode(this)); 1025 CodeSection* cs = __ code()->consts(); 1026 int consts_size = cs->align_at_start(cs->size()); 1027 1028 if (UseRDPCForConstantTableBase) { 1029 // For the following RDPC logic to work correctly the consts 1030 // section must be allocated right before the insts section. This 1031 // assert checks for that. The layout and the SECT_* constants 1032 // are defined in src/share/vm/asm/codeBuffer.hpp. 1033 assert(CodeBuffer::SECT_CONSTS + 1 == CodeBuffer::SECT_INSTS, "must be"); 1034 int offset = __ offset(); 1035 int disp; 1036 1037 // If the displacement from the current PC to the constant table 1038 // base fits into simm13 we set the constant table base to the 1039 // current PC. 1040 if (__ is_simm13(-(consts_size + offset))) { 1041 constant_table.set_table_base_offset(-(consts_size + offset)); 1042 disp = 0; 1043 } else { 1044 // If the offset of the top constant (last entry in the table) 1045 // fits into simm13 we set the constant table base to the actual 1046 // table base. 1047 if (__ is_simm13(constant_table.top_offset())) { 1048 constant_table.set_table_base_offset(0); 1049 disp = consts_size + offset; 1050 } else { 1051 // Otherwise we set the constant table base in the middle of the 1052 // constant table. 1053 int half_consts_size = consts_size / 2; 1054 assert(half_consts_size * 2 == consts_size, "sanity"); 1055 constant_table.set_table_base_offset(-half_consts_size); // table base offset gets added to the load displacement. 1056 disp = half_consts_size + offset; 1057 } 1058 } 1059 1060 __ rdpc(r); 1061 1062 if (disp != 0) { 1063 assert(r != O7, "need temporary"); 1064 __ sub(r, __ ensure_simm13_or_reg(disp, O7), r); 1065 } 1066 } 1067 else { 1068 // Materialize the constant table base. 1069 assert(constant_table.size() == consts_size, err_msg("must be: %d == %d", constant_table.size(), consts_size)); 1070 address baseaddr = cs->start() + -(constant_table.table_base_offset()); 1071 RelocationHolder rspec = internal_word_Relocation::spec(baseaddr); 1072 AddressLiteral base(baseaddr, rspec); 1073 __ set(base, r); 1074 } 1075 } 1076 1077 uint MachConstantBaseNode::size(PhaseRegAlloc*) const { 1078 if (UseRDPCForConstantTableBase) { 1079 // This is really the worst case but generally it's only 1 instruction. 1080 return (1 /*rdpc*/ + 1 /*sub*/ + MacroAssembler::worst_case_insts_for_set()) * BytesPerInstWord; 1081 } else { 1082 return MacroAssembler::worst_case_insts_for_set() * BytesPerInstWord; 1083 } 1084 } 1085 1086 #ifndef PRODUCT 1087 void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const { 1088 char reg[128]; 1089 ra_->dump_register(this, reg); 1090 if (UseRDPCForConstantTableBase) { 1091 st->print("RDPC %s\t! constant table base", reg); 1092 } else { 1093 st->print("SET &constanttable,%s\t! constant table base", reg); 1094 } 1095 } 1096 #endif 1097 1098 1099 //============================================================================= 1017 1100 1018 1101 #ifndef PRODUCT … … 1149 1232 int MachEpilogNode::safepoint_offset() const { 1150 1233 assert( do_polling(), "no return for this epilog node"); 1151 return MacroAssembler:: size_of_sethi(os::get_polling_page());1234 return MacroAssembler::insts_for_sethi(os::get_polling_page()) * BytesPerInstWord; 1152 1235 } 1153 1236 … … 1533 1616 // jmp -1 1534 1617 1535 address mark = cbuf.inst _mark(); // get mark within main instrs section1618 address mark = cbuf.insts_mark(); // get mark within main instrs section 1536 1619 1537 1620 MacroAssembler _masm(&cbuf); … … 1633 1716 int emit_exception_handler(CodeBuffer& cbuf) { 1634 1717 Register temp_reg = G3; 1635 AddressLiteral exception_blob(OptoRuntime::exception_blob()-> instructions_begin());1718 AddressLiteral exception_blob(OptoRuntime::exception_blob()->entry_point()); 1636 1719 MacroAssembler _masm(&cbuf); 1637 1720 … … 1848 1931 bool Matcher::is_spillable_arg( int reg ) { 1849 1932 return can_be_java_arg(reg); 1933 } 1934 1935 bool Matcher::use_asm_for_ldiv_by_con( jlong divisor ) { 1936 // Use hardware SDIVX instruction when it is 1937 // faster than a code which use multiply. 1938 return VM_Version::has_fast_idiv(); 1850 1939 } 1851 1940 … … 2248 2337 %} 2249 2338 2250 enc_class jump_enc( iRegX switch_val, o7RegI table) %{2251 MacroAssembler _masm(&cbuf);2252 2253 Register switch_reg = as_Register($switch_val$$reg);2254 Register table_reg = O7;2255 2256 address table_base = __ address_table_constant(_index2label);2257 RelocationHolder rspec = internal_word_Relocation::spec(table_base);2258 2259 // Move table address into a register.2260 __ set(table_base, table_reg, rspec);2261 2262 // Jump to base address + switch value2263 __ ld_ptr(table_reg, switch_reg, table_reg);2264 __ jmp(table_reg, G0);2265 __ delayed()->nop();2266 2267 %}2268 2269 2339 enc_class enc_ba( Label labl ) %{ 2270 2340 MacroAssembler _masm(&cbuf); … … 2293 2363 ($pcc$$constant << 11) | // cc1, cc0 bits for 'icc' or 'xcc' 2294 2364 ($src$$reg << 0); 2295 *((int*)(cbuf.code_end())) = op; 2296 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2365 cbuf.insts()->emit_int32(op); 2297 2366 %} 2298 2367 … … 2307 2376 ($pcc$$constant << 11) | // cc1, cc0 bits for 'icc' 2308 2377 (simm11 << 0); 2309 *((int*)(cbuf.code_end())) = op; 2310 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2378 cbuf.insts()->emit_int32(op); 2311 2379 %} 2312 2380 … … 2320 2388 ($fcc$$reg << 11) | // cc1, cc0 bits for fcc0-fcc3 2321 2389 ($src$$reg << 0); 2322 *((int*)(cbuf.code_end())) = op; 2323 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2390 cbuf.insts()->emit_int32(op); 2324 2391 %} 2325 2392 … … 2334 2401 ($fcc$$reg << 11) | // cc1, cc0 bits for fcc0-fcc3 2335 2402 (simm11 << 0); 2336 *((int*)(cbuf.code_end())) = op; 2337 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2403 cbuf.insts()->emit_int32(op); 2338 2404 %} 2339 2405 … … 2348 2414 ($primary << 5) | // select single, double or quad 2349 2415 ($src$$reg << 0); 2350 *((int*)(cbuf.code_end())) = op; 2351 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2416 cbuf.insts()->emit_int32(op); 2352 2417 %} 2353 2418 … … 2361 2426 ($primary << 5) | // select single, double or quad 2362 2427 ($src$$reg << 0); 2363 *((int*)(cbuf.code_end())) = op; 2364 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2428 cbuf.insts()->emit_int32(op); 2365 2429 %} 2366 2430 … … 2376 2440 (0 << 11) | // cc1, cc0 bits for 'icc' 2377 2441 ($src$$reg << 0); 2378 *((int*)(cbuf.code_end())) = op; 2379 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2442 cbuf.insts()->emit_int32(op); 2380 2443 %} 2381 2444 … … 2389 2452 (0 << 11) | // cc1, cc0 bits for 'icc' 2390 2453 ($src$$reg << 0); 2391 *((int*)(cbuf.code_end())) = op; 2392 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 2393 %} 2394 2395 // Utility encoding for loading a 64 bit Pointer into a register 2396 // The 64 bit pointer is stored in the generated code stream 2397 enc_class SetPtr( immP src, iRegP rd ) %{ 2398 Register dest = reg_to_register_object($rd$$reg); 2399 MacroAssembler _masm(&cbuf); 2400 // [RGV] This next line should be generated from ADLC 2401 if ( _opnds[1]->constant_is_oop() ) { 2402 intptr_t val = $src$$constant; 2403 __ set_oop_constant((jobject)val, dest); 2404 } else { // non-oop pointers, e.g. card mark base, heap top 2405 __ set($src$$constant, dest); 2406 } 2454 cbuf.insts()->emit_int32(op); 2407 2455 %} 2408 2456 … … 2418 2466 MacroAssembler _masm(&cbuf); 2419 2467 __ set($src$$constant, reg_to_register_object($rd$$reg)); 2420 %}2421 2422 enc_class SetNull( iRegI rd ) %{2423 emit3_simm13( cbuf, Assembler::arith_op, $rd$$reg, Assembler::or_op3, 0, 0 );2424 2468 %} 2425 2469 … … 2455 2499 // The user of this is responsible for ensuring that R_L7 is empty (killed). 2456 2500 emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type, 2457 /*preserve_g2=*/true , /*force far call*/true);2501 /*preserve_g2=*/true); 2458 2502 %} 2459 2503 … … 2787 2831 %} 2788 2832 2789 enc_class LdImmL (immL src, iRegL dst, o7RegL tmp) %{ // Load Immediate2790 MacroAssembler _masm(&cbuf);2791 Register dest = reg_to_register_object($dst$$reg);2792 Register temp = reg_to_register_object($tmp$$reg);2793 __ set64( $src$$constant, dest, temp );2794 %}2795 2796 enc_class LdReplImmI(immI src, regD dst, o7RegP tmp, int count, int width) %{2797 // Load a constant replicated "count" times with width "width"2798 int bit_width = $width$$constant * 8;2799 jlong elt_val = $src$$constant;2800 elt_val &= (((jlong)1) << bit_width) - 1; // mask off sign bits2801 jlong val = elt_val;2802 for (int i = 0; i < $count$$constant - 1; i++) {2803 val <<= bit_width;2804 val |= elt_val;2805 }2806 jdouble dval = *(jdouble*)&val; // coerce to double type2807 MacroAssembler _masm(&cbuf);2808 address double_address = __ double_constant(dval);2809 RelocationHolder rspec = internal_word_Relocation::spec(double_address);2810 AddressLiteral addrlit(double_address, rspec);2811 2812 __ sethi(addrlit, $tmp$$Register);2813 // XXX This is a quick fix for 6833573.2814 //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec);2815 __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec);2816 %}2817 2818 2833 // Compiler ensures base is doubleword aligned and cnt is count of doublewords 2819 2834 enc_class enc_Clear_Array(iRegX cnt, iRegP base, iRegX temp) %{ … … 3056 3071 3057 3072 enc_class enc_rethrow() %{ 3058 cbuf.set_inst _mark();3073 cbuf.set_insts_mark(); 3059 3074 Register temp_reg = G3; 3060 3075 AddressLiteral rethrow_stub(OptoRuntime::rethrow_stub()); … … 3077 3092 enc_class emit_mem_nop() %{ 3078 3093 // Generates the instruction LDUXA [o6,g0],#0x82,g0 3079 unsigned int *code = (unsigned int*)cbuf.code_end(); 3080 *code = (unsigned int)0xc0839040; 3081 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 3094 cbuf.insts()->emit_int32((unsigned int) 0xc0839040); 3082 3095 %} 3083 3096 3084 3097 enc_class emit_fadd_nop() %{ 3085 3098 // Generates the instruction FMOVS f31,f31 3086 unsigned int *code = (unsigned int*)cbuf.code_end(); 3087 *code = (unsigned int)0xbfa0003f; 3088 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 3099 cbuf.insts()->emit_int32((unsigned int) 0xbfa0003f); 3089 3100 %} 3090 3101 3091 3102 enc_class emit_br_nop() %{ 3092 3103 // Generates the instruction BPN,PN . 3093 unsigned int *code = (unsigned int*)cbuf.code_end(); 3094 *code = (unsigned int)0x00400000; 3095 cbuf.set_code_end(cbuf.code_end() + BytesPerInstWord); 3104 cbuf.insts()->emit_int32((unsigned int) 0x00400000); 3096 3105 %} 3097 3106 … … 3536 3545 %} 3537 3546 3547 #ifdef _LP64 3548 // Pointer Immediate: 64-bit 3549 operand immP_set() %{ 3550 predicate(!VM_Version::is_niagara_plus()); 3551 match(ConP); 3552 3553 op_cost(5); 3554 // formats are generated automatically for constants and base registers 3555 format %{ %} 3556 interface(CONST_INTER); 3557 %} 3558 3559 // Pointer Immediate: 64-bit 3560 // From Niagara2 processors on a load should be better than materializing. 3561 operand immP_load() %{ 3562 predicate(VM_Version::is_niagara_plus() && (n->bottom_type()->isa_oop_ptr() || (MacroAssembler::insts_for_set(n->get_ptr()) > 3))); 3563 match(ConP); 3564 3565 op_cost(5); 3566 // formats are generated automatically for constants and base registers 3567 format %{ %} 3568 interface(CONST_INTER); 3569 %} 3570 3571 // Pointer Immediate: 64-bit 3572 operand immP_no_oop_cheap() %{ 3573 predicate(VM_Version::is_niagara_plus() && !n->bottom_type()->isa_oop_ptr() && (MacroAssembler::insts_for_set(n->get_ptr()) <= 3)); 3574 match(ConP); 3575 3576 op_cost(5); 3577 // formats are generated automatically for constants and base registers 3578 format %{ %} 3579 interface(CONST_INTER); 3580 %} 3581 #endif 3582 3538 3583 operand immP13() %{ 3539 3584 predicate((-4096 < n->get_ptr()) && (n->get_ptr() <= 4095)); … … 3624 3669 operand immL_32bits() %{ 3625 3670 predicate(n->get_long() == 0xFFFFFFFFL); 3671 match(ConL); 3672 op_cost(0); 3673 3674 format %{ %} 3675 interface(CONST_INTER); 3676 %} 3677 3678 // Long Immediate: cheap (materialize in <= 3 instructions) 3679 operand immL_cheap() %{ 3680 predicate(!VM_Version::is_niagara_plus() || MacroAssembler::insts_for_set64(n->get_long()) <= 3); 3681 match(ConL); 3682 op_cost(0); 3683 3684 format %{ %} 3685 interface(CONST_INTER); 3686 %} 3687 3688 // Long Immediate: expensive (materialize in > 3 instructions) 3689 operand immL_expensive() %{ 3690 predicate(VM_Version::is_niagara_plus() && MacroAssembler::insts_for_set64(n->get_long()) > 3); 3626 3691 match(ConL); 3627 3692 op_cost(0); … … 5996 6061 %} 5997 6062 5998 instruct loadConP(iRegP dst, immP src) %{ 5999 match(Set dst src); 6063 #ifndef _LP64 6064 instruct loadConP(iRegP dst, immP con) %{ 6065 match(Set dst con); 6000 6066 ins_cost(DEFAULT_COST * 3/2); 6001 format %{ "SET $src,$dst\t!ptr" %} 6002 // This rule does not use "expand" unlike loadConI because then 6003 // the result type is not known to be an Oop. An ADLC 6004 // enhancement will be needed to make that work - not worth it! 6005 6006 ins_encode( SetPtr( src, dst ) ); 6067 format %{ "SET $con,$dst\t!ptr" %} 6068 ins_encode %{ 6069 // [RGV] This next line should be generated from ADLC 6070 if (_opnds[1]->constant_is_oop()) { 6071 intptr_t val = $con$$constant; 6072 __ set_oop_constant((jobject) val, $dst$$Register); 6073 } else { // non-oop pointers, e.g. card mark base, heap top 6074 __ set($con$$constant, $dst$$Register); 6075 } 6076 %} 6007 6077 ins_pipe(loadConP); 6008 6009 %} 6078 %} 6079 #else 6080 instruct loadConP_set(iRegP dst, immP_set con) %{ 6081 match(Set dst con); 6082 ins_cost(DEFAULT_COST * 3/2); 6083 format %{ "SET $con,$dst\t! ptr" %} 6084 ins_encode %{ 6085 // [RGV] This next line should be generated from ADLC 6086 if (_opnds[1]->constant_is_oop()) { 6087 intptr_t val = $con$$constant; 6088 __ set_oop_constant((jobject) val, $dst$$Register); 6089 } else { // non-oop pointers, e.g. card mark base, heap top 6090 __ set($con$$constant, $dst$$Register); 6091 } 6092 %} 6093 ins_pipe(loadConP); 6094 %} 6095 6096 instruct loadConP_load(iRegP dst, immP_load con) %{ 6097 match(Set dst con); 6098 ins_cost(MEMORY_REF_COST); 6099 format %{ "LD [$constanttablebase + $constantoffset],$dst\t! load from constant table: ptr=$con" %} 6100 ins_encode %{ 6101 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register); 6102 __ ld_ptr($constanttablebase, con_offset, $dst$$Register); 6103 %} 6104 ins_pipe(loadConP); 6105 %} 6106 6107 instruct loadConP_no_oop_cheap(iRegP dst, immP_no_oop_cheap con) %{ 6108 match(Set dst con); 6109 ins_cost(DEFAULT_COST * 3/2); 6110 format %{ "SET $con,$dst\t! non-oop ptr" %} 6111 ins_encode %{ 6112 __ set($con$$constant, $dst$$Register); 6113 %} 6114 ins_pipe(loadConP); 6115 %} 6116 #endif // _LP64 6010 6117 6011 6118 instruct loadConP0(iRegP dst, immP0 src) %{ … … 6014 6121 size(4); 6015 6122 format %{ "CLR $dst\t!ptr" %} 6016 ins_encode( SetNull( dst ) ); 6123 ins_encode %{ 6124 __ clr($dst$$Register); 6125 %} 6017 6126 ins_pipe(ialu_imm); 6018 6127 %} … … 6034 6143 size(4); 6035 6144 format %{ "CLR $dst\t! compressed NULL ptr" %} 6036 ins_encode( SetNull( dst ) ); 6145 ins_encode %{ 6146 __ clr($dst$$Register); 6147 %} 6037 6148 ins_pipe(ialu_imm); 6038 6149 %} … … 6049 6160 %} 6050 6161 6051 instruct loadConL(iRegL dst, immL src, o7RegL tmp) %{ 6052 // %%% maybe this should work like loadConD 6053 match(Set dst src);6162 // Materialize long value (predicated by immL_cheap). 6163 instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{ 6164 match(Set dst con); 6054 6165 effect(KILL tmp); 6055 ins_cost(DEFAULT_COST * 4); 6056 format %{ "SET64 $src,$dst KILL $tmp\t! long" %} 6057 ins_encode( LdImmL(src, dst, tmp) ); 6166 ins_cost(DEFAULT_COST * 3); 6167 format %{ "SET64 $con,$dst KILL $tmp\t! cheap long" %} 6168 ins_encode %{ 6169 __ set64($con$$constant, $dst$$Register, $tmp$$Register); 6170 %} 6171 ins_pipe(loadConL); 6172 %} 6173 6174 // Load long value from constant table (predicated by immL_expensive). 6175 instruct loadConL_ldx(iRegL dst, immL_expensive con) %{ 6176 match(Set dst con); 6177 ins_cost(MEMORY_REF_COST); 6178 format %{ "LDX [$constanttablebase + $constantoffset],$dst\t! load from constant table: long=$con" %} 6179 ins_encode %{ 6180 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $dst$$Register); 6181 __ ldx($constanttablebase, con_offset, $dst$$Register); 6182 %} 6058 6183 ins_pipe(loadConL); 6059 6184 %} … … 6078 6203 %} 6079 6204 6080 instruct loadConF(regF dst, immF src, o7RegPtmp) %{6081 match(Set dst src);6205 instruct loadConF(regF dst, immF con, o7RegI tmp) %{ 6206 match(Set dst con); 6082 6207 effect(KILL tmp); 6083 6084 #ifdef _LP64 6085 size(8*4); 6086 #else 6087 size(2*4); 6088 #endif 6089 6090 format %{ "SETHI hi(&$src),$tmp\t!get float $src from table\n\t" 6091 "LDF [$tmp+lo(&$src)],$dst" %} 6208 format %{ "LDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: float=$con" %} 6092 6209 ins_encode %{ 6093 address float_address = __ float_constant($src$$constant); 6094 RelocationHolder rspec = internal_word_Relocation::spec(float_address); 6095 AddressLiteral addrlit(float_address, rspec); 6096 6097 __ sethi(addrlit, $tmp$$Register); 6098 __ ldf(FloatRegisterImpl::S, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec); 6210 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register); 6211 __ ldf(FloatRegisterImpl::S, $constanttablebase, con_offset, $dst$$FloatRegister); 6099 6212 %} 6100 6213 ins_pipe(loadConFD); 6101 6214 %} 6102 6215 6103 instruct loadConD(regD dst, immD src, o7RegPtmp) %{6104 match(Set dst src);6216 instruct loadConD(regD dst, immD con, o7RegI tmp) %{ 6217 match(Set dst con); 6105 6218 effect(KILL tmp); 6106 6107 #ifdef _LP64 6108 size(8*4); 6109 #else 6110 size(2*4); 6111 #endif 6112 6113 format %{ "SETHI hi(&$src),$tmp\t!get double $src from table\n\t" 6114 "LDDF [$tmp+lo(&$src)],$dst" %} 6219 format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: double=$con" %} 6115 6220 ins_encode %{ 6116 address double_address = __ double_constant($src$$constant);6117 RelocationHolder rspec = internal_word_Relocation::spec(double_address);6118 AddressLiteral addrlit(double_address, rspec);6119 6120 __ sethi(addrlit, $tmp$$Register);6121 6221 // XXX This is a quick fix for 6833573. 6122 //__ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), $dst$$FloatRegister, rspec); 6123 __ ldf(FloatRegisterImpl::D, $tmp$$Register, addrlit.low10(), as_DoubleFloatRegister($dst$$reg), rspec); 6222 //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset($con), $dst$$FloatRegister); 6223 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset($con), $tmp$$Register); 6224 __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); 6124 6225 %} 6125 6226 ins_pipe(loadConFD); … … 8025 8126 #endif 8026 8127 8128 instruct cmpLTMask0( iRegI dst, iRegI src, immI0 zero, flagsReg ccr ) %{ 8129 match(Set dst (CmpLTMask src zero)); 8130 effect(KILL ccr); 8131 size(4); 8132 format %{ "SRA $src,#31,$dst\t# cmpLTMask0" %} 8133 ins_encode %{ 8134 __ sra($src$$Register, 31, $dst$$Register); 8135 %} 8136 ins_pipe(ialu_reg_imm); 8137 %} 8138 8027 8139 instruct cmpLTMask_reg_reg( iRegI dst, iRegI p, iRegI q, flagsReg ccr ) %{ 8028 8140 match(Set dst (CmpLTMask p q)); … … 8044 8156 format %{ "SUBcc $p,$q,$p\t! p' = p-q\n\t" 8045 8157 "ADD $p,$y,$tmp\t! g3=p-q+y\n\t" 8046 "MOVl $tmp,$p\t! p' < 0 ? p'+y : p'" %} 8047 ins_encode( enc_cadd_cmpLTMask(p, q, y, tmp) ); 8048 ins_pipe( cadd_cmpltmask ); 8049 %} 8050 8051 instruct cadd_cmpLTMask2( iRegI p, iRegI q, iRegI y, iRegI tmp, flagsReg ccr ) %{ 8052 match(Set p (AddI (SubI p q) (AndI (CmpLTMask p q) y))); 8053 effect( KILL ccr, TEMP tmp); 8054 ins_cost(DEFAULT_COST*3); 8055 8056 format %{ "SUBcc $p,$q,$p\t! p' = p-q\n\t" 8057 "ADD $p,$y,$tmp\t! g3=p-q+y\n\t" 8058 "MOVl $tmp,$p\t! p' < 0 ? p'+y : p'" %} 8158 "MOVlt $tmp,$p\t! p' < 0 ? p'+y : p'" %} 8059 8159 ins_encode( enc_cadd_cmpLTMask(p, q, y, tmp) ); 8060 8160 ins_pipe( cadd_cmpltmask ); … … 8573 8673 8574 8674 // Replicate scalar constant to packed byte values in Double register 8575 instruct Repl8B_immI(regD dst, immI13 src, o7RegPtmp) %{8576 match(Set dst (Replicate8B src));8577 #ifdef _LP64 8578 size(36);8579 #else 8580 size(8);8581 #endif 8582 format %{ "SETHI hi(&Repl8($src)),$tmp\t!get Repl8B($src) from table\n\t"8583 "LDDF [$tmp+lo(&Repl8($src))],$dst" %}8584 ins_encode( LdReplImmI(src, dst, tmp, (8), (1)) );8675 instruct Repl8B_immI(regD dst, immI13 con, o7RegI tmp) %{ 8676 match(Set dst (Replicate8B con)); 8677 effect(KILL tmp); 8678 format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl8B($con)" %} 8679 ins_encode %{ 8680 // XXX This is a quick fix for 6833573. 8681 //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 8, 1)), $dst$$FloatRegister); 8682 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 8, 1)), $tmp$$Register); 8683 __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); 8684 %} 8585 8685 ins_pipe(loadConFD); 8586 8686 %} … … 8609 8709 8610 8710 // Replicate scalar constant to packed char values in Double register 8611 instruct Repl4C_immI(regD dst, immI src, o7RegPtmp) %{8612 match(Set dst (Replicate4C src));8613 #ifdef _LP64 8614 size(36);8615 #else 8616 size(8);8617 #endif 8618 format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4C($src) from table\n\t"8619 "LDDF [$tmp+lo(&Repl4($src))],$dst" %}8620 ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );8711 instruct Repl4C_immI(regD dst, immI con, o7RegI tmp) %{ 8712 match(Set dst (Replicate4C con)); 8713 effect(KILL tmp); 8714 format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4C($con)" %} 8715 ins_encode %{ 8716 // XXX This is a quick fix for 6833573. 8717 //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister); 8718 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register); 8719 __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); 8720 %} 8621 8721 ins_pipe(loadConFD); 8622 8722 %} … … 8645 8745 8646 8746 // Replicate scalar constant to packed short values in Double register 8647 instruct Repl4S_immI(regD dst, immI src, o7RegPtmp) %{8648 match(Set dst (Replicate4S src));8649 #ifdef _LP64 8650 size(36);8651 #else 8652 size(8);8653 #endif 8654 format %{ "SETHI hi(&Repl4($src)),$tmp\t!get Repl4S($src) from table\n\t"8655 "LDDF [$tmp+lo(&Repl4($src))],$dst" %}8656 ins_encode( LdReplImmI(src, dst, tmp, (4), (2)) );8747 instruct Repl4S_immI(regD dst, immI con, o7RegI tmp) %{ 8748 match(Set dst (Replicate4S con)); 8749 effect(KILL tmp); 8750 format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl4S($con)" %} 8751 ins_encode %{ 8752 // XXX This is a quick fix for 6833573. 8753 //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 4, 2)), $dst$$FloatRegister); 8754 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 4, 2)), $tmp$$Register); 8755 __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); 8756 %} 8657 8757 ins_pipe(loadConFD); 8658 8758 %} … … 8679 8779 8680 8780 // Replicate scalar zero constant to packed int values in Double register 8681 instruct Repl2I_immI(regD dst, immI src, o7RegPtmp) %{8682 match(Set dst (Replicate2I src));8683 #ifdef _LP64 8684 size(36);8685 #else 8686 size(8);8687 #endif 8688 format %{ "SETHI hi(&Repl2($src)),$tmp\t!get Repl2I($src) from table\n\t"8689 "LDDF [$tmp+lo(&Repl2($src))],$dst" %}8690 ins_encode( LdReplImmI(src, dst, tmp, (2), (4)) );8781 instruct Repl2I_immI(regD dst, immI con, o7RegI tmp) %{ 8782 match(Set dst (Replicate2I con)); 8783 effect(KILL tmp); 8784 format %{ "LDDF [$constanttablebase + $constantoffset],$dst\t! load from constant table: Repl2I($con)" %} 8785 ins_encode %{ 8786 // XXX This is a quick fix for 6833573. 8787 //__ ldf(FloatRegisterImpl::D, $constanttablebase, $constantoffset(replicate_immI($con$$constant, 2, 4)), $dst$$FloatRegister); 8788 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset(replicate_immI($con$$constant, 2, 4)), $tmp$$Register); 8789 __ ldf(FloatRegisterImpl::D, $constanttablebase, con_offset, as_DoubleFloatRegister($dst$$reg)); 8790 %} 8691 8791 ins_pipe(loadConFD); 8692 8792 %} … … 8944 9044 ins_cost(350); 8945 9045 8946 format %{ "SETHI [hi(table_base)],O7\n\t" 8947 "ADD O7, lo(table_base), O7\n\t" 8948 "LD [O7+$switch_val], O7\n\t" 9046 format %{ "ADD $constanttablebase, $constantoffset, O7\n\t" 9047 "LD [O7 + $switch_val], O7\n\t" 8949 9048 "JUMP O7" 8950 9049 %} 8951 ins_encode( jump_enc( switch_val, table) ); 9050 ins_encode %{ 9051 // Calculate table address into a register. 9052 Register table_reg; 9053 Register label_reg = O7; 9054 if (constant_offset() == 0) { 9055 table_reg = $constanttablebase; 9056 } else { 9057 table_reg = O7; 9058 RegisterOrConstant con_offset = __ ensure_simm13_or_reg($constantoffset, O7); 9059 __ add($constanttablebase, con_offset, table_reg); 9060 } 9061 9062 // Jump to base address + switch value 9063 __ ld_ptr(table_reg, $switch_val$$Register, label_reg); 9064 __ jmp(label_reg, G0); 9065 __ delayed()->nop(); 9066 %} 8952 9067 ins_pc_relative(1); 8953 9068 ins_pipe(ialu_reg_reg); … … 9531 9646 Register Rsrc = $src$$Register; 9532 9647 Register Rtmp = $tmp$$Register; 9533 __ srl(Rsrc, 1, Rtmp);9534 __ srl(Rsrc, 0, Rdst);9648 __ srl(Rsrc, 1, Rtmp); 9649 __ srl(Rsrc, 0, Rdst); 9535 9650 __ or3(Rdst, Rtmp, Rdst); 9536 __ srl(Rdst, 2, Rtmp);9651 __ srl(Rdst, 2, Rtmp); 9537 9652 __ or3(Rdst, Rtmp, Rdst); 9538 __ srl(Rdst, 4, Rtmp);9653 __ srl(Rdst, 4, Rtmp); 9539 9654 __ or3(Rdst, Rtmp, Rdst); 9540 __ srl(Rdst, 8, Rtmp);9655 __ srl(Rdst, 8, Rtmp); 9541 9656 __ or3(Rdst, Rtmp, Rdst); 9542 __ srl(Rdst, 16, Rtmp);9657 __ srl(Rdst, 16, Rtmp); 9543 9658 __ or3(Rdst, Rtmp, Rdst); 9544 9659 __ popc(Rdst, Rdst); … … 9549 9664 %} 9550 9665 9551 instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{9666 instruct countLeadingZerosL(iRegIsafe dst, iRegL src, iRegL tmp, flagsReg cr) %{ 9552 9667 predicate(UsePopCountInstruction); // See Matcher::match_rule_supported 9553 9668 match(Set dst (CountLeadingZerosL src)); … … 9580 9695 Register Rsrc = $src$$Register; 9581 9696 Register Rtmp = $tmp$$Register; 9582 __ srlx(Rsrc, 1, Rtmp);9583 __ or3( Rsrc, Rtmp, Rdst);9584 __ srlx(Rdst, 2, Rtmp);9585 __ or3( Rdst, Rtmp, Rdst);9586 __ srlx(Rdst, 4, Rtmp);9587 __ or3( Rdst, Rtmp, Rdst);9588 __ srlx(Rdst, 8, Rtmp);9589 __ or3( Rdst, Rtmp, Rdst);9590 __ srlx(Rdst, 16, Rtmp);9591 __ or3( Rdst, Rtmp, Rdst);9592 __ srlx(Rdst, 32, Rtmp);9593 __ or3( Rdst, Rtmp, Rdst);9697 __ srlx(Rsrc, 1, Rtmp); 9698 __ or3( Rsrc, Rtmp, Rdst); 9699 __ srlx(Rdst, 2, Rtmp); 9700 __ or3( Rdst, Rtmp, Rdst); 9701 __ srlx(Rdst, 4, Rtmp); 9702 __ or3( Rdst, Rtmp, Rdst); 9703 __ srlx(Rdst, 8, Rtmp); 9704 __ or3( Rdst, Rtmp, Rdst); 9705 __ srlx(Rdst, 16, Rtmp); 9706 __ or3( Rdst, Rtmp, Rdst); 9707 __ srlx(Rdst, 32, Rtmp); 9708 __ or3( Rdst, Rtmp, Rdst); 9594 9709 __ popc(Rdst, Rdst); 9595 9710 __ mov(BitsPerLong, Rtmp); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
r278 r309 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_stubGenerator_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "nativeInst_sparc.hpp" 30 #include "oops/instanceOop.hpp" 31 #include "oops/methodOop.hpp" 32 #include "oops/objArrayKlass.hpp" 33 #include "oops/oop.inline.hpp" 34 #include "prims/methodHandles.hpp" 35 #include "runtime/frame.inline.hpp" 36 #include "runtime/handles.inline.hpp" 37 #include "runtime/sharedRuntime.hpp" 38 #include "runtime/stubCodeGenerator.hpp" 39 #include "runtime/stubRoutines.hpp" 40 #include "utilities/top.hpp" 41 #ifdef TARGET_OS_FAMILY_linux 42 # include "thread_linux.inline.hpp" 43 #endif 44 #ifdef TARGET_OS_FAMILY_solaris 45 # include "thread_solaris.inline.hpp" 46 #endif 47 #ifdef COMPILER2 48 #include "opto/runtime.hpp" 49 #endif 27 50 28 51 // Declaration and definition of StubGenerator (no .hpp file). -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_stubRoutines_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "runtime/deoptimization.hpp" 27 #include "runtime/frame.inline.hpp" 28 #include "runtime/stubRoutines.hpp" 29 #ifdef TARGET_OS_FAMILY_linux 30 # include "thread_linux.inline.hpp" 31 #endif 32 #ifdef TARGET_OS_FAMILY_solaris 33 # include "thread_solaris.inline.hpp" 34 #endif 27 35 28 36 // Implementation of the platform-specific part of StubRoutines - for -
trunk/openjdk/hotspot/src/cpu/sparc/vm/stubRoutines_sparc.hpp
r278 r309 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_STUBROUTINES_SPARC_HPP 26 #define CPU_SPARC_VM_STUBROUTINES_SPARC_HPP 27 25 28 // This file holds the platform specific parts of the StubRoutines 26 29 // definition. See stubRoutines.hpp for a description on how to … … 44 47 // MethodHandles adapters 45 48 enum method_handles_platform_dependent_constants { 46 method_handles_adapters_code_size = 600049 method_handles_adapters_code_size = 15000 47 50 }; 48 51 … … 101 104 static address partial_subtype_check() { return _partial_subtype_check; } 102 105 }; 106 107 #endif // CPU_SPARC_VM_STUBROUTINES_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 07, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP 26 #define CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP 27 25 28 protected: 26 29 … … 28 31 void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, 29 32 Register Rscratch2); 33 34 #endif // CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_templateInterpreter_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterGenerator.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "interpreter/templateTable.hpp" 32 #include "oops/arrayOop.hpp" 33 #include "oops/methodDataOop.hpp" 34 #include "oops/methodOop.hpp" 35 #include "oops/oop.inline.hpp" 36 #include "prims/jvmtiExport.hpp" 37 #include "prims/jvmtiThreadState.hpp" 38 #include "runtime/arguments.hpp" 39 #include "runtime/deoptimization.hpp" 40 #include "runtime/frame.inline.hpp" 41 #include "runtime/sharedRuntime.hpp" 42 #include "runtime/stubRoutines.hpp" 43 #include "runtime/synchronizer.hpp" 44 #include "runtime/timer.hpp" 45 #include "runtime/vframeArray.hpp" 46 #include "utilities/debug.hpp" 27 47 28 48 #ifndef CC_INTERP … … 295 315 // 296 316 void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { 297 // Update standard invocation counters 298 __ increment_invocation_counter(O0, G3_scratch); 299 if (ProfileInterpreter) { // %%% Merge this into methodDataOop 300 Address interpreter_invocation_counter(Lmethod, methodOopDesc::interpreter_invocation_counter_offset()); 301 __ ld(interpreter_invocation_counter, G3_scratch); 302 __ inc(G3_scratch); 303 __ st(G3_scratch, interpreter_invocation_counter); 304 } 305 306 if (ProfileInterpreter && profile_method != NULL) { 307 // Test to see if we should create a method data oop 308 AddressLiteral profile_limit(&InvocationCounter::InterpreterProfileLimit); 309 __ sethi(profile_limit, G3_scratch); 310 __ ld(G3_scratch, profile_limit.low10(), G3_scratch); 317 // Note: In tiered we increment either counters in methodOop or in MDO depending if we're profiling or not. 318 if (TieredCompilation) { 319 const int increment = InvocationCounter::count_increment; 320 const int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift; 321 Label no_mdo, done; 322 if (ProfileInterpreter) { 323 // If no method data exists, go to profile_continue. 324 __ ld_ptr(Lmethod, methodOopDesc::method_data_offset(), G4_scratch); 325 __ br_null(G4_scratch, false, Assembler::pn, no_mdo); 326 __ delayed()->nop(); 327 // Increment counter 328 Address mdo_invocation_counter(G4_scratch, 329 in_bytes(methodDataOopDesc::invocation_counter_offset()) + 330 in_bytes(InvocationCounter::counter_offset())); 331 __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, 332 G3_scratch, Lscratch, 333 Assembler::zero, overflow); 334 __ ba(false, done); 335 __ delayed()->nop(); 336 } 337 338 // Increment counter in methodOop 339 __ bind(no_mdo); 340 Address invocation_counter(Lmethod, 341 in_bytes(methodOopDesc::invocation_counter_offset()) + 342 in_bytes(InvocationCounter::counter_offset())); 343 __ increment_mask_and_jump(invocation_counter, increment, mask, 344 G3_scratch, Lscratch, 345 Assembler::zero, overflow); 346 __ bind(done); 347 } else { 348 // Update standard invocation counters 349 __ increment_invocation_counter(O0, G3_scratch); 350 if (ProfileInterpreter) { // %%% Merge this into methodDataOop 351 Address interpreter_invocation_counter(Lmethod,in_bytes(methodOopDesc::interpreter_invocation_counter_offset())); 352 __ ld(interpreter_invocation_counter, G3_scratch); 353 __ inc(G3_scratch); 354 __ st(G3_scratch, interpreter_invocation_counter); 355 } 356 357 if (ProfileInterpreter && profile_method != NULL) { 358 // Test to see if we should create a method data oop 359 AddressLiteral profile_limit((address)&InvocationCounter::InterpreterProfileLimit); 360 __ load_contents(profile_limit, G3_scratch); 361 __ cmp(O0, G3_scratch); 362 __ br(Assembler::lessUnsigned, false, Assembler::pn, *profile_method_continue); 363 __ delayed()->nop(); 364 365 // if no method data exists, go to profile_method 366 __ test_method_data_pointer(*profile_method); 367 } 368 369 AddressLiteral invocation_limit((address)&InvocationCounter::InterpreterInvocationLimit); 370 __ load_contents(invocation_limit, G3_scratch); 311 371 __ cmp(O0, G3_scratch); 312 __ br(Assembler:: lessUnsigned, false, Assembler::pn, *profile_method_continue);372 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); 313 373 __ delayed()->nop(); 314 315 // if no method data exists, go to profile_method 316 __ test_method_data_pointer(*profile_method); 317 } 318 319 AddressLiteral invocation_limit(&InvocationCounter::InterpreterInvocationLimit); 320 __ sethi(invocation_limit, G3_scratch); 321 __ ld(G3_scratch, invocation_limit.low10(), G3_scratch); 322 __ cmp(O0, G3_scratch); 323 __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); 324 __ delayed()->nop(); 374 } 325 375 326 376 } … … 1315 1365 __ bind(profile_method); 1316 1366 1317 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method), Lbcp, true); 1318 1319 #ifdef ASSERT 1320 __ tst(O0); 1321 __ breakpoint_trap(Assembler::notEqual); 1322 #endif 1323 1324 __ set_method_data_pointer(); 1325 1367 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); 1368 __ set_method_data_pointer_for_bcp(); 1326 1369 __ ba(false, profile_method_continue); 1327 1370 __ delayed()->nop(); -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp
r278 r309 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP 26 #define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP 27 25 28 26 29 protected: … … 39 42 const static int InterpreterCodeSize = 180 * K; 40 43 #endif 44 45 #endif // CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 201 0, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_templateTable_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "interpreter/interpreter.hpp" 27 #include "interpreter/interpreterRuntime.hpp" 28 #include "interpreter/templateTable.hpp" 29 #include "memory/universe.inline.hpp" 30 #include "oops/methodDataOop.hpp" 31 #include "oops/objArrayKlass.hpp" 32 #include "oops/oop.inline.hpp" 33 #include "prims/methodHandles.hpp" 34 #include "runtime/sharedRuntime.hpp" 35 #include "runtime/stubRoutines.hpp" 36 #include "runtime/synchronizer.hpp" 27 37 28 38 #ifndef CC_INTERP … … 342 352 343 353 __ verify_oop(Otos_i); 354 355 Label L_done; 356 const Register Rcon_klass = G3_scratch; // same as Rcache 357 const Register Rarray_klass = G4_scratch; // same as Rscratch 358 __ load_klass(Otos_i, Rcon_klass); 359 AddressLiteral array_klass_addr((address)Universe::systemObjArrayKlassObj_addr()); 360 __ load_contents(array_klass_addr, Rarray_klass); 361 __ cmp(Rarray_klass, Rcon_klass); 362 __ brx(Assembler::notEqual, false, Assembler::pt, L_done); 363 __ delayed()->nop(); 364 __ ld(Address(Otos_i, arrayOopDesc::length_offset_in_bytes()), Rcon_klass); 365 __ tst(Rcon_klass); 366 __ brx(Assembler::zero, true, Assembler::pt, L_done); 367 __ delayed()->clr(Otos_i); // executed only if branch is taken 368 369 // Load the exception from the system-array which wraps it: 370 __ load_heap_oop(Otos_i, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i); 371 __ throw_if_not_x(Assembler::never, Interpreter::throw_exception_entry(), G3_scratch); 372 373 __ bind(L_done); 344 374 } 345 375 … … 1581 1611 __ mov( Lbcp, O0_cur_bcp ); 1582 1612 1613 1583 1614 bool increment_invocation_counter_for_backward_branches = UseCompiler && UseLoopCounter; 1584 1615 if ( increment_invocation_counter_for_backward_branches ) { … … 1589 1620 __ delayed()->add( O1_disp, Lbcp, Lbcp ); // add to bc addr 1590 1621 1591 // Update Backedge branch separately from invocations 1592 const Register G4_invoke_ctr = G4; 1593 __ increment_backedge_counter(G4_invoke_ctr, G1_scratch); 1594 if (ProfileInterpreter) { 1595 __ test_invocation_counter_for_mdp(G4_invoke_ctr, Lbcp, G3_scratch, Lforward); 1596 if (UseOnStackReplacement) { 1597 __ test_backedge_count_for_osr(O2_bumped_count, O0_cur_bcp, G3_scratch); 1622 if (TieredCompilation) { 1623 Label Lno_mdo, Loverflow; 1624 int increment = InvocationCounter::count_increment; 1625 int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift; 1626 if (ProfileInterpreter) { 1627 // If no method data exists, go to profile_continue. 1628 __ ld_ptr(Lmethod, methodOopDesc::method_data_offset(), G4_scratch); 1629 __ br_null(G4_scratch, false, Assembler::pn, Lno_mdo); 1630 __ delayed()->nop(); 1631 1632 // Increment backedge counter in the MDO 1633 Address mdo_backedge_counter(G4_scratch, in_bytes(methodDataOopDesc::backedge_counter_offset()) + 1634 in_bytes(InvocationCounter::counter_offset())); 1635 __ increment_mask_and_jump(mdo_backedge_counter, increment, mask, G3_scratch, Lscratch, 1636 Assembler::notZero, &Lforward); 1637 __ ba(false, Loverflow); 1638 __ delayed()->nop(); 1598 1639 } 1640 1641 // If there's no MDO, increment counter in methodOop 1642 __ bind(Lno_mdo); 1643 Address backedge_counter(Lmethod, in_bytes(methodOopDesc::backedge_counter_offset()) + 1644 in_bytes(InvocationCounter::counter_offset())); 1645 __ increment_mask_and_jump(backedge_counter, increment, mask, G3_scratch, Lscratch, 1646 Assembler::notZero, &Lforward); 1647 __ bind(Loverflow); 1648 1649 // notify point for loop, pass branch bytecode 1650 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O0_cur_bcp); 1651 1652 // Was an OSR adapter generated? 1653 // O0 = osr nmethod 1654 __ br_null(O0, false, Assembler::pn, Lforward); 1655 __ delayed()->nop(); 1656 1657 // Has the nmethod been invalidated already? 1658 __ ld(O0, nmethod::entry_bci_offset(), O2); 1659 __ cmp(O2, InvalidOSREntryBci); 1660 __ br(Assembler::equal, false, Assembler::pn, Lforward); 1661 __ delayed()->nop(); 1662 1663 // migrate the interpreter frame off of the stack 1664 1665 __ mov(G2_thread, L7); 1666 // save nmethod 1667 __ mov(O0, L6); 1668 __ set_last_Java_frame(SP, noreg); 1669 __ call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::OSR_migration_begin), L7); 1670 __ reset_last_Java_frame(); 1671 __ mov(L7, G2_thread); 1672 1673 // move OSR nmethod to I1 1674 __ mov(L6, I1); 1675 1676 // OSR buffer to I0 1677 __ mov(O0, I0); 1678 1679 // remove the interpreter frame 1680 __ restore(I5_savedSP, 0, SP); 1681 1682 // Jump to the osr code. 1683 __ ld_ptr(O1, nmethod::osr_entry_point_offset(), O2); 1684 __ jmp(O2, G0); 1685 __ delayed()->nop(); 1686 1599 1687 } else { 1600 if (UseOnStackReplacement) { 1601 __ test_backedge_count_for_osr(G4_invoke_ctr, O0_cur_bcp, G3_scratch); 1688 // Update Backedge branch separately from invocations 1689 const Register G4_invoke_ctr = G4; 1690 __ increment_backedge_counter(G4_invoke_ctr, G1_scratch); 1691 if (ProfileInterpreter) { 1692 __ test_invocation_counter_for_mdp(G4_invoke_ctr, G3_scratch, Lforward); 1693 if (UseOnStackReplacement) { 1694 __ test_backedge_count_for_osr(O2_bumped_count, O0_cur_bcp, G3_scratch); 1695 } 1696 } else { 1697 if (UseOnStackReplacement) { 1698 __ test_backedge_count_for_osr(G4_invoke_ctr, O0_cur_bcp, G3_scratch); 1699 } 1602 1700 } 1603 1701 } … … 3206 3304 __ ld_ptr(Rtemp, Rret, Rret); // get return address 3207 3305 3208 __ l d_ptr(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle);3306 __ load_heap_oop(G5_callsite, __ delayed_value(java_dyn_CallSite::target_offset_in_bytes, Rscratch), G3_method_handle); 3209 3307 __ null_check(G3_method_handle); 3210 3308 … … 3296 3394 3297 3395 if (allow_shared_alloc) { 3298 // Check if tlab should be discarded (refill_waste_limit >= free)3299 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue);3300 __ sub(RendValue, RoldTopValue, RfreeValue);3396 // Check if tlab should be discarded (refill_waste_limit >= free) 3397 __ ld_ptr(G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()), RtlabWasteLimitValue); 3398 __ sub(RendValue, RoldTopValue, RfreeValue); 3301 3399 #ifdef _LP64 3302 __ srlx(RfreeValue, LogHeapWordSize, RfreeValue);3400 __ srlx(RfreeValue, LogHeapWordSize, RfreeValue); 3303 3401 #else 3304 __ srl(RfreeValue, LogHeapWordSize, RfreeValue);3402 __ srl(RfreeValue, LogHeapWordSize, RfreeValue); 3305 3403 #endif 3306 __ cmp(RtlabWasteLimitValue, RfreeValue);3307 __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small3308 __ delayed()->nop();3309 3310 // increment waste limit to prevent getting stuck on this slow path3311 __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue);3312 __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset()));3404 __ cmp(RtlabWasteLimitValue, RfreeValue); 3405 __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, slow_case); // tlab waste is small 3406 __ delayed()->nop(); 3407 3408 // increment waste limit to prevent getting stuck on this slow path 3409 __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); 3410 __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); 3313 3411 } else { 3314 3412 // No allocation in the shared eden. … … 3348 3446 __ brx(Assembler::notEqual, false, Assembler::pn, retry); 3349 3447 __ delayed()->nop(); 3448 3449 // bump total bytes allocated by this thread 3450 // RoldTopValue and RtopAddr are dead, so can use G1 and G3 3451 __ incr_allocated_bytes(Roffset, G1_scratch, G3_scratch); 3350 3452 } 3351 3453 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/templateTable_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1998, 20 02, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP 26 #define CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP 27 25 28 // helper function 26 29 static void invokevfinal_helper(Register Rcache, Register Rret); … … 30 33 static void generate_vtable_call(Register Rrecv, Register Rindex, Register Rret); 31 34 static void volatile_barrier(Assembler::Membar_mask_bits order_constraint); 35 36 #endif // CPU_SPARC_VM_TEMPLATETABLE_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP 26 #define CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP 24 27 25 28 // These are the CPU-specific fields, types and integer … … 98 101 /* in vmStructs_<os>_<cpu>.hpp's VM_LONG_CONSTANTS_OS_CPU macro (and must */ 99 102 /* be present there) */ 103 104 #endif // CPU_SPARC_VM_VMSTRUCTS_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_vm_version_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "assembler_sparc.inline.hpp" 27 #include "memory/resourceArea.hpp" 28 #include "runtime/java.hpp" 29 #include "runtime/stubCodeGenerator.hpp" 30 #include "vm_version_sparc.hpp" 31 #ifdef TARGET_OS_FAMILY_linux 32 # include "os_linux.inline.hpp" 33 #endif 34 #ifdef TARGET_OS_FAMILY_solaris 35 # include "os_solaris.inline.hpp" 36 #endif 27 37 28 38 int VM_Version::_features = VM_Version::unknown_m; 29 39 const char* VM_Version::_features_str = ""; 30 31 bool VM_Version::is_niagara1_plus() {32 // This is a placeholder until the real test is determined.33 return is_niagara1() &&34 (os::processor_count() > maximum_niagara1_processor_count());35 }36 40 37 41 void VM_Version::initialize() { … … 60 64 _supports_cx8 = has_v9(); 61 65 62 if (is_niagara 1()) {66 if (is_niagara()) { 63 67 // Indirect branch is the same cost as direct 64 68 if (FLAG_IS_DEFAULT(UseInlineCaches)) { 65 69 FLAG_SET_DEFAULT(UseInlineCaches, false); 70 } 71 // Align loops on a single instruction boundary. 72 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) { 73 FLAG_SET_DEFAULT(OptoLoopAlignment, 4); 74 } 75 // When using CMS, we cannot use memset() in BOT updates because 76 // the sun4v/CMT version in libc_psr uses BIS which exposes 77 // "phantom zeros" to concurrent readers. See 6948537. 78 if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) { 79 FLAG_SET_DEFAULT(UseMemSetInBOT, false); 66 80 } 67 81 #ifdef _LP64 … … 80 94 FLAG_SET_DEFAULT(InteriorEntryAlignment, 4); 81 95 } 82 if (is_niagara1_plus()) { 83 if (AllocatePrefetchStyle > 0 && FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { 96 if (is_niagara_plus()) { 97 if (has_blk_init() && AllocatePrefetchStyle > 0 && 98 FLAG_IS_DEFAULT(AllocatePrefetchStyle)) { 84 99 // Use BIS instruction for allocation prefetch. 85 100 FLAG_SET_DEFAULT(AllocatePrefetchStyle, 3); … … 95 110 } 96 111 #endif 97 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {98 FLAG_SET_DEFAULT(OptoLoopAlignment, 4);99 }100 // When using CMS, we cannot use memset() in BOT updates because101 // the sun4v/CMT version in libc_psr uses BIS which exposes102 // "phantom zeros" to concurrent readers. See 6948537.103 if (FLAG_IS_DEFAULT(UseMemSetInBOT) && UseConcMarkSweepGC) {104 FLAG_SET_DEFAULT(UseMemSetInBOT, false);105 }106 112 } 107 113 … … 119 125 120 126 char buf[512]; 121 jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s ",127 jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", 122 128 (has_v8() ? ", has_v8" : ""), 123 129 (has_v9() ? ", has_v9" : ""), … … 125 131 (has_vis1() ? ", has_vis1" : ""), 126 132 (has_vis2() ? ", has_vis2" : ""), 133 (has_vis3() ? ", has_vis3" : ""), 134 (has_blk_init() ? ", has_blk_init" : ""), 127 135 (is_ultra3() ? ", is_ultra3" : ""), 128 136 (is_sun4v() ? ", is_sun4v" : ""), 129 (is_niagara1() ? ", is_niagara1" : ""), 130 (is_niagara1_plus() ? ", is_niagara1_plus" : ""), 137 (is_niagara() ? ", is_niagara" : ""), 138 (is_niagara_plus() ? ", is_niagara_plus" : ""), 139 (is_sparc64() ? ", is_sparc64" : ""), 131 140 (!has_hardware_mul32() ? ", no-mul32" : ""), 132 141 (!has_hardware_div32() ? ", no-div32" : ""), … … 178 187 } 179 188 180 if (UseNiagaraInstrs) { 181 if (is_niagara1(features)) { 189 assert(is_T_family(features) == is_niagara(features), "Niagara should be T series"); 190 if (UseNiagaraInstrs) { // Force code generation for Niagara 191 if (is_T_family(features)) { 182 192 // Happy to accomodate... 183 193 } else { 184 194 NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Niagara");) 185 features = niagara1_m;195 features |= T_family_m; 186 196 } 187 197 } else { 188 if (is_ niagara1(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) {198 if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) { 189 199 NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");) 190 features &= ~ niagara1_unique_m;200 features &= ~(T_family_m | T1_model_m); 191 201 } else { 192 202 // Happy to accomodate... … … 210 220 unsigned int VM_Version::calc_parallel_worker_threads() { 211 221 unsigned int result; 212 if (is_niagara 1_plus()) {222 if (is_niagara_plus()) { 213 223 result = nof_parallel_worker_threads(5, 16, 8); 214 224 } else { -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_VM_VERSION_SPARC_HPP 26 #define CPU_SPARC_VM_VM_VERSION_SPARC_HPP 27 28 #include "runtime/globals_extension.hpp" 29 #include "runtime/vm_version.hpp" 30 25 31 class VM_Version: public Abstract_VM_Version { 26 32 protected: … … 34 40 vis1_instructions = 6, 35 41 vis2_instructions = 7, 36 sun4v_instructions = 8 42 sun4v_instructions = 8, 43 blk_init_instructions = 9, 44 fmaf_instructions = 10, 45 fmau_instructions = 11, 46 vis3_instructions = 12, 47 sparc64_family = 13, 48 T_family = 14, 49 T1_model = 15 37 50 }; 38 51 … … 50 63 vis2_instructions_m = 1 << vis2_instructions, 51 64 sun4v_m = 1 << sun4v_instructions, 65 blk_init_instructions_m = 1 << blk_init_instructions, 66 fmaf_instructions_m = 1 << fmaf_instructions, 67 fmau_instructions_m = 1 << fmau_instructions, 68 vis3_instructions_m = 1 << vis3_instructions, 69 sparc64_family_m = 1 << sparc64_family, 70 T_family_m = 1 << T_family, 71 T1_model_m = 1 << T1_model, 52 72 53 73 generic_v8_m = v8_instructions_m | hardware_mul32_m | hardware_div32_m | hardware_fsmuld_m, … … 67 87 static int platform_features(int features); 68 88 69 static bool is_niagara1(int features) { return (features & sun4v_m) != 0; } 89 // Returns true if the platform is in the niagara line (T series) 90 static bool is_T_family(int features) { return (features & T_family_m) != 0; } 91 static bool is_niagara() { return is_T_family(_features); } 92 DEBUG_ONLY( static bool is_niagara(int features) { return (features & sun4v_m) != 0; } ) 93 94 // Returns true if it is niagara1 (T1). 95 static bool is_T1_model(int features) { return is_T_family(features) && ((features & T1_model_m) != 0); } 70 96 71 97 static int maximum_niagara1_processor_count() { return 32; } 72 // Returns true if the platform is in the niagara line and73 // newer than the niagara1.74 static bool is_niagara1_plus();75 98 76 99 public: … … 87 110 static bool has_vis1() { return (_features & vis1_instructions_m) != 0; } 88 111 static bool has_vis2() { return (_features & vis2_instructions_m) != 0; } 112 static bool has_vis3() { return (_features & vis3_instructions_m) != 0; } 113 static bool has_blk_init() { return (_features & blk_init_instructions_m) != 0; } 89 114 90 115 static bool supports_compare_and_exchange() … … 93 118 static bool is_ultra3() { return (_features & ultra3_m) == ultra3_m; } 94 119 static bool is_sun4v() { return (_features & sun4v_m) != 0; } 95 static bool is_niagara1() { return is_niagara1(_features); } 120 // Returns true if the platform is in the niagara line (T series) 121 // and newer than the niagara1. 122 static bool is_niagara_plus() { return is_T_family(_features) && !is_T1_model(_features); } 123 // Fujitsu SPARC64 124 static bool is_sparc64() { return (_features & sparc64_family_m) != 0; } 96 125 97 static bool has_fast_fxtof() { return has_v9() && !is_ultra3(); } 126 static bool has_fast_fxtof() { return is_niagara() || is_sparc64() || has_v9() && !is_ultra3(); } 127 static bool has_fast_idiv() { return is_niagara_plus() || is_sparc64(); } 98 128 99 129 static const char* cpu_features() { return _features_str; } … … 145 175 static unsigned int calc_parallel_worker_threads(); 146 176 }; 177 178 #endif // CPU_SPARC_VM_VM_VERSION_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 2006, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_vmreg_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "code/vmreg.hpp" 27 28 28 29 -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 23 23 */ 24 24 25 #ifndef CPU_SPARC_VM_VMREG_SPARC_HPP 26 #define CPU_SPARC_VM_VMREG_SPARC_HPP 27 25 28 bool is_Register(); 26 29 Register as_Register(); … … 28 31 bool is_FloatRegister(); 29 32 FloatRegister as_FloatRegister(); 33 34 #endif // CPU_SPARC_VM_VMREG_SPARC_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vmreg_sparc.inline.hpp
r278 r309 1 1 /* 2 * Copyright (c) 2006, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 22 22 * 23 23 */ 24 25 #ifndef CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP 26 #define CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP 24 27 25 28 inline VMReg RegisterImpl::as_VMReg() { … … 61 64 return false; 62 65 } 66 67 #endif // CPU_SPARC_VM_VMREG_SPARC_INLINE_HPP -
trunk/openjdk/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
r278 r309 1 1 /* 2 * Copyright (c) 1997, 20 09, Oracle and/or its affiliates. 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 * … … 23 23 */ 24 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_vtableStubs_sparc.cpp.incl" 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_sparc.inline.hpp" 28 #include "code/vtableStubs.hpp" 29 #include "interp_masm_sparc.hpp" 30 #include "memory/resourceArea.hpp" 31 #include "oops/instanceKlass.hpp" 32 #include "oops/klassVtable.hpp" 33 #include "runtime/sharedRuntime.hpp" 34 #include "vmreg_sparc.inline.hpp" 35 #ifdef COMPILER2 36 #include "opto/runtime.hpp" 37 #endif 27 38 28 39 // machine-dependent part of VtableStubs: create vtableStub of correct size and
Note:
See TracChangeset
for help on using the changeset viewer.