--- old/src/cpu/arm/vm/jniFastGetField_arm.cpp 2017-02-23 13:57:08.669889694 +0100 +++ new/src/cpu/arm/vm/jniFastGetField_arm.cpp 2017-02-23 13:57:08.573890640 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,10 +119,12 @@ __ ldr_s32(Rsafept_cnt, Address(Rsafepoint_counter_addr)); __ tbnz(Rsafept_cnt, 0, slow_case); -#ifndef AARCH64 - __ bic(R1, R1, JNIHandles::weak_tag_mask); -#else +#ifdef AARCH64 + // If mask changes we need to ensure that the inverse is still encodable as an immediate + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1); __ andr(R1, R1, ~JNIHandles::weak_tag_mask); +#else + __ bic(R1, R1, JNIHandles::weak_tag_mask); #endif if (os::is_MP()) {