< prev index next >

src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page
rev 8961 : [mq]: diff-shenandoah.patch
rev 8417 : Merge
rev 8413 : 8079792: GC directory structure cleanup
Reviewed-by: brutisso, stefank, david
rev 8379 : 8076276: Add support for AVX512
Reviewed-by: kvn, roland
Contributed-by: michael.c.berg@intel.com
rev 8337 : 8013171: G1: C1 x86_64 barriers use 32-bit accesses to 64-bit PtrQueue::_index
Reviewed-by: roland, tschatzl
rev 8290 : 8068945: Use RBP register as proper frame pointer in JIT compiled code on x86
Summary: Introduce the PreserveFramePointer flag to control if RBP is used as the frame pointer or as a general purpose register.
Reviewed-by: kvn, roland, dlong, enevill, shade
rev 7923 : 8069016: Add BarrierSet downcast support
Summary: Add FakeRttiSupport utility and use to provide barrier_set_cast.
Reviewed-by: jmasa, sangheki
rev 7543 : 8066900: Array Out Of Bounds Exception causes variable corruption
Summary: Fix FP registers save/restore during exception handling
Reviewed-by: kvn, vlivanov
rev 7331 : 8062370: Various minor code improvements
Summary: A lot of fixes useful to improve the code quality.
Reviewed-by: coleenp, dholmes
rev 6430 : 8032463: VirtualDispatch test timeout with DeoptimizeALot
Summary: Introduce code aging for warm method detection
Reviewed-by: kvn, twisti
rev 5776 : 8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
Summary: Copyright year updated for files modified during 2013
Reviewed-by: twisti, iveresov
rev 5720 : 8028109: compiler/codecache/CheckReservedInitialCodeCacheSizeArgOrder.java crashes in RT_Baseline
Summary: Use non-relocatable code to load byte_map_base
Reviewed-by: kvn, roland
rev 5425 : 8014555: G1: Memory ordering problem with Conc refinement and card marking
Summary: Add a StoreLoad barrier in the G1 post-barrier to fix a race with concurrent refinement. Also-reviewed-by: martin.doerr@sap.com
Reviewed-by: iveresov, tschatzl, brutisso, roland, kvn
rev 5193 : 7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
Summary: Do patching rather bailing out for unlinked call with appendix
Reviewed-by: twisti, kvn
rev 4425 : 7153771: array bound check elimination for c1
Summary: when possible optimize out array bound checks, inserting predicates when needed.
Reviewed-by: never, kvn, twisti
Contributed-by: thomaswue <thomas.wuerthinger@oracle.com>
rev 4107 : 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
Summary: Rename INCLUDE_ALTERNATE_GCS to INCLUDE_ALL_GCS and replace SERIALGC with INCLUDE_ALL_GCS.
Reviewed-by: coleenp, stefank
rev 3602 : 6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
rev 3172 : 7148486: At a method handle call returning with an exception may call the runtime with misaligned stack (x64)
Summary: stack must be realigned when calling the runtime for exception propagation at a call.
Reviewed-by: kvn, never
rev 2965 : Merge
rev 2956 : 7118863: Move sizeof(klassOopDesc) into the *Klass::*_offset_in_bytes() functions
Summary: Moved sizeof(klassOopDesc), changed the return type to ByteSize and removed the _in_bytes suffix.
Reviewed-by: never, bdelsart, coleenp, jrose
rev 2933 : 7117052: instanceKlass::_init_state can be u1 type
Summary: Change instanceKlass::_init_state field to u1 type.
Reviewed-by: bdelsart, coleenp, dholmes, phh, never
Contributed-by: Jiangli Zhou <jiangli.zhou@oracle.com>
rev 2809 : 7102657: JSR 292: C1 deoptimizes unlinked invokedynamic call sites infinitely
Reviewed-by: never, bdelsart
rev 2664 : 7083786: dead various dead chunks of code
Reviewed-by: iveresov, kvn
rev 2262 : 7032388: guarantee(VM_Version::supports_cmov()) failed: illegal instruction on i586 after 6919934
Summary: 6919934 added some unguarded cmov instructions which hit a guarantee on older hardware.
Reviewed-by: never, iveresov, kvn, phh
rev 2168 : 7012914: JSR 292 MethodHandlesTest C1: frame::verify_return_pc(return_address) failed: must be a return pc
Reviewed-by: never, bdelsart
rev 2053 : 7008809: should report the class in ArrayStoreExceptions from compiled code
Reviewed-by: iveresov, twisti
rev 1988 : 7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
Summary: Track allocated bytes in Thread's, update on TLAB retirement and direct allocation in Eden and tenured, add JNI methods for ThreadMXBean.
Reviewed-by: coleenp, kvn, dholmes, ysr
rev 1909 : 6985015: C1 needs to support compressed oops
Summary: This change implements compressed oops for C1 for x64 and sparc. The changes are mostly on the codegen level, with a few exceptions when we do access things outside of the heap that are uncompressed from the IR. Compressed oops are now also enabled with tiered.
Reviewed-by: twisti, kvn, never, phh
rev 1879 : 6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions.
Reviewed-by: coleenp, kvn, kamg
rev 1703 : 6953144: Tiered compilation
Summary: Infrastructure for tiered compilation support (interpreter + c1 + c2) for 32 and 64 bit. Simple tiered policy implementation.
Reviewed-by: kvn, never, phh, twisti
rev 1601 : 6953477: Increase portability and flexibility of building Hotspot
Summary: A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail.
Reviewed-by: phh, never, coleenp, dholmes
rev 1499 : Merge
rev 1492 : 6955349: C1: Make G1 barriers work with x64
Summary: This fixes G1 barriers in c1 on x64.
Reviewed-by: never
rev 1484 : 6930772: JSR 292 needs to support SPARC C1
Summary: C1 for SPARC needs to support JSR 292.
Reviewed-by: never, jrose
rev 1472 : 6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair
rev 1368 : 6941529: SharedRuntime::raw_exception_handler_for_return_address must reset thread MethodHandle flag
Summary: During testing a bug was hit when an exception returned to the interpreter and the SP was wrong.
Reviewed-by: kvn, never
rev 1295 : 6919934: JSR 292 needs to support x86 C1
Summary: This implements JSR 292 support for C1 x86.
Reviewed-by: never, jrose, kvn
rev 647 : Merge
rev 644 : 6813212: factor duplicated assembly code for general subclass check (for 6655638)
Summary: Code in interp_masm, stubGenerator, c1_LIRAssembler, and AD files moved into MacroAssembler.
Reviewed-by: kvn
rev 579 : 6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair
rev 533 : 6795913: A few remaining wrong casts need to be fixed for building hotspot successfully on Mac OS.
Summary: Use NULL_WORD in the places where intptr_t is expected due to incompatible types between intptr_t & int32_t
Reviewed-by: phh, coleenp, never
rev 512 : 6787106: Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t
Summary: Avoid casting between int32_t and intptr_t specifically for MasmAssembler::movptr in 32 bit platforms.
Reviewed-by: jrose, kvn
rev 380 : Merge
rev 362 : Merge
rev 342 : 6711316: Open source the Garbage-First garbage collector
Summary: First mercurial integration of the code for the Garbage-First garbage collector.
Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
rev 337 : 6754988: Update copyright year
Summary: Update for files that have been modified starting July 2008
Reviewed-by: ohair, tbell
rev 304 : 5108146: Merge i486 and amd64 cpu directories
6459804: Want client (c1) compiler for x86_64 (amd64) for faster start-up
Reviewed-by: kvn
rev 0 : Initial load


  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/assembler.hpp"
  27 #include "c1/c1_Defs.hpp"
  28 #include "c1/c1_MacroAssembler.hpp"
  29 #include "c1/c1_Runtime1.hpp"
  30 #include "interpreter/interpreter.hpp"
  31 #include "nativeInst_x86.hpp"
  32 #include "oops/compiledICHolder.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/jvmtiExport.hpp"
  35 #include "register_x86.hpp"
  36 #include "runtime/sharedRuntime.hpp"
  37 #include "runtime/signature.hpp"
  38 #include "runtime/vframeArray.hpp"
  39 #include "utilities/macros.hpp"
  40 #include "vmreg_x86.inline.hpp"
  41 #if INCLUDE_ALL_GCS

  42 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  43 #endif
  44 
  45 
  46 // Implementation of StubAssembler
  47 
  48 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) {
  49   // setup registers
  50   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
  51   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) || oop_result1 != metadata_result, "registers must be different");
  52   assert(oop_result1 != thread && metadata_result != thread, "registers must be different");
  53   assert(args_size >= 0, "illegal args_size");
  54   bool align_stack = false;
  55 #ifdef _LP64
  56   // At a method handle call, the stack may not be properly aligned
  57   // when returning with an exception.
  58   align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id);
  59 #endif
  60 
  61 #ifdef _LP64


1640 
1641         __ bind(return0);
1642         __ fpop();
1643 #ifndef _LP64
1644         __ xorptr(rdx,rdx);
1645         __ xorptr(rax,rax);
1646 #else
1647         __ xorptr(rax, rax);
1648 #endif // _LP64
1649 
1650         __ bind(do_return);
1651         __ addptr(rsp, 32);
1652         LP64_ONLY(__ pop(rdx);)
1653         __ pop(rcx);
1654         __ pop(rsi);
1655         __ ret(0);
1656       }
1657       break;
1658 
1659 #if INCLUDE_ALL_GCS











1660     case g1_pre_barrier_slow_id:
1661       {
1662         StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments);
1663         // arg0 : previous value of memory
1664 
1665         BarrierSet* bs = Universe::heap()->barrier_set();
1666         if (bs->kind() != BarrierSet::G1SATBCTLogging) {
1667           __ movptr(rax, (int)id);
1668           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);
1669           __ should_not_reach_here();
1670           break;
1671         }
1672         __ push(rax);
1673         __ push(rdx);
1674 
1675         const Register pre_val = rax;
1676         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
1677         const Register tmp = rdx;
1678 
1679         NOT_LP64(__ get_thread(thread);)
1680 
1681         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1682                                              PtrQueue::byte_offset_of_index()));
1683         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1684                                         PtrQueue::byte_offset_of_buf()));
1685 
1686         Label done;


1724         __ pop(r10);
1725         __ pop(r9);
1726         __ pop(r8);
1727 #endif
1728         __ pop(rcx);
1729         __ bind(done);
1730 
1731         __ pop(rdx);
1732         __ pop(rax);
1733       }
1734       break;
1735 
1736     case g1_post_barrier_slow_id:
1737       {
1738         StubFrame f(sasm, "g1_post_barrier", dont_gc_arguments);
1739 
1740 
1741         // arg0: store_address
1742         Address store_addr(rbp, 2*BytesPerWord);
1743 







1744         CardTableModRefBS* ct =
1745           barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
1746         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
1747 
1748         Label done;
1749         Label enqueued;
1750         Label runtime;
1751 
1752         // At this point we know new_value is non-NULL and the new_value crosses regions.
1753         // Must check to see if card is already dirty
1754 
1755         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
1756 
1757         Address queue_index(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1758                                              PtrQueue::byte_offset_of_index()));
1759         Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1760                                         PtrQueue::byte_offset_of_buf()));
1761 
1762         __ push(rax);
1763         __ push(rcx);
1764 
1765         const Register cardtable = rax;




  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/assembler.hpp"
  27 #include "c1/c1_Defs.hpp"
  28 #include "c1/c1_MacroAssembler.hpp"
  29 #include "c1/c1_Runtime1.hpp"
  30 #include "interpreter/interpreter.hpp"
  31 #include "nativeInst_x86.hpp"
  32 #include "oops/compiledICHolder.hpp"
  33 #include "oops/oop.inline.hpp"
  34 #include "prims/jvmtiExport.hpp"
  35 #include "register_x86.hpp"
  36 #include "runtime/sharedRuntime.hpp"
  37 #include "runtime/signature.hpp"
  38 #include "runtime/vframeArray.hpp"
  39 #include "utilities/macros.hpp"
  40 #include "vmreg_x86.inline.hpp"
  41 #if INCLUDE_ALL_GCS
  42 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  43 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  44 #endif
  45 
  46 
  47 // Implementation of StubAssembler
  48 
  49 int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, int args_size) {
  50   // setup registers
  51   const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); // is callee-saved register (Visual C++ calling conventions)
  52   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) || oop_result1 != metadata_result, "registers must be different");
  53   assert(oop_result1 != thread && metadata_result != thread, "registers must be different");
  54   assert(args_size >= 0, "illegal args_size");
  55   bool align_stack = false;
  56 #ifdef _LP64
  57   // At a method handle call, the stack may not be properly aligned
  58   // when returning with an exception.
  59   align_stack = (stub_id() == Runtime1::handle_exception_from_callee_id);
  60 #endif
  61 
  62 #ifdef _LP64


1641 
1642         __ bind(return0);
1643         __ fpop();
1644 #ifndef _LP64
1645         __ xorptr(rdx,rdx);
1646         __ xorptr(rax,rax);
1647 #else
1648         __ xorptr(rax, rax);
1649 #endif // _LP64
1650 
1651         __ bind(do_return);
1652         __ addptr(rsp, 32);
1653         LP64_ONLY(__ pop(rdx);)
1654         __ pop(rcx);
1655         __ pop(rsi);
1656         __ ret(0);
1657       }
1658       break;
1659 
1660 #if INCLUDE_ALL_GCS
1661     case shenandoah_write_barrier_slow_id:
1662       {
1663         StubFrame f(sasm, "shenandoah_write_barrier", dont_gc_arguments);
1664 
1665         save_live_registers(sasm, 1);
1666         __ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahBarrierSet::resolve_and_maybe_copy_oop_c1), r15_thread, rax);
1667         restore_live_registers_except_rax(sasm);
1668         __ verify_oop(rax);
1669 
1670       }
1671       break;
1672     case g1_pre_barrier_slow_id:
1673       {
1674         StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments);
1675         // arg0 : previous value of memory
1676 
1677         BarrierSet* bs = Universe::heap()->barrier_set();
1678         if (bs->kind() != BarrierSet::G1SATBCTLogging && bs->kind() != BarrierSet::ShenandoahBarrierSet) {
1679           __ movptr(rax, (int)id);
1680           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);
1681           __ should_not_reach_here();
1682           break;
1683         }
1684         __ push(rax);
1685         __ push(rdx);
1686 
1687         const Register pre_val = rax;
1688         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
1689         const Register tmp = rdx;
1690 
1691         NOT_LP64(__ get_thread(thread);)
1692 
1693         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1694                                              PtrQueue::byte_offset_of_index()));
1695         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1696                                         PtrQueue::byte_offset_of_buf()));
1697 
1698         Label done;


1736         __ pop(r10);
1737         __ pop(r9);
1738         __ pop(r8);
1739 #endif
1740         __ pop(rcx);
1741         __ bind(done);
1742 
1743         __ pop(rdx);
1744         __ pop(rax);
1745       }
1746       break;
1747 
1748     case g1_post_barrier_slow_id:
1749       {
1750         StubFrame f(sasm, "g1_post_barrier", dont_gc_arguments);
1751 
1752 
1753         // arg0: store_address
1754         Address store_addr(rbp, 2*BytesPerWord);
1755 
1756         BarrierSet* bs = Universe::heap()->barrier_set();
1757         if (bs->kind() == BarrierSet::ShenandoahBarrierSet) {
1758           __ movptr(rax, (int)id);
1759           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax);
1760           __ should_not_reach_here();
1761           break;
1762         }
1763         CardTableModRefBS* ct =
1764           barrier_set_cast<CardTableModRefBS>(bs);
1765         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
1766 
1767         Label done;
1768         Label enqueued;
1769         Label runtime;
1770 
1771         // At this point we know new_value is non-NULL and the new_value crosses regions.
1772         // Must check to see if card is already dirty
1773 
1774         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
1775 
1776         Address queue_index(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1777                                              PtrQueue::byte_offset_of_index()));
1778         Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1779                                         PtrQueue::byte_offset_of_buf()));
1780 
1781         __ push(rax);
1782         __ push(rcx);
1783 
1784         const Register cardtable = rax;


< prev index next >