/* * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
// Object for decoding a serialized HotSpotCompiledCode object. // Encoding is done by jdk.vm.ci.hotspot.HotSpotCompiledCodeStream. class HotSpotCompiledCodeStream : public ResourceObj { private: class Chunk { private:
Chunk* _next;
u4 _size;
Chunk* _head; // First chunk in buffer
Chunk* _chunk; // Chunk currently being read mutableconst u1* _pos; // Read position in _chunk constbool _with_type_info;
objArrayHandle _object_pool; // Pool for objects in Java heap (ignored if libjvmci)
JavaThread* _thread; // Current thread
// Virtual objects in DebugInfo currently being decoded
GrowableArray<ScopeValue*>* _virtual_objects;
// HotSpotCompiledCode.name or HotSpotCompiledNmethod.method constchar* _code_desc;
#define checked_read(value, name, type) do { \ if (_with_type_info) { check_data(sizeof(type), name); } \ return (type) value; \
} while (0)
void before_read(u1 size);
u1 get_u1() { before_read(1); u1 res = *_pos; _pos += 1; return res; }
u2 get_u2() { before_read(2); u2 res = *((u2*) _pos); _pos += 2; return res; }
u4 get_u4() { before_read(4); u4 res = *((u4*) _pos); _pos += 4; return res; }
u8 get_u8() { before_read(8); u8 res = *((u8*) _pos); _pos += 8; return res; }
// Dump complete buffer to `st`. void dump_buffer(outputStream* st=tty) const;
// Dump last `len` bytes of current buffer chunk to `st` void dump_buffer_tail(int len, outputStream* st=tty) const;
// Gets a string containing code_desc() followed by a hexdump // of about 100 bytes in the stream up to the current read position. constchar* context() const;
// Gets the tag to be used with `read_oop()` corresponding to `patch_object_tag`. static u1 as_read_oop_tag(HotSpotCompiledCodeStream* stream, u1 patch_object_tag, JVMCI_TRAPS);
// extract the fields of the HotSpotCompiledCode void initialize_fields(HotSpotCompiledCodeStream* stream, u1 code_flags, methodHandle& method, CodeBuffer& buffer, JVMCI_TRAPS); void initialize_dependencies(HotSpotCompiledCodeStream* stream, u1 code_flags, OopRecorder* oop_recorder, JVMCI_TRAPS);
int estimate_stubs_size(HotSpotCompiledCodeStream* stream, JVMCI_TRAPS);
// perform data and call relocation on the CodeBuffer
JVMCI::CodeInstallResult initialize_buffer(JVMCIObject compiled_code, CodeBuffer& buffer, HotSpotCompiledCodeStream* stream, u1 code_flags, JVMCI_TRAPS);
// full_info: if false, only BytecodePosition is in stream otherwise all DebugInfo is in stream void record_scope(jint pc_offset, HotSpotCompiledCodeStream* stream, u1 debug_info_flags, bool full_info, bool is_mh_invoke, bool return_oop, JVMCI_TRAPS);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.