31 #include "opto/output.hpp"
32 #include "opto/subnode.hpp"
33 #include "runtime/objectMonitorTable.hpp"
34 #include "runtime/stubRoutines.hpp"
35 #include "runtime/synchronizer.hpp"
36 #include "utilities/globalDefinitions.hpp"
37 #include "utilities/powerOfTwo.hpp"
38
39 #ifdef PRODUCT
40 #define BLOCK_COMMENT(str) /* nothing */
41 #define STOP(error) stop(error)
42 #else
43 #define BLOCK_COMMENT(str) block_comment(str)
44 #define STOP(error) block_comment(error); stop(error)
45 #endif
46
47 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
48
49 typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
50
51 // jdk.internal.util.ArraysSupport.vectorizedHashCode
52 address C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result,
53 FloatRegister vdata0, FloatRegister vdata1,
54 FloatRegister vdata2, FloatRegister vdata3,
55 FloatRegister vmul0, FloatRegister vmul1,
56 FloatRegister vmul2, FloatRegister vmul3,
57 FloatRegister vpow, FloatRegister vpowm,
58 BasicType eltype) {
59 ARRAYS_HASHCODE_REGISTERS;
60
61 Register tmp1 = rscratch1, tmp2 = rscratch2;
62
63 Label TAIL, STUB_SWITCH, STUB_SWITCH_OUT, LOOP, BR_BASE, LARGE, DONE;
64
65 // Vectorization factor. Number of array elements loaded to one SIMD&FP registers by the stubs. We
66 // use 8H load arrangements for chars and shorts and 8B for booleans and bytes. It's possible to
67 // use 4H for chars and shorts instead, but using 8H gives better performance.
68 const size_t vf = eltype == T_BOOLEAN || eltype == T_BYTE ? 8
69 : eltype == T_CHAR || eltype == T_SHORT ? 8
70 : eltype == T_INT ? 4
|
31 #include "opto/output.hpp"
32 #include "opto/subnode.hpp"
33 #include "runtime/objectMonitorTable.hpp"
34 #include "runtime/stubRoutines.hpp"
35 #include "runtime/synchronizer.hpp"
36 #include "utilities/globalDefinitions.hpp"
37 #include "utilities/powerOfTwo.hpp"
38
39 #ifdef PRODUCT
40 #define BLOCK_COMMENT(str) /* nothing */
41 #define STOP(error) stop(error)
42 #else
43 #define BLOCK_COMMENT(str) block_comment(str)
44 #define STOP(error) block_comment(error); stop(error)
45 #endif
46
47 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
48
49 typedef void (MacroAssembler::* chr_insn)(Register Rt, const Address &adr);
50
51 void C2_MacroAssembler::entry_barrier() {
52 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
53 // Dummy labels for just measuring the code size
54 Label dummy_slow_path;
55 Label dummy_continuation;
56 Label dummy_guard;
57 Label* slow_path = &dummy_slow_path;
58 Label* continuation = &dummy_continuation;
59 Label* guard = &dummy_guard;
60 if (!Compile::current()->output()->in_scratch_emit_size()) {
61 // Use real labels from actual stub when not emitting code for the purpose of measuring its size
62 C2EntryBarrierStub* stub = new (Compile::current()->comp_arena()) C2EntryBarrierStub();
63 Compile::current()->output()->add_stub(stub);
64 slow_path = &stub->entry();
65 continuation = &stub->continuation();
66 guard = &stub->guard();
67 }
68 // In the C2 code, we move the non-hot part of nmethod entry barriers out-of-line to a stub.
69 bs->nmethod_entry_barrier(this, slow_path, continuation, guard);
70 }
71
72 // jdk.internal.util.ArraysSupport.vectorizedHashCode
73 address C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result,
74 FloatRegister vdata0, FloatRegister vdata1,
75 FloatRegister vdata2, FloatRegister vdata3,
76 FloatRegister vmul0, FloatRegister vmul1,
77 FloatRegister vmul2, FloatRegister vmul3,
78 FloatRegister vpow, FloatRegister vpowm,
79 BasicType eltype) {
80 ARRAYS_HASHCODE_REGISTERS;
81
82 Register tmp1 = rscratch1, tmp2 = rscratch2;
83
84 Label TAIL, STUB_SWITCH, STUB_SWITCH_OUT, LOOP, BR_BASE, LARGE, DONE;
85
86 // Vectorization factor. Number of array elements loaded to one SIMD&FP registers by the stubs. We
87 // use 8H load arrangements for chars and shorts and 8B for booleans and bytes. It's possible to
88 // use 4H for chars and shorts instead, but using 8H gives better performance.
89 const size_t vf = eltype == T_BOOLEAN || eltype == T_BYTE ? 8
90 : eltype == T_CHAR || eltype == T_SHORT ? 8
91 : eltype == T_INT ? 4
|