1 /* |
1 /* |
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
325 } |
325 } |
326 __ adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); |
326 __ adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); |
327 #endif |
327 #endif |
328 } |
328 } |
329 |
329 |
|
330 #ifdef _LP64 |
330 void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { |
331 void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { |
331 BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); |
332 BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); |
332 if (bs_nm == NULL) { |
333 if (bs_nm == NULL) { |
333 return; |
334 return; |
334 } |
335 } |
335 #ifndef _LP64 |
|
336 ShouldNotReachHere(); |
|
337 #else |
|
338 Label continuation; |
336 Label continuation; |
339 Register thread = LP64_ONLY(r15_thread); |
337 Register thread = r15_thread; |
340 Address disarmed_addr(thread, in_bytes(bs_nm->thread_disarmed_offset())); |
338 Address disarmed_addr(thread, in_bytes(bs_nm->thread_disarmed_offset())); |
341 __ align(8); |
339 __ align(8); |
342 __ cmpl(disarmed_addr, 0); |
340 __ cmpl(disarmed_addr, 0); |
343 __ jcc(Assembler::equal, continuation); |
341 __ jcc(Assembler::equal, continuation); |
344 __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); |
342 __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); |
345 __ bind(continuation); |
343 __ bind(continuation); |
346 #endif |
344 } |
347 } |
345 #else |
|
346 void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) { |
|
347 BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); |
|
348 if (bs_nm == NULL) { |
|
349 return; |
|
350 } |
|
351 |
|
352 Label continuation; |
|
353 |
|
354 Register tmp = rdi; |
|
355 __ push(tmp); |
|
356 __ movptr(tmp, (intptr_t)bs_nm->disarmed_value_address()); |
|
357 Address disarmed_addr(tmp, 0); |
|
358 __ align(4); |
|
359 __ cmpl(disarmed_addr, 0); |
|
360 __ pop(tmp); |
|
361 __ jcc(Assembler::equal, continuation); |
|
362 __ call(RuntimeAddress(StubRoutines::x86::method_entry_barrier())); |
|
363 __ bind(continuation); |
|
364 } |
|
365 #endif |
348 |
366 |
349 void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) { |
367 void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler* masm) { |
350 BarrierSetNMethod* bs = BarrierSet::barrier_set()->barrier_set_nmethod(); |
368 BarrierSetNMethod* bs = BarrierSet::barrier_set()->barrier_set_nmethod(); |
351 if (bs == NULL) { |
369 if (bs == NULL) { |
352 return; |
370 return; |