equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2018, 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. |
614 // CAS. If we fail this race, the object's bias has been revoked |
614 // CAS. If we fail this race, the object's bias has been revoked |
615 // by another thread so we simply return and let the caller deal |
615 // by another thread so we simply return and let the caller deal |
616 // with it. |
616 // with it. |
617 markOop biased_value = mark; |
617 markOop biased_value = mark; |
618 markOop res_mark = obj->cas_set_mark(prototype_header, mark); |
618 markOop res_mark = obj->cas_set_mark(prototype_header, mark); |
619 assert(!(*(obj->mark_addr()))->has_bias_pattern(), "even if we raced, should still be revoked"); |
619 assert(!obj->mark()->has_bias_pattern(), "even if we raced, should still be revoked"); |
620 return BIAS_REVOKED; |
620 return BIAS_REVOKED; |
621 } else if (prototype_header->bias_epoch() != mark->bias_epoch()) { |
621 } else if (prototype_header->bias_epoch() != mark->bias_epoch()) { |
622 // The epoch of this biasing has expired indicating that the |
622 // The epoch of this biasing has expired indicating that the |
623 // object is effectively unbiased. Depending on whether we need |
623 // object is effectively unbiased. Depending on whether we need |
624 // to rebias or revoke the bias of this object we can do it |
624 // to rebias or revoke the bias of this object we can do it |