Mercurial > hg > truffle
comparison src/share/vm/utilities/bitMap.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 89152779163c 78bbf4d43a14 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2014, 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. |
33 # include "os_solaris.inline.hpp" | 33 # include "os_solaris.inline.hpp" |
34 #endif | 34 #endif |
35 #ifdef TARGET_OS_FAMILY_windows | 35 #ifdef TARGET_OS_FAMILY_windows |
36 # include "os_windows.inline.hpp" | 36 # include "os_windows.inline.hpp" |
37 #endif | 37 #endif |
38 #ifdef TARGET_OS_FAMILY_aix | |
39 # include "os_aix.inline.hpp" | |
40 #endif | |
38 #ifdef TARGET_OS_FAMILY_bsd | 41 #ifdef TARGET_OS_FAMILY_bsd |
39 # include "os_bsd.inline.hpp" | 42 # include "os_bsd.inline.hpp" |
40 #endif | 43 #endif |
41 | 44 |
42 | 45 |
105 intptr_t mr = (intptr_t)inverted_bit_mask_for_range(beg, end); | 108 intptr_t mr = (intptr_t)inverted_bit_mask_for_range(beg, end); |
106 intptr_t nw = value ? (w | ~mr) : (w & mr); | 109 intptr_t nw = value ? (w | ~mr) : (w & mr); |
107 while (true) { | 110 while (true) { |
108 intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w); | 111 intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w); |
109 if (res == w) break; | 112 if (res == w) break; |
110 w = *pw; | 113 w = res; |
111 nw = value ? (w | ~mr) : (w & mr); | 114 nw = value ? (w | ~mr) : (w & mr); |
112 } | 115 } |
113 } | 116 } |
114 } | 117 } |
115 | 118 |
518 return sum; | 521 return sum; |
519 } | 522 } |
520 | 523 |
521 void BitMap::print_on_error(outputStream* st, const char* prefix) const { | 524 void BitMap::print_on_error(outputStream* st, const char* prefix) const { |
522 st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")", | 525 st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")", |
523 prefix, map(), (char*)map() + (size() >> LogBitsPerByte)); | 526 prefix, p2i(map()), p2i((char*)map() + (size() >> LogBitsPerByte))); |
524 } | 527 } |
525 | 528 |
526 #ifndef PRODUCT | 529 #ifndef PRODUCT |
527 | 530 |
528 void BitMap::print_on(outputStream* st) const { | 531 void BitMap::print_on(outputStream* st) const { |
529 tty->print("Bitmap(%d):", size()); | 532 tty->print("Bitmap(" SIZE_FORMAT "):", size()); |
530 for (idx_t index = 0; index < size(); index++) { | 533 for (idx_t index = 0; index < size(); index++) { |
531 tty->print("%c", at(index) ? '1' : '0'); | 534 tty->print("%c", at(index) ? '1' : '0'); |
532 } | 535 } |
533 tty->cr(); | 536 tty->cr(); |
534 } | 537 } |