comparison src/share/vm/oops/klass.hpp @ 23614:32b682649973 jdk8u75-b04

8132051: Better byte behavior Reviewed-by: coleenp, roland
author kevinw
date Fri, 15 Jan 2016 22:33:15 +0000
parents 8cb56c8cb30d
children b5f3a471e646
comparison
equal deleted inserted replaced
23613:b374548dcb48 23614:32b682649973
1 /* 1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2016, 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.
368 assert(lh < (jint)_lh_neutral_value, "must be array"); 368 assert(lh < (jint)_lh_neutral_value, "must be array");
369 int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask; 369 int btvalue = (lh >> _lh_element_type_shift) & _lh_element_type_mask;
370 assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity"); 370 assert(btvalue >= T_BOOLEAN && btvalue <= T_OBJECT, "sanity");
371 return (BasicType) btvalue; 371 return (BasicType) btvalue;
372 } 372 }
373
374 // Want a pattern to quickly diff against layout header in register
375 // find something less clever!
376 static int layout_helper_boolean_diffbit() {
377 jint zlh = array_layout_helper(T_BOOLEAN);
378 jint blh = array_layout_helper(T_BYTE);
379 assert(zlh != blh, "array layout helpers must differ");
380 int diffbit = 1;
381 while ((diffbit & (zlh ^ blh)) == 0 && (diffbit & zlh) == 0) {
382 diffbit <<= 1;
383 assert(diffbit != 0, "make sure T_BOOLEAN has a different bit than T_BYTE");
384 }
385 return diffbit;
386 }
387
373 static int layout_helper_log2_element_size(jint lh) { 388 static int layout_helper_log2_element_size(jint lh) {
374 assert(lh < (jint)_lh_neutral_value, "must be array"); 389 assert(lh < (jint)_lh_neutral_value, "must be array");
375 int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask; 390 int l2esz = (lh >> _lh_log2_element_size_shift) & _lh_log2_element_size_mask;
376 assert(l2esz <= LogBitsPerLong, 391 assert(l2esz <= LogBitsPerLong,
377 err_msg("sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh)); 392 err_msg("sanity. l2esz: 0x%x for lh: 0x%x", (uint)l2esz, (uint)lh));