@@ -95,105 +95,6 @@ size_t InstanceStackChunkKlass::copy(oop obj, HeapWord* to_addr, size_t word_siz
95
95
template size_t InstanceStackChunkKlass::copy<InstanceStackChunkKlass::copy_type::CONJOINT>(oop obj, HeapWord* to_addr, size_t word_size);
96
96
template size_t InstanceStackChunkKlass::copy<InstanceStackChunkKlass::copy_type::DISJOINT>(oop obj, HeapWord* to_addr, size_t word_size);
97
97
98
- size_t InstanceStackChunkKlass::compact_oop_size(oop obj) const {
99
- assert (obj->is_stackChunk(), "");
100
- stackChunkOop chunk = (stackChunkOop)obj;
101
- int used_stack_in_words = chunk->stack_size() - chunk->sp() + metadata_words();
102
- assert (used_stack_in_words <= chunk->stack_size(), "");
103
- return align_object_size(size_helper() + used_stack_in_words + bitmap_size(used_stack_in_words));
104
- }
105
-
106
- template size_t InstanceStackChunkKlass::copy_compact<InstanceStackChunkKlass::copy_type::CONJOINT>(oop obj, HeapWord* to_addr);
107
- template size_t InstanceStackChunkKlass::copy_compact<InstanceStackChunkKlass::copy_type::DISJOINT>(oop obj, HeapWord* to_addr);
108
-
109
- template <InstanceStackChunkKlass::copy_type overlap>
110
- size_t InstanceStackChunkKlass::copy_compact(oop obj, HeapWord* to_addr) {
111
- assert (obj->is_stackChunk(), "");
112
- stackChunkOop chunk = (stackChunkOop)obj;
113
-
114
- assert (chunk->verify(), "");
115
-
116
- #ifdef ASSERT
117
- size_t old_compact_size = obj->compact_size();
118
- size_t old_size = obj->size();
119
- assert (old_compact_size <= old_size, "");
120
- #endif
121
-
122
- const int from_sp = chunk->sp();
123
- assert (from_sp >= metadata_words(), "");
124
-
125
- if (from_sp <= metadata_words()) {
126
- assert (oop_size(obj) == compact_oop_size(obj), "");
127
- return copy<overlap>(obj, to_addr, oop_size(obj));
128
- }
129
-
130
- const int header = size_helper();
131
- const int from_stack_size = chunk->stack_size();
132
- const int to_stack_size = from_stack_size - from_sp + metadata_words();
133
- const size_t from_bitmap_size = bitmap_size(from_stack_size);
134
- const size_t to_bitmap_size = bitmap_size(to_stack_size);
135
- const bool has_bitmap = chunk->has_bitmap();
136
- assert (to_stack_size >= 0, "");
137
- assert (to_stack_size <= from_stack_size, "");
138
- assert (to_stack_size > 0 || chunk->argsize() == 0, "");
139
- #ifdef ASSERT
140
- HeapWord* const start_of_stack0 = start_of_stack(obj);
141
- HeapWord* const start_of_bitmap0 = start_of_bitmap(obj);
142
- #endif
143
-
144
- stackChunkOop to_chunk = (stackChunkOop) cast_to_oop(to_addr);
145
- HeapWord* from_addr = cast_from_oop<HeapWord*>(obj);
146
-
147
- // copy header and stack in the appropriate order if conjoint; must not touch old chunk after we start b/c this can be a conjoint copy
148
- const int first = (overlap == copy_type::DISJOINT || to_addr <= from_addr) ? 0 : 2;
149
- const int stride = 1 - first;
150
- for (int i = first; 0 <= i && i <= 2; i += stride) {
151
- switch(i) { // copy header and update it
152
- case 0:
153
- if (to_addr != from_addr) {
154
- overlap == copy_type::DISJOINT ? Copy::aligned_disjoint_words(from_addr, to_addr, header)
155
- : Copy::aligned_conjoint_words(from_addr, to_addr, header);
156
- }
157
-
158
- jdk_internal_vm_StackChunk::set_size(to_addr, to_stack_size);
159
- to_chunk->set_sp(metadata_words());
160
- break;
161
- case 1: // copy stack
162
- if (to_stack_size > 0) {
163
- assert ((from_addr + header) == start_of_stack0, "");
164
- HeapWord* from_start = from_addr + header + from_sp - metadata_words();
165
- HeapWord* to_start = to_addr + header;
166
- overlap == copy_type::DISJOINT ? Copy::aligned_disjoint_words(from_start, to_start, to_stack_size)
167
- : Copy::aligned_conjoint_words(from_start, to_start, to_stack_size);
168
- }
169
- break;
170
- case 2: // copy bitmap
171
- if (to_stack_size > 0 && has_bitmap) {
172
- assert ((from_addr + header + from_stack_size) == start_of_bitmap0, "");
173
- assert (from_bitmap_size >= to_bitmap_size, "");
174
- HeapWord* from_start = from_addr + header + from_stack_size + (from_bitmap_size - to_bitmap_size);
175
- HeapWord* to_start = to_addr + header + to_stack_size;
176
- overlap == copy_type::DISJOINT ? Copy::aligned_disjoint_words(from_start, to_start, to_bitmap_size)
177
- : Copy::aligned_conjoint_words(from_start, to_start, to_bitmap_size);
178
- }
179
- break;
180
- }
181
- }
182
-
183
- assert (!to_chunk->has_bitmap()|| to_chunk->is_gc_mode(), "");
184
- assert (to_chunk->has_bitmap() == has_bitmap, "");
185
- if (!to_chunk->has_bitmap()) {
186
- build_bitmap(to_chunk);
187
- }
188
-
189
- assert (to_chunk->size() == old_compact_size, "");
190
- assert (to_chunk->size() == instance_size(to_stack_size), "");
191
- assert (from_sp <= metadata_words() ? (to_chunk->size() == old_size) : (to_chunk->size() < old_size), "");
192
- assert (to_chunk->verify(), "");
193
-
194
- return align_object_size(header + to_stack_size + to_bitmap_size);
195
- }
196
-
197
98
template <chunk_frames frame_kind>
198
99
int InstanceStackChunkKlass::count_frames(stackChunkOop chunk) {
199
100
int frames = 0;
0 commit comments