0N/A/*
3790N/A * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
0N/A/* This file is auto-generated */
0N/A#include "JvmOffsetsIndex.h"
0N/A
0N/A#define DEBUG
0N/A
0N/A#ifdef DEBUG
0N/A#define MARK_LINE this->line = __LINE__
0N/A#else
0N/A#define MARK_LINE
0N/A#endif
0N/A
0N/A#ifdef _LP64
0N/A#define STACK_BIAS 0x7ff
0N/A#define pointer uint64_t
0N/A#else
0N/A#define STACK_BIAS 0
0N/A#define pointer uint32_t
0N/A#endif
0N/A
0N/Aextern pointer __JvmOffsets;
0N/A
0N/Aextern pointer __1cJCodeCacheF_heap_;
0N/Aextern pointer __1cIUniverseP_methodKlassObj_;
0N/Aextern pointer __1cIUniverseO_collectedHeap_;
642N/Aextern pointer __1cIUniverseL_narrow_oop_;
642N/A#ifdef _LP64
642N/Aextern pointer UseCompressedOops;
642N/A#endif
0N/A
0N/Aextern pointer __1cHnmethodG__vtbl_;
0N/Aextern pointer __1cKBufferBlobG__vtbl_;
0N/A
0N/A#define copyin_ptr(ADDR) *(pointer*) copyin((pointer) (ADDR), sizeof(pointer))
0N/A#define copyin_uchar(ADDR) *(uchar_t*) copyin((pointer) (ADDR), sizeof(uchar_t))
0N/A#define copyin_uint16(ADDR) *(uint16_t*) copyin((pointer) (ADDR), sizeof(uint16_t))
0N/A#define copyin_uint32(ADDR) *(uint32_t*) copyin((pointer) (ADDR), sizeof(uint32_t))
0N/A#define copyin_int32(ADDR) *(int32_t*) copyin((pointer) (ADDR), sizeof(int32_t))
642N/A#define copyin_uint8(ADDR) *(uint8_t*) copyin((pointer) (ADDR), sizeof(uint8_t))
0N/A
0N/A#define SAME(x) x
0N/A#define copyin_offset(JVM_CONST) JVM_CONST = \
0N/A copyin_int32(JvmOffsetsPtr + SAME(IDX_)JVM_CONST * sizeof(int32_t))
0N/A
0N/Aint init_done;
0N/A
0N/Adtrace:helper:ustack:
0N/A{
0N/A MARK_LINE;
0N/A this->done = 0;
0N/A /*
0N/A * TBD:
0N/A * Here we initialize init_done, otherwise jhelper does not work.
0N/A * Therefore, copyin_offset() statements work multiple times now.
0N/A * There is a hope we could avoid it in the future, and so,
0N/A * this initialization can be removed.
0N/A */
0N/A init_done = 0;
0N/A this->error = (char *) NULL;
0N/A this->result = (char *) NULL;
0N/A this->methodOop = 0;
0N/A this->codecache = 0;
0N/A this->klass = (pointer) NULL;
0N/A this->vtbl = (pointer) NULL;
0N/A this->suffix = '\0';
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A{
0N/A MARK_LINE;
0N/A /* Initialization of JvmOffsets constants */
0N/A JvmOffsetsPtr = (pointer) &``__JvmOffsets;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!init_done && !this->done/
0N/A{
0N/A MARK_LINE;
0N/A init_done = 1;
0N/A
0N/A copyin_offset(COMPILER);
0N/A copyin_offset(OFFSET_CollectedHeap_reserved);
0N/A copyin_offset(OFFSET_MemRegion_start);
0N/A copyin_offset(OFFSET_MemRegion_word_size);
0N/A copyin_offset(SIZE_HeapWord);
0N/A
0N/A copyin_offset(OFFSET_interpreter_frame_method);
0N/A copyin_offset(OFFSET_Klass_name);
0N/A copyin_offset(OFFSET_constantPoolOopDesc_pool_holder);
0N/A
0N/A copyin_offset(OFFSET_HeapBlockHeader_used);
113N/A copyin_offset(OFFSET_oopDesc_metadata);
0N/A
2062N/A copyin_offset(OFFSET_Symbol_length);
2062N/A copyin_offset(OFFSET_Symbol_body);
0N/A
0N/A copyin_offset(OFFSET_methodOopDesc_constMethod);
3790N/A copyin_offset(OFFSET_constMethodOopDesc_constants);
0N/A copyin_offset(OFFSET_constMethodOopDesc_name_index);
0N/A copyin_offset(OFFSET_constMethodOopDesc_signature_index);
0N/A
0N/A copyin_offset(OFFSET_CodeHeap_memory);
0N/A copyin_offset(OFFSET_CodeHeap_segmap);
0N/A copyin_offset(OFFSET_CodeHeap_log2_segment_size);
0N/A
0N/A copyin_offset(OFFSET_VirtualSpace_low);
0N/A copyin_offset(OFFSET_VirtualSpace_high);
0N/A
0N/A copyin_offset(OFFSET_CodeBlob_name);
0N/A
0N/A copyin_offset(OFFSET_nmethod_method);
0N/A copyin_offset(SIZE_HeapBlockHeader);
0N/A copyin_offset(SIZE_oopDesc);
0N/A copyin_offset(SIZE_constantPoolOopDesc);
0N/A
642N/A copyin_offset(OFFSET_NarrowOopStruct_base);
642N/A copyin_offset(OFFSET_NarrowOopStruct_shift);
642N/A
0N/A /*
0N/A * The PC to translate is in arg0.
0N/A */
0N/A this->pc = arg0;
0N/A
0N/A /*
0N/A * The methodOopPtr is in %l2 on SPARC. This can be found at
0N/A * offset 8 from the frame pointer on 32-bit processes.
0N/A */
0N/A#if defined(__sparc)
0N/A this->methodOopPtr = copyin_ptr(arg1 + 2 * sizeof(pointer) + STACK_BIAS);
0N/A#elif defined(__i386) || defined(__amd64)
0N/A this->methodOopPtr = copyin_ptr(arg1 + OFFSET_interpreter_frame_method);
0N/A#else
0N/A#error "Don't know architecture"
0N/A#endif
0N/A
0N/A this->Universe_methodKlassOop = copyin_ptr(&``__1cIUniverseP_methodKlassObj_);
0N/A this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
0N/A
0N/A /* Reading volatile values */
642N/A#ifdef _LP64
642N/A this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
642N/A#else
642N/A this->Use_Compressed_Oops = 0;
642N/A#endif
642N/A
642N/A this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
642N/A OFFSET_NarrowOopStruct_base);
642N/A this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
642N/A OFFSET_NarrowOopStruct_shift);
642N/A
0N/A this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
0N/A OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
0N/A
0N/A this->CodeCache_high = copyin_ptr(this->CodeCache_heap_address +
0N/A OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_high);
0N/A
0N/A this->CodeCache_segmap_low = copyin_ptr(this->CodeCache_heap_address +
0N/A OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_low);
0N/A
0N/A this->CodeCache_segmap_high = copyin_ptr(this->CodeCache_heap_address +
0N/A OFFSET_CodeHeap_segmap + OFFSET_VirtualSpace_high);
0N/A
0N/A this->CodeHeap_log2_segment_size = copyin_uint32(
0N/A this->CodeCache_heap_address + OFFSET_CodeHeap_log2_segment_size);
0N/A
0N/A /*
0N/A * Get Java heap bounds
0N/A */
0N/A this->Universe_collectedHeap = copyin_ptr(&``__1cIUniverseO_collectedHeap_);
0N/A this->heap_start = copyin_ptr(this->Universe_collectedHeap +
0N/A OFFSET_CollectedHeap_reserved +
0N/A OFFSET_MemRegion_start);
0N/A this->heap_size = SIZE_HeapWord *
0N/A copyin_ptr(this->Universe_collectedHeap +
0N/A OFFSET_CollectedHeap_reserved +
0N/A OFFSET_MemRegion_word_size
0N/A );
0N/A this->heap_end = this->heap_start + this->heap_size;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done &&
0N/Athis->CodeCache_low <= this->pc && this->pc < this->CodeCache_high/
0N/A{
0N/A MARK_LINE;
0N/A this->codecache = 1;
0N/A
0N/A /*
0N/A * Find start.
0N/A */
0N/A this->segment = (this->pc - this->CodeCache_low) >>
0N/A this->CodeHeap_log2_segment_size;
0N/A this->block = this->CodeCache_segmap_low;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A "second";
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A this->segment = this->segment - this->tag;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A this->segment = this->segment - this->tag;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A this->segment = this->segment - this->tag;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A this->segment = this->segment - this->tag;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->tag = copyin_uchar(this->block + this->segment);
0N/A this->segment = this->segment - this->tag;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && this->tag > 0/
0N/A{
0N/A MARK_LINE;
0N/A this->error = "<couldn't find start>";
0N/A this->done = 1;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache/
0N/A{
0N/A MARK_LINE;
0N/A this->block = this->CodeCache_low +
0N/A (this->segment << this->CodeHeap_log2_segment_size);
0N/A this->used = copyin_uint32(this->block + OFFSET_HeapBlockHeader_used);
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache && !this->used/
0N/A{
0N/A MARK_LINE;
0N/A this->error = "<block not in use>";
0N/A this->done = 1;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache/
0N/A{
0N/A MARK_LINE;
0N/A this->start = this->block + SIZE_HeapBlockHeader;
0N/A this->vtbl = copyin_ptr(this->start);
0N/A
0N/A this->nmethod_vtbl = (pointer) &``__1cHnmethodG__vtbl_;
0N/A this->BufferBlob_vtbl = (pointer) &``__1cKBufferBlobG__vtbl_;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->vtbl == this->nmethod_vtbl/
0N/A{
0N/A MARK_LINE;
0N/A this->methodOopPtr = copyin_ptr(this->start + OFFSET_nmethod_method);
0N/A this->suffix = '*';
0N/A this->methodOop = 1;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->vtbl == this->BufferBlob_vtbl/
0N/A{
0N/A MARK_LINE;
0N/A this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name);
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->vtbl == this->BufferBlob_vtbl &&
642N/Athis->Use_Compressed_Oops == 0 &&
0N/Athis->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/
0N/A{
0N/A MARK_LINE;
113N/A this->klass = copyin_ptr(this->methodOopPtr + OFFSET_oopDesc_metadata);
113N/A this->methodOop = this->klass == this->Universe_methodKlassOop;
113N/A this->done = !this->methodOop;
113N/A}
113N/A
113N/Adtrace:helper:ustack:
113N/A/!this->done && this->vtbl == this->BufferBlob_vtbl &&
642N/Athis->Use_Compressed_Oops != 0 &&
113N/Athis->methodOopPtr > this->heap_start && this->methodOopPtr < this->heap_end/
113N/A{
113N/A MARK_LINE;
113N/A /*
113N/A * Read compressed pointer and decode heap oop, same as oop.inline.hpp
113N/A */
113N/A this->cklass = copyin_uint32(this->methodOopPtr + OFFSET_oopDesc_metadata);
642N/A this->klass = (uint64_t)((uintptr_t)this->Universe_narrow_oop_base +
642N/A ((uintptr_t)this->cklass << this->Universe_narrow_oop_shift));
0N/A this->methodOop = this->klass == this->Universe_methodKlassOop;
0N/A this->done = !this->methodOop;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && !this->methodOop/
0N/A{
0N/A MARK_LINE;
0N/A this->name = copyin_ptr(this->start + OFFSET_CodeBlob_name);
0N/A this->result = this->name != 0 ? copyinstr(this->name) : "<CodeBlob>";
0N/A this->done = 1;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->methodOop/
0N/A{
0N/A MARK_LINE;
0N/A this->constMethod = copyin_ptr(this->methodOopPtr +
0N/A OFFSET_methodOopDesc_constMethod);
0N/A
0N/A this->nameIndex = copyin_uint16(this->constMethod +
0N/A OFFSET_constMethodOopDesc_name_index);
0N/A
0N/A this->signatureIndex = copyin_uint16(this->constMethod +
0N/A OFFSET_constMethodOopDesc_signature_index);
0N/A
3790N/A this->constantPool = copyin_ptr(this->constMethod +
3790N/A OFFSET_constMethodOopDesc_constants);
0N/A
0N/A this->nameSymbol = copyin_ptr(this->constantPool +
0N/A this->nameIndex * sizeof (pointer) + SIZE_constantPoolOopDesc);
0N/A
0N/A this->nameSymbolLength = copyin_uint16(this->nameSymbol +
2062N/A OFFSET_Symbol_length);
0N/A
0N/A this->signatureSymbol = copyin_ptr(this->constantPool +
0N/A this->signatureIndex * sizeof (pointer) + SIZE_constantPoolOopDesc);
0N/A
0N/A this->signatureSymbolLength = copyin_uint16(this->signatureSymbol +
2062N/A OFFSET_Symbol_length);
0N/A
0N/A this->klassPtr = copyin_ptr(this->constantPool +
0N/A OFFSET_constantPoolOopDesc_pool_holder);
0N/A
0N/A this->klassSymbol = copyin_ptr(this->klassPtr +
0N/A OFFSET_Klass_name + SIZE_oopDesc);
0N/A
0N/A this->klassSymbolLength = copyin_uint16(this->klassSymbol +
2062N/A OFFSET_Symbol_length);
0N/A
0N/A /*
0N/A * Enough for three strings, plus the '.', plus the trailing '\0'.
0N/A */
0N/A this->result = (char *) alloca(this->klassSymbolLength +
0N/A this->nameSymbolLength +
0N/A this->signatureSymbolLength + 2 + 1);
0N/A
2062N/A copyinto(this->klassSymbol + OFFSET_Symbol_body,
0N/A this->klassSymbolLength, this->result);
0N/A
0N/A /*
0N/A * Add the '.' between the class and the name.
0N/A */
0N/A this->result[this->klassSymbolLength] = '.';
0N/A
2062N/A copyinto(this->nameSymbol + OFFSET_Symbol_body,
0N/A this->nameSymbolLength,
0N/A this->result + this->klassSymbolLength + 1);
0N/A
2062N/A copyinto(this->signatureSymbol + OFFSET_Symbol_body,
0N/A this->signatureSymbolLength,
0N/A this->result + this->klassSymbolLength +
0N/A this->nameSymbolLength + 1);
0N/A
0N/A /*
0N/A * Now we need to add a trailing '\0' and possibly a tag character.
0N/A */
0N/A this->result[this->klassSymbolLength + 1 +
0N/A this->nameSymbolLength +
0N/A this->signatureSymbolLength] = this->suffix;
0N/A this->result[this->klassSymbolLength + 2 +
0N/A this->nameSymbolLength +
0N/A this->signatureSymbolLength] = '\0';
0N/A
0N/A this->done = 1;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/this->done && this->error == (char *) NULL/
0N/A{
0N/A this->result;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/this->done && this->error != (char *) NULL/
0N/A{
0N/A this->error;
0N/A}
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done && this->codecache/
0N/A{
0N/A this->done = 1;
0N/A "error";
0N/A}
0N/A
0N/A
0N/Adtrace:helper:ustack:
0N/A/!this->done/
0N/A{
0N/A NULL;
0N/A}