1 /* |
1 /* |
2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright 2012, 2014 SAP AG. All rights reserved. |
3 * Copyright 2012, 2015 SAP AG. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. |
8 * published by the Free Software Foundation. |
430 void cmpxchgw(ConditionRegister flag, |
431 void cmpxchgw(ConditionRegister flag, |
431 Register dest_current_value, Register compare_value, Register exchange_value, Register addr_base, |
432 Register dest_current_value, Register compare_value, Register exchange_value, Register addr_base, |
432 int semantics, bool cmpxchgx_hint = false, |
433 int semantics, bool cmpxchgx_hint = false, |
433 Register int_flag_success = noreg, bool contention_hint = false); |
434 Register int_flag_success = noreg, bool contention_hint = false); |
434 void cmpxchgd(ConditionRegister flag, |
435 void cmpxchgd(ConditionRegister flag, |
435 Register dest_current_value, Register compare_value, Register exchange_value, Register addr_base, |
436 Register dest_current_value, RegisterOrConstant compare_value, Register exchange_value, |
436 int semantics, bool cmpxchgx_hint = false, |
437 Register addr_base, int semantics, bool cmpxchgx_hint = false, |
437 Register int_flag_success = noreg, Label* failed = NULL, bool contention_hint = false); |
438 Register int_flag_success = noreg, Label* failed = NULL, bool contention_hint = false); |
438 |
439 |
439 // interface method calling |
440 // interface method calling |
440 void lookup_interface_method(Register recv_klass, |
441 void lookup_interface_method(Register recv_klass, |
441 Register intf_klass, |
442 Register intf_klass, |
504 // If allow_delay_slot_filling is set to true, the next instruction |
505 // If allow_delay_slot_filling is set to true, the next instruction |
505 // emitted after this one will go in an annulled delay slot if the |
506 // emitted after this one will go in an annulled delay slot if the |
506 // biased locking exit case failed. |
507 // biased locking exit case failed. |
507 void biased_locking_exit(ConditionRegister cr_reg, Register mark_addr, Register temp_reg, Label& done); |
508 void biased_locking_exit(ConditionRegister cr_reg, Register mark_addr, Register temp_reg, Label& done); |
508 |
509 |
509 void compiler_fast_lock_object( ConditionRegister flag, Register oop, Register box, Register tmp1, Register tmp2, Register tmp3); |
510 void atomic_inc_ptr(Register addr, Register result, int simm16 = 1); |
510 void compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, Register tmp1, Register tmp2, Register tmp3); |
511 void atomic_ori_int(Register addr, Register result, int uimm16); |
|
512 |
|
513 #if INCLUDE_RTM_OPT |
|
514 void rtm_counters_update(Register abort_status, Register rtm_counters); |
|
515 void branch_on_random_using_tb(Register tmp, int count, Label& brLabel); |
|
516 void rtm_abort_ratio_calculation(Register rtm_counters_reg, RTMLockingCounters* rtm_counters, |
|
517 Metadata* method_data); |
|
518 void rtm_profiling(Register abort_status_Reg, Register temp_Reg, |
|
519 RTMLockingCounters* rtm_counters, Metadata* method_data, bool profile_rtm); |
|
520 void rtm_retry_lock_on_abort(Register retry_count, Register abort_status, |
|
521 Label& retryLabel, Label* checkRetry = NULL); |
|
522 void rtm_retry_lock_on_busy(Register retry_count, Register owner_addr, Label& retryLabel); |
|
523 void rtm_stack_locking(ConditionRegister flag, Register obj, Register mark_word, Register tmp, |
|
524 Register retry_on_abort_count, |
|
525 RTMLockingCounters* stack_rtm_counters, |
|
526 Metadata* method_data, bool profile_rtm, |
|
527 Label& DONE_LABEL, Label& IsInflated); |
|
528 void rtm_inflated_locking(ConditionRegister flag, Register obj, Register mark_word, Register box, |
|
529 Register retry_on_busy_count, Register retry_on_abort_count, |
|
530 RTMLockingCounters* rtm_counters, |
|
531 Metadata* method_data, bool profile_rtm, |
|
532 Label& DONE_LABEL); |
|
533 #endif |
|
534 |
|
535 void compiler_fast_lock_object(ConditionRegister flag, Register oop, Register box, |
|
536 Register tmp1, Register tmp2, Register tmp3, |
|
537 bool try_bias = UseBiasedLocking, |
|
538 RTMLockingCounters* rtm_counters = NULL, |
|
539 RTMLockingCounters* stack_rtm_counters = NULL, |
|
540 Metadata* method_data = NULL, |
|
541 bool use_rtm = false, bool profile_rtm = false); |
|
542 |
|
543 void compiler_fast_unlock_object(ConditionRegister flag, Register oop, Register box, |
|
544 Register tmp1, Register tmp2, Register tmp3, |
|
545 bool try_bias = UseBiasedLocking, bool use_rtm = false); |
511 |
546 |
512 // Support for serializing memory accesses between threads |
547 // Support for serializing memory accesses between threads |
513 void serialize_memory(Register thread, Register tmp1, Register tmp2); |
548 void serialize_memory(Register thread, Register tmp1, Register tmp2); |
514 |
549 |
515 // GC barrier support. |
550 // GC barrier support. |
574 // Specify tmp register if d should not be changed. |
609 // Specify tmp register if d should not be changed. |
575 inline void store_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, |
610 inline void store_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, |
576 Register tmp = noreg); |
611 Register tmp = noreg); |
577 |
612 |
578 // Null allowed. |
613 // Null allowed. |
579 inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg); |
614 inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg, Label *is_null = NULL); |
580 |
615 |
581 // Encode/decode heap oop. Oop may not be null, else en/decoding goes wrong. |
616 // Encode/decode heap oop. Oop may not be null, else en/decoding goes wrong. |
582 // src == d allowed. |
617 // src == d allowed. |
583 inline Register encode_heap_oop_not_null(Register d, Register src = noreg); |
618 inline Register encode_heap_oop_not_null(Register d, Register src = noreg); |
584 inline Register decode_heap_oop_not_null(Register d, Register src = noreg); |
619 inline Register decode_heap_oop_not_null(Register d, Register src = noreg); |
591 void load_klass_with_trap_null_check(Register dst, Register src); |
626 void load_klass_with_trap_null_check(Register dst, Register src); |
592 void store_klass(Register dst_oop, Register klass, Register tmp = R0); |
627 void store_klass(Register dst_oop, Register klass, Register tmp = R0); |
593 void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified. |
628 void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified. |
594 static int instr_size_for_decode_klass_not_null(); |
629 static int instr_size_for_decode_klass_not_null(); |
595 void decode_klass_not_null(Register dst, Register src = noreg); |
630 void decode_klass_not_null(Register dst, Register src = noreg); |
596 void encode_klass_not_null(Register dst, Register src = noreg); |
631 Register encode_klass_not_null(Register dst, Register src = noreg); |
597 |
632 |
598 // Load common heap base into register. |
633 // Load common heap base into register. |
599 void reinit_heapbase(Register d, Register tmp = noreg); |
634 void reinit_heapbase(Register d, Register tmp = noreg); |
600 |
635 |
601 // SIGTRAP-based range checks for arrays. |
636 // SIGTRAP-based range checks for arrays. |