author | eosterlund |
Mon, 05 Nov 2018 12:36:23 +0100 | |
changeset 52410 | 9d3abb1b7b1f |
parent 49754 | ee93c1087584 |
permissions | -rw-r--r-- |
42664 | 1 |
/* |
49164
7e958a8ebcd3
8195142: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
42664 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
26 |
#include "code/codeCache.hpp" |
|
27 |
#include "code/relocInfo.hpp" |
|
28 |
#include "code/relocInfo_ext.hpp" |
|
49164
7e958a8ebcd3
8195142: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents:
47216
diff
changeset
|
29 |
#include "gc/shared/cardTable.hpp" |
49455
848864ed9b17
8199604: Rename CardTableModRefBS to CardTableBarrierSet
eosterlund
parents:
49164
diff
changeset
|
30 |
#include "gc/shared/cardTableBarrierSet.hpp" |
42664 | 31 |
#include "gc/shared/collectedHeap.hpp" |
32 |
#include "memory/universe.hpp" |
|
33 |
#include "runtime/os.hpp" |
|
34 |
#include "utilities/debug.hpp" |
|
35 |
#ifdef COMPILER1 |
|
36 |
#include "c1/c1_globals.hpp" |
|
37 |
#endif |
|
38 |
||
39 |
address symbolic_Relocation::symbolic_value(symbolic_Relocation::symbolic_reference t) { |
|
40 |
if (Universe::heap() == NULL) { |
|
41 |
// the symbolic values are not needed so early |
|
42 |
// (and most of them lead to errors if asked too early) |
|
43 |
return NULL; |
|
44 |
} |
|
45 |
switch(t) { |
|
46 |
case symbolic_Relocation::polling_page_reference: { |
|
47 |
return os::get_polling_page(); |
|
48 |
} |
|
49 |
case symbolic_Relocation::eden_top_reference: { |
|
50 |
if (!Universe::heap()->supports_inline_contig_alloc()) { |
|
51 |
return NULL; |
|
52 |
} |
|
53 |
return (address)Universe::heap()->top_addr(); |
|
54 |
} |
|
55 |
case symbolic_Relocation::heap_end_reference: { |
|
56 |
if (!Universe::heap()->supports_inline_contig_alloc()) { |
|
57 |
return NULL; |
|
58 |
} |
|
59 |
return (address)Universe::heap()->end_addr(); |
|
60 |
} |
|
61 |
case symbolic_Relocation::card_table_reference: { |
|
49754 | 62 |
BarrierSet* bs = BarrierSet::barrier_set(); |
49455
848864ed9b17
8199604: Rename CardTableModRefBS to CardTableBarrierSet
eosterlund
parents:
49164
diff
changeset
|
63 |
CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs); |
49164
7e958a8ebcd3
8195142: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents:
47216
diff
changeset
|
64 |
CardTable* ct = ctbs->card_table(); |
7e958a8ebcd3
8195142: Refactor out card table from CardTableModRefBS to flatten the BarrierSet hierarchy
eosterlund
parents:
47216
diff
changeset
|
65 |
return (address)ct->byte_map_base(); |
42664 | 66 |
} |
67 |
case symbolic_Relocation::mark_bits_reference: { |
|
68 |
return (address)Universe::verify_mark_bits(); |
|
69 |
} |
|
70 |
case symbolic_Relocation::mark_mask_reference: { |
|
71 |
return (address)Universe::verify_mark_mask(); |
|
72 |
} |
|
73 |
case symbolic_Relocation::oop_bits_reference: { |
|
74 |
return (address)Universe::verify_oop_bits(); |
|
75 |
} |
|
76 |
case symbolic_Relocation::oop_mask_reference: { |
|
77 |
return (address)Universe::verify_oop_mask(); |
|
78 |
} |
|
79 |
case symbolic_Relocation::debug_string_reference: { |
|
80 |
return (address)"<Lost debug string>"; |
|
81 |
} |
|
82 |
default: { |
|
83 |
// missing declaration |
|
84 |
ShouldNotReachHere(); |
|
85 |
return NULL; |
|
86 |
} |
|
87 |
} |
|
88 |
} |