@@ -49,11 +49,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
4949 bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0 ;
5050
5151 if (!dest_uninitialized) {
52- Register thread = NOT_LP64 (rax) LP64_ONLY (r15_thread);
53- #ifndef _LP64
54- __ push (thread);
55- __ get_thread (thread);
56- #endif
52+ Register thread = r15_thread;
5753
5854 Label filtered;
5955 Address in_progress (thread, in_bytes (G1ThreadLocalData::satb_mark_queue_active_offset ()));
@@ -65,12 +61,9 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
6561 __ cmpb (in_progress, 0 );
6662 }
6763
68- NOT_LP64 (__ pop (thread);)
69-
7064 __ jcc (Assembler::equal, filtered);
7165
7266 __ push_call_clobbered_registers (false /* save_fpu */ );
73- #ifdef _LP64
7467 if (count == c_rarg0) {
7568 if (addr == c_rarg1) {
7669 // exactly backwards!!
@@ -88,10 +81,6 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
8881 } else {
8982 __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_array_pre_oop_entry), 2 );
9083 }
91- #else
92- __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_array_pre_oop_entry),
93- addr, count);
94- #endif
9584 __ pop_call_clobbered_registers (false /* save_fpu */ );
9685
9786 __ bind (filtered);
@@ -101,7 +90,6 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm
10190void G1BarrierSetAssembler::gen_write_ref_array_post_barrier (MacroAssembler* masm, DecoratorSet decorators,
10291 Register addr, Register count, Register tmp) {
10392 __ push_call_clobbered_registers (false /* save_fpu */ );
104- #ifdef _LP64
10593 if (c_rarg0 == count) { // On win64 c_rarg0 == rcx
10694 assert_different_registers (c_rarg1, addr);
10795 __ mov (c_rarg1, count);
@@ -112,53 +100,26 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas
112100 __ mov (c_rarg1, count);
113101 }
114102 __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_array_post_entry), 2 );
115- #else
116- __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_array_post_entry),
117- addr, count);
118- #endif
119103 __ pop_call_clobbered_registers (false /* save_fpu */ );
104+
120105}
121106
122107void G1BarrierSetAssembler::load_at (MacroAssembler* masm, DecoratorSet decorators, BasicType type,
123- Register dst, Address src, Register tmp1, Register tmp_thread ) {
108+ Register dst, Address src, Register tmp1) {
124109 bool on_oop = is_reference_type (type);
125110 bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0 ;
126111 bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0 ;
127112 bool on_reference = on_weak || on_phantom;
128- ModRefBarrierSetAssembler::load_at (masm, decorators, type, dst, src, tmp1, tmp_thread );
113+ ModRefBarrierSetAssembler::load_at (masm, decorators, type, dst, src, tmp1);
129114 if (on_oop && on_reference) {
130- Register thread = NOT_LP64 (tmp_thread) LP64_ONLY (r15_thread);
131-
132- #ifndef _LP64
133- // Work around the x86_32 bug that only manifests with Loom for some reason.
134- // MacroAssembler::resolve_weak_handle calls this barrier with tmp_thread == noreg.
135- if (thread == noreg) {
136- if (dst != rcx && tmp1 != rcx) {
137- thread = rcx;
138- } else if (dst != rdx && tmp1 != rdx) {
139- thread = rdx;
140- } else if (dst != rdi && tmp1 != rdi) {
141- thread = rdi;
142- }
143- }
144- assert_different_registers (dst, tmp1, thread);
145- __ push (thread);
146- __ get_thread (thread);
147- #endif
148-
149115 // Generate the G1 pre-barrier code to log the value of
150116 // the referent field in an SATB buffer.
151117 g1_write_barrier_pre (masm /* masm */ ,
152118 noreg /* obj */ ,
153119 dst /* pre_val */ ,
154- thread /* thread */ ,
155120 tmp1 /* tmp */ ,
156121 true /* tosca_live */ ,
157122 true /* expand_call */ );
158-
159- #ifndef _LP64
160- __ pop (thread);
161- #endif
162123 }
163124}
164125
@@ -199,7 +160,7 @@ static void generate_pre_barrier_slow_path(MacroAssembler* masm,
199160 Label& runtime) {
200161 // Do we need to load the previous value?
201162 if (obj != noreg) {
202- __ load_heap_oop (pre_val, Address (obj, 0 ), noreg, noreg, AS_RAW);
163+ __ load_heap_oop (pre_val, Address (obj, 0 ), noreg, AS_RAW);
203164 }
204165 // Is the previous value null?
205166 __ cmpptr (pre_val, NULL_WORD);
@@ -215,17 +176,14 @@ static void generate_pre_barrier_slow_path(MacroAssembler* masm,
215176void G1BarrierSetAssembler::g1_write_barrier_pre (MacroAssembler* masm,
216177 Register obj,
217178 Register pre_val,
218- Register thread,
219179 Register tmp,
220180 bool tosca_live,
221181 bool expand_call) {
222182 // If expand_call is true then we expand the call_VM_leaf macro
223183 // directly to skip generating the check by
224184 // InterpreterMacroAssembler::call_VM_leaf_base that checks _last_sp.
225185
226- #ifdef _LP64
227- assert (thread == r15_thread, " must be" );
228- #endif // _LP64
186+ const Register thread = r15_thread;
229187
230188 Label done;
231189 Label runtime;
@@ -260,18 +218,13 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm,
260218 // expand_call should be passed true.
261219
262220 if (expand_call) {
263- LP64_ONLY ( assert (pre_val != c_rarg1, " smashed arg" ); )
264- #ifdef _LP64
221+ assert (pre_val != c_rarg1, " smashed arg" );
265222 if (c_rarg1 != thread) {
266223 __ mov (c_rarg1, thread);
267224 }
268225 if (c_rarg0 != pre_val) {
269226 __ mov (c_rarg0, pre_val);
270227 }
271- #else
272- __ push (thread);
273- __ push (pre_val);
274- #endif
275228 __ MacroAssembler::call_VM_leaf_base (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_field_pre_entry), 2 );
276229 } else {
277230 __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread);
@@ -333,12 +286,9 @@ static void generate_post_barrier_slow_path(MacroAssembler* masm,
333286void G1BarrierSetAssembler::g1_write_barrier_post (MacroAssembler* masm,
334287 Register store_addr,
335288 Register new_val,
336- Register thread,
337289 Register tmp,
338290 Register tmp2) {
339- #ifdef _LP64
340- assert (thread == r15_thread, " must be" );
341- #endif // _LP64
291+ const Register thread = r15_thread;
342292
343293 Label done;
344294 Label runtime;
@@ -350,7 +300,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
350300
351301 __ bind (runtime);
352302 // save the live input values
353- RegSet saved = RegSet::of (store_addr NOT_LP64 (COMMA thread) );
303+ RegSet saved = RegSet::of (store_addr);
354304 __ push_set (saved);
355305 __ call_VM_leaf (CAST_FROM_FN_PTR (address, G1BarrierSetRuntime::write_ref_field_post_entry), tmp, thread);
356306 __ pop_set (saved);
@@ -361,7 +311,6 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
361311#if defined(COMPILER2)
362312
363313static void generate_c2_barrier_runtime_call (MacroAssembler* masm, G1BarrierStubC2* stub, const Register arg, const address runtime_path) {
364- #ifdef _LP64
365314 SaveLiveRegisters save_registers (masm, stub);
366315 if (c_rarg0 != arg) {
367316 __ mov (c_rarg0, arg);
@@ -373,20 +322,15 @@ static void generate_c2_barrier_runtime_call(MacroAssembler* masm, G1BarrierStub
373322 // call. If it did not contain any live value, it is free to be used. In
374323 // either case, it is safe to use it here as a call scratch register.
375324 __ call (RuntimeAddress (runtime_path), rax);
376- #else
377- Unimplemented ();
378- #endif // _LP64
379325}
380326
381327void G1BarrierSetAssembler::g1_write_barrier_pre_c2 (MacroAssembler* masm,
382328 Register obj,
383329 Register pre_val,
384- Register thread,
385330 Register tmp,
386331 G1PreBarrierStubC2* stub) {
387- #ifdef _LP64
388- assert (thread == r15_thread, " must be" );
389- #endif // _LP64
332+ const Register thread = r15_thread;
333+
390334 assert (pre_val != noreg, " check this code" );
391335 if (obj != noreg) {
392336 assert_different_registers (obj, pre_val, tmp);
@@ -422,14 +366,10 @@ void G1BarrierSetAssembler::generate_c2_pre_barrier_stub(MacroAssembler* masm,
422366void G1BarrierSetAssembler::g1_write_barrier_post_c2 (MacroAssembler* masm,
423367 Register store_addr,
424368 Register new_val,
425- Register thread,
426369 Register tmp,
427370 Register tmp2,
428371 G1PostBarrierStubC2* stub) {
429- #ifdef _LP64
430- assert (thread == r15_thread, " must be" );
431- #endif // _LP64
432-
372+ const Register thread = r15_thread;
433373 stub->initialize_registers (thread, tmp, tmp2);
434374
435375 bool new_val_may_be_null = (stub->barrier_data () & G1C2BarrierPostNotNull) == 0 ;
@@ -467,7 +407,6 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco
467407 bool needs_pre_barrier = as_normal;
468408 bool needs_post_barrier = val != noreg && in_heap;
469409
470- Register rthread = LP64_ONLY (r15_thread) NOT_LP64 (rcx);
471410 // flatten object address if needed
472411 // We do it regardless of precise because we need the registers
473412 if (dst.index () == noreg && dst.disp () == 0 ) {
@@ -478,18 +417,10 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco
478417 __ lea (tmp1, dst);
479418 }
480419
481- #ifndef _LP64
482- InterpreterMacroAssembler *imasm = static_cast <InterpreterMacroAssembler*>(masm);
483- #endif
484-
485- NOT_LP64 (__ get_thread (rcx));
486- NOT_LP64 (imasm->save_bcp ());
487-
488420 if (needs_pre_barrier) {
489421 g1_write_barrier_pre (masm /* masm*/ ,
490422 tmp1 /* obj */ ,
491423 tmp2 /* pre_val */ ,
492- rthread /* thread */ ,
493424 tmp3 /* tmp */ ,
494425 val != noreg /* tosca_live */ ,
495426 false /* expand_call */ );
@@ -510,12 +441,10 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco
510441 g1_write_barrier_post (masm /* masm*/ ,
511442 tmp1 /* store_adr */ ,
512443 new_val /* new_val */ ,
513- rthread /* thread */ ,
514444 tmp3 /* tmp */ ,
515445 tmp2 /* tmp2 */ );
516446 }
517447 }
518- NOT_LP64 (imasm->restore_bcp ());
519448}
520449
521450#ifdef COMPILER1
@@ -575,11 +504,9 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
575504 __ push (rdx);
576505
577506 const Register pre_val = rax;
578- const Register thread = NOT_LP64 (rax) LP64_ONLY ( r15_thread) ;
507+ const Register thread = r15_thread;
579508 const Register tmp = rdx;
580509
581- NOT_LP64 (__ get_thread (thread);)
582-
583510 Address queue_active (thread, in_bytes (G1ThreadLocalData::satb_mark_queue_active_offset ()));
584511 Address queue_index (thread, in_bytes (G1ThreadLocalData::satb_mark_queue_index_offset ()));
585512 Address buffer (thread, in_bytes (G1ThreadLocalData::satb_mark_queue_buffer_offset ()));
@@ -641,7 +568,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
641568 // At this point we know new_value is non-null and the new_value crosses regions.
642569 // Must check to see if card is already dirty
643570
644- const Register thread = NOT_LP64 (rax) LP64_ONLY ( r15_thread) ;
571+ const Register thread = r15_thread;
645572
646573 Address queue_index (thread, in_bytes (G1ThreadLocalData::dirty_card_queue_index_offset ()));
647574 Address buffer (thread, in_bytes (G1ThreadLocalData::dirty_card_queue_buffer_offset ()));
@@ -659,8 +586,6 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
659586 __ movptr (cardtable, (intptr_t )ct->card_table ()->byte_map_base ());
660587 __ addptr (card_addr, cardtable);
661588
662- NOT_LP64 (__ get_thread (thread);)
663-
664589 __ cmpb (Address (card_addr, 0 ), G1CardTable::g1_young_card_val ());
665590 __ jcc (Assembler::equal, done);
666591
0 commit comments