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