1.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp Tue Mar 29 23:01:10 2016 +0100 1.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp Tue Apr 05 08:55:39 2016 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -3646,3 +3646,26 @@ 1.11 } 1.12 } 1.13 } 1.14 + 1.15 +LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr value, CodeEmitInfo*& null_check_info) { 1.16 + if (x->check_boolean()) { 1.17 + LIR_Opr value_fixed = rlock_byte(T_BYTE); 1.18 + if (TwoOperandLIRForm) { 1.19 + __ move(value, value_fixed); 1.20 + __ logical_and(value_fixed, LIR_OprFact::intConst(1), value_fixed); 1.21 + } else { 1.22 + __ logical_and(value, LIR_OprFact::intConst(1), value_fixed); 1.23 + } 1.24 + LIR_Opr klass = new_register(T_METADATA); 1.25 + __ move(new LIR_Address(array, oopDesc::klass_offset_in_bytes(), T_ADDRESS), klass, null_check_info); 1.26 + null_check_info = NULL; 1.27 + LIR_Opr layout = new_register(T_INT); 1.28 + __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); 1.29 + int diffbit = Klass::layout_helper_boolean_diffbit(); 1.30 + __ logical_and(layout, LIR_OprFact::intConst(diffbit), layout); 1.31 + __ cmp(lir_cond_notEqual, layout, LIR_OprFact::intConst(0)); 1.32 + __ cmove(lir_cond_notEqual, value_fixed, value, value_fixed, T_BYTE); 1.33 + value = value_fixed; 1.34 + } 1.35 + return value; 1.36 +}