1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)c1_FrameMap.cpp 1.38 07/06/18 14:25:23 JVM"
3 #endif
4 /*
5 * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
264
265 ByteSize FrameMap::sp_offset_for_double_slot(const int index) const {
266 ByteSize offset = sp_offset_for_slot(index);
267 if (index >= argcount()) {
268 assert(in_bytes(offset) + 4 < framesize() * 4, "spill outside of frame");
269 }
270 return offset;
271 }
272
273
274 ByteSize FrameMap::sp_offset_for_spill(const int index) const {
275 assert(index >= 0 && index < _num_spills, "out of range");
276 int offset = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) +
277 index * spill_slot_size_in_bytes;
278 return in_ByteSize(offset);
279 }
280
281 ByteSize FrameMap::sp_offset_for_monitor_base(const int index) const {
282 int end_of_spills = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) +
283 _num_spills * spill_slot_size_in_bytes;
284 int offset = round_to(end_of_spills, HeapWordSize) + index * sizeof(BasicObjectLock);
285 return in_ByteSize(offset);
286 }
287
288 ByteSize FrameMap::sp_offset_for_monitor_lock(int index) const {
289 check_monitor_index(index);
290 return sp_offset_for_monitor_base(index) + in_ByteSize(BasicObjectLock::lock_offset_in_bytes());;
291 }
292
293 ByteSize FrameMap::sp_offset_for_monitor_object(int index) const {
294 check_monitor_index(index);
295 return sp_offset_for_monitor_base(index) + in_ByteSize(BasicObjectLock::obj_offset_in_bytes());
296 }
297
298 void FrameMap::print_frame_layout() const {
299 int svar;
300 tty->print_cr("#####################################");
301 tty->print_cr("Frame size in words %d", framesize());
302
303 if( _num_monitors > 0) {
304 tty->print_cr("monitor [0]:%d | [%2d]:%d",
|
1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)c1_FrameMap.cpp 1.38 07/06/18 14:25:23 JVM"
3 #endif
4 /*
5 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
264
265 ByteSize FrameMap::sp_offset_for_double_slot(const int index) const {
266 ByteSize offset = sp_offset_for_slot(index);
267 if (index >= argcount()) {
268 assert(in_bytes(offset) + 4 < framesize() * 4, "spill outside of frame");
269 }
270 return offset;
271 }
272
273
274 ByteSize FrameMap::sp_offset_for_spill(const int index) const {
275 assert(index >= 0 && index < _num_spills, "out of range");
276 int offset = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) +
277 index * spill_slot_size_in_bytes;
278 return in_ByteSize(offset);
279 }
280
281 ByteSize FrameMap::sp_offset_for_monitor_base(const int index) const {
282 int end_of_spills = round_to(first_available_sp_in_frame + _reserved_argument_area_size, sizeof(double)) +
283 _num_spills * spill_slot_size_in_bytes;
284 int offset = (int) round_to(end_of_spills, HeapWordSize) + index * sizeof(BasicObjectLock);
285 return in_ByteSize(offset);
286 }
287
288 ByteSize FrameMap::sp_offset_for_monitor_lock(int index) const {
289 check_monitor_index(index);
290 return sp_offset_for_monitor_base(index) + in_ByteSize(BasicObjectLock::lock_offset_in_bytes());;
291 }
292
293 ByteSize FrameMap::sp_offset_for_monitor_object(int index) const {
294 check_monitor_index(index);
295 return sp_offset_for_monitor_base(index) + in_ByteSize(BasicObjectLock::obj_offset_in_bytes());
296 }
297
298 void FrameMap::print_frame_layout() const {
299 int svar;
300 tty->print_cr("#####################################");
301 tty->print_cr("Frame size in words %d", framesize());
302
303 if( _num_monitors > 0) {
304 tty->print_cr("monitor [0]:%d | [%2d]:%d",
|