equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2015, 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. |
40 { |
40 { |
41 guarantee(Universe::heap()->kind() == CollectedHeap::GenCollectedHeap, "sanity"); |
41 guarantee(Universe::heap()->kind() == CollectedHeap::GenCollectedHeap, "sanity"); |
42 _ct_bs = new CardTableModRefBSForCTRS(whole_heap); |
42 _ct_bs = new CardTableModRefBSForCTRS(whole_heap); |
43 _ct_bs->initialize(); |
43 _ct_bs->initialize(); |
44 set_bs(_ct_bs); |
44 set_bs(_ct_bs); |
45 _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1, |
45 // max_gens is really GenCollectedHeap::heap()->gen_policy()->number_of_generations() |
|
46 // (which is always 2, young & old), but GenCollectedHeap has not been initialized yet. |
|
47 uint max_gens = 2; |
|
48 _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, max_gens + 1, |
46 mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL); |
49 mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL); |
47 if (_last_cur_val_in_gen == NULL) { |
50 if (_last_cur_val_in_gen == NULL) { |
48 vm_exit_during_initialization("Could not create last_cur_val_in_gen array."); |
51 vm_exit_during_initialization("Could not create last_cur_val_in_gen array."); |
49 } |
52 } |
50 for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) { |
53 for (uint i = 0; i < max_gens + 1; i++) { |
51 _last_cur_val_in_gen[i] = clean_card_val(); |
54 _last_cur_val_in_gen[i] = clean_card_val(); |
52 } |
55 } |
53 _ct_bs->set_CTRS(this); |
56 _ct_bs->set_CTRS(this); |
54 } |
57 } |
55 |
58 |