0N/A/*
2273N/A * Copyright (c) 1997, 2011, 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
1879N/A#ifndef SHARE_VM_ASM_CODEBUFFER_HPP
1879N/A#define SHARE_VM_ASM_CODEBUFFER_HPP
1879N/A
1879N/A#include "asm/assembler.hpp"
1879N/A#include "code/oopRecorder.hpp"
1879N/A#include "code/relocInfo.hpp"
1879N/A
4332N/Aclass CodeStrings;
0N/Aclass AbstractAssembler;
0N/Aclass MacroAssembler;
0N/Aclass PhaseCFG;
0N/Aclass Compile;
0N/Aclass BufferBlob;
0N/Aclass CodeBuffer;
0N/A
0N/Aclass CodeOffsets: public StackObj {
0N/Apublic:
0N/A enum Entries { Entry,
0N/A Verified_Entry,
0N/A Frame_Complete, // Offset in the code where the frame setup is (for forte stackwalks) is complete
0N/A OSR_Entry,
116N/A Dtrace_trap = OSR_Entry, // dtrace probes can never have an OSR entry so reuse it
0N/A Exceptions, // Offset where exception handler lives
0N/A Deopt, // Offset where deopt handler lives
1204N/A DeoptMH, // Offset where MethodHandle deopt handler lives
1378N/A UnwindHandler, // Offset to default unwind handler
0N/A max_Entries };
0N/A
0N/A // special value to note codeBlobs where profile (forte) stack walking is
0N/A // always dangerous and suspect.
0N/A
0N/A enum { frame_never_safe = -1 };
0N/A
0N/Aprivate:
0N/A int _values[max_Entries];
0N/A
0N/Apublic:
0N/A CodeOffsets() {
1204N/A _values[Entry ] = 0;
0N/A _values[Verified_Entry] = 0;
0N/A _values[Frame_Complete] = frame_never_safe;
1204N/A _values[OSR_Entry ] = 0;
1204N/A _values[Exceptions ] = -1;
1204N/A _values[Deopt ] = -1;
1204N/A _values[DeoptMH ] = -1;
1378N/A _values[UnwindHandler ] = -1;
0N/A }
0N/A
0N/A int value(Entries e) { return _values[e]; }
0N/A void set_value(Entries e, int val) { _values[e] = val; }
0N/A};
0N/A
0N/A// This class represents a stream of code and associated relocations.
0N/A// There are a few in each CodeBuffer.
0N/A// They are filled concurrently, and concatenated at the end.
0N/Aclass CodeSection VALUE_OBJ_CLASS_SPEC {
0N/A friend class CodeBuffer;
0N/A public:
0N/A typedef int csize_t; // code size type; would be size_t except for history
0N/A
0N/A private:
0N/A address _start; // first byte of contents (instructions)
0N/A address _mark; // user mark, usually an instruction beginning
0N/A address _end; // current end address
0N/A address _limit; // last possible (allocated) end address
0N/A relocInfo* _locs_start; // first byte of relocation information
0N/A relocInfo* _locs_end; // first byte after relocation information
0N/A relocInfo* _locs_limit; // first byte after relocation information buf
0N/A address _locs_point; // last relocated position (grows upward)
0N/A bool _locs_own; // did I allocate the locs myself?
0N/A bool _frozen; // no more expansion of this section
0N/A char _index; // my section number (SECT_INST, etc.)
0N/A CodeBuffer* _outer; // enclosing CodeBuffer
0N/A
0N/A // (Note: _locs_point used to be called _last_reloc_offset.)
0N/A
0N/A CodeSection() {
0N/A _start = NULL;
0N/A _mark = NULL;
0N/A _end = NULL;
0N/A _limit = NULL;
0N/A _locs_start = NULL;
0N/A _locs_end = NULL;
0N/A _locs_limit = NULL;
0N/A _locs_point = NULL;
0N/A _locs_own = false;
0N/A _frozen = false;
1601N/A debug_only(_index = (char)-1);
0N/A debug_only(_outer = (CodeBuffer*)badAddress);
0N/A }
0N/A
0N/A void initialize_outer(CodeBuffer* outer, int index) {
0N/A _outer = outer;
0N/A _index = index;
0N/A }
0N/A
0N/A void initialize(address start, csize_t size = 0) {
0N/A assert(_start == NULL, "only one init step, please");
0N/A _start = start;
0N/A _mark = NULL;
0N/A _end = start;
0N/A
0N/A _limit = start + size;
0N/A _locs_point = start;
0N/A }
0N/A
0N/A void initialize_locs(int locs_capacity);
0N/A void expand_locs(int new_capacity);
0N/A void initialize_locs_from(const CodeSection* source_cs);
0N/A
0N/A // helper for CodeBuffer::expand()
0N/A void take_over_code_from(CodeSection* cs) {
0N/A _start = cs->_start;
0N/A _mark = cs->_mark;
0N/A _end = cs->_end;
0N/A _limit = cs->_limit;
0N/A _locs_point = cs->_locs_point;
0N/A }
0N/A
0N/A public:
0N/A address start() const { return _start; }
0N/A address mark() const { return _mark; }
0N/A address end() const { return _end; }
0N/A address limit() const { return _limit; }
0N/A csize_t size() const { return (csize_t)(_end - _start); }
0N/A csize_t mark_off() const { assert(_mark != NULL, "not an offset");
0N/A return (csize_t)(_mark - _start); }
0N/A csize_t capacity() const { return (csize_t)(_limit - _start); }
0N/A csize_t remaining() const { return (csize_t)(_limit - _end); }
0N/A
0N/A relocInfo* locs_start() const { return _locs_start; }
0N/A relocInfo* locs_end() const { return _locs_end; }
0N/A int locs_count() const { return (int)(_locs_end - _locs_start); }
0N/A relocInfo* locs_limit() const { return _locs_limit; }
0N/A address locs_point() const { return _locs_point; }
0N/A csize_t locs_point_off() const{ return (csize_t)(_locs_point - _start); }
0N/A csize_t locs_capacity() const { return (csize_t)(_locs_limit - _locs_start); }
0N/A csize_t locs_remaining()const { return (csize_t)(_locs_limit - _locs_end); }
0N/A
0N/A int index() const { return _index; }
0N/A bool is_allocated() const { return _start != NULL; }
0N/A bool is_empty() const { return _start == _end; }
0N/A bool is_frozen() const { return _frozen; }
0N/A bool has_locs() const { return _locs_end != NULL; }
0N/A
0N/A CodeBuffer* outer() const { return _outer; }
0N/A
0N/A // is a given address in this section? (2nd version is end-inclusive)
0N/A bool contains(address pc) const { return pc >= _start && pc < _end; }
0N/A bool contains2(address pc) const { return pc >= _start && pc <= _end; }
0N/A bool allocates(address pc) const { return pc >= _start && pc < _limit; }
0N/A bool allocates2(address pc) const { return pc >= _start && pc <= _limit; }
0N/A
1766N/A void set_end(address pc) { assert(allocates2(pc), err_msg("not in CodeBuffer memory: " PTR_FORMAT " <= " PTR_FORMAT " <= " PTR_FORMAT, _start, pc, _limit)); _end = pc; }
1766N/A void set_mark(address pc) { assert(contains2(pc), "not in codeBuffer");
0N/A _mark = pc; }
0N/A void set_mark_off(int offset) { assert(contains2(offset+_start),"not in codeBuffer");
0N/A _mark = offset + _start; }
0N/A void set_mark() { _mark = _end; }
0N/A void clear_mark() { _mark = NULL; }
0N/A
0N/A void set_locs_end(relocInfo* p) {
0N/A assert(p <= locs_limit(), "locs data fits in allocated buffer");
0N/A _locs_end = p;
0N/A }
0N/A void set_locs_point(address pc) {
0N/A assert(pc >= locs_point(), "relocation addr may not decrease");
0N/A assert(allocates2(pc), "relocation addr must be in this section");
0N/A _locs_point = pc;
0N/A }
0N/A
1668N/A // Code emission
1668N/A void emit_int8 (int8_t x) { *((int8_t*) end()) = x; set_end(end() + 1); }
1668N/A void emit_int16(int16_t x) { *((int16_t*) end()) = x; set_end(end() + 2); }
1668N/A void emit_int32(int32_t x) { *((int32_t*) end()) = x; set_end(end() + 4); }
1668N/A void emit_int64(int64_t x) { *((int64_t*) end()) = x; set_end(end() + 8); }
1668N/A
0N/A // Share a scratch buffer for relocinfo. (Hacky; saves a resource allocation.)
0N/A void initialize_shared_locs(relocInfo* buf, int length);
0N/A
0N/A // Manage labels and their addresses.
0N/A address target(Label& L, address branch_pc);
0N/A
0N/A // Emit a relocation.
0N/A void relocate(address at, RelocationHolder const& rspec, int format = 0);
0N/A void relocate(address at, relocInfo::relocType rtype, int format = 0) {
0N/A if (rtype != relocInfo::none)
0N/A relocate(at, Relocation::spec_simple(rtype), format);
0N/A }
0N/A
0N/A // alignment requirement for starting offset
0N/A // Requirements are that the instruction area and the
0N/A // stubs area must start on CodeEntryAlignment, and
0N/A // the ctable on sizeof(jdouble)
0N/A int alignment() const { return MAX2((int)sizeof(jdouble), (int)CodeEntryAlignment); }
0N/A
0N/A // Slop between sections, used only when allocating temporary BufferBlob buffers.
0N/A static csize_t end_slop() { return MAX2((int)sizeof(jdouble), (int)CodeEntryAlignment); }
0N/A
0N/A csize_t align_at_start(csize_t off) const { return (csize_t) align_size_up(off, alignment()); }
0N/A
0N/A // Mark a section frozen. Assign its remaining space to
0N/A // the following section. It will never expand after this point.
0N/A inline void freeze(); // { _outer->freeze_section(this); }
0N/A
0N/A // Ensure there's enough space left in the current section.
0N/A // Return true if there was an expansion.
0N/A bool maybe_expand_to_ensure_remaining(csize_t amount);
0N/A
0N/A#ifndef PRODUCT
0N/A void decode();
0N/A void dump();
0N/A void print(const char* name);
0N/A#endif //PRODUCT
0N/A};
0N/A
4332N/Aclass CodeString;
4332N/Aclass CodeStrings VALUE_OBJ_CLASS_SPEC {
0N/Aprivate:
0N/A#ifndef PRODUCT
4332N/A CodeString* _strings;
0N/A#endif
0N/A
4332N/A CodeString* find(intptr_t offset) const;
4332N/A CodeString* find_last(intptr_t offset) const;
4332N/A
0N/Apublic:
4332N/A CodeStrings() {
0N/A#ifndef PRODUCT
4332N/A _strings = NULL;
0N/A#endif
0N/A }
0N/A
4332N/A const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;);
4332N/A
0N/A void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
4016N/A void print_block_comment(outputStream* stream, intptr_t offset) const PRODUCT_RETURN;
4332N/A void assign(CodeStrings& other) PRODUCT_RETURN;
0N/A void free() PRODUCT_RETURN;
0N/A};
0N/A
0N/A// A CodeBuffer describes a memory space into which assembly
0N/A// code is generated. This memory space usually occupies the
0N/A// interior of a single BufferBlob, but in some cases it may be
0N/A// an arbitrary span of memory, even outside the code cache.
0N/A//
0N/A// A code buffer comes in two variants:
0N/A//
0N/A// (1) A CodeBuffer referring to an already allocated piece of memory:
0N/A// This is used to direct 'static' code generation (e.g. for interpreter
0N/A// or stubroutine generation, etc.). This code comes with NO relocation
0N/A// information.
0N/A//
0N/A// (2) A CodeBuffer referring to a piece of memory allocated when the
0N/A// CodeBuffer is allocated. This is used for nmethod generation.
0N/A//
0N/A// The memory can be divided up into several parts called sections.
0N/A// Each section independently accumulates code (or data) an relocations.
0N/A// Sections can grow (at the expense of a reallocation of the BufferBlob
0N/A// and recopying of all active sections). When the buffered code is finally
0N/A// written to an nmethod (or other CodeBlob), the contents (code, data,
0N/A// and relocations) of the sections are padded to an alignment and concatenated.
0N/A// Instructions and data in one section can contain relocatable references to
0N/A// addresses in a sibling section.
0N/A
0N/Aclass CodeBuffer: public StackObj {
0N/A friend class CodeSection;
0N/A
0N/A private:
0N/A // CodeBuffers must be allocated on the stack except for a single
0N/A // special case during expansion which is handled internally. This
0N/A // is done to guarantee proper cleanup of resources.
0N/A void* operator new(size_t size) { return ResourceObj::operator new(size); }
1605N/A void operator delete(void* p) { ShouldNotCallThis(); }
0N/A
0N/A public:
0N/A typedef int csize_t; // code size type; would be size_t except for history
0N/A enum {
1682N/A // Here is the list of all possible sections. The order reflects
1682N/A // the final layout.
1682N/A SECT_FIRST = 0,
1682N/A SECT_CONSTS = SECT_FIRST, // Non-instruction data: Floats, jump tables, etc.
0N/A SECT_INSTS, // Executable instructions.
0N/A SECT_STUBS, // Outbound trampolines for supporting call sites.
0N/A SECT_LIMIT, SECT_NONE = -1
0N/A };
0N/A
0N/A private:
0N/A enum {
0N/A sect_bits = 2, // assert (SECT_LIMIT <= (1<<sect_bits))
0N/A sect_mask = (1<<sect_bits)-1
0N/A };
0N/A
0N/A const char* _name;
0N/A
1682N/A CodeSection _consts; // constants, jump tables
0N/A CodeSection _insts; // instructions (the main section)
0N/A CodeSection _stubs; // stubs (call site support), deopt, exception handling
0N/A
0N/A CodeBuffer* _before_expand; // dead buffer, from before the last expansion
0N/A
0N/A BufferBlob* _blob; // optional buffer in CodeCache for generated code
0N/A address _total_start; // first address of combined memory buffer
0N/A csize_t _total_size; // size in bytes of combined memory buffer
0N/A
0N/A OopRecorder* _oop_recorder;
4332N/A CodeStrings _strings;
0N/A OopRecorder _default_oop_recorder; // override with initialize_oop_recorder
0N/A Arena* _overflow_arena;
0N/A
0N/A address _decode_begin; // start address for decode
0N/A address decode_begin();
0N/A
0N/A void initialize_misc(const char * name) {
0N/A // all pointers other than code_start/end and those inside the sections
0N/A assert(name != NULL, "must have a name");
0N/A _name = name;
0N/A _before_expand = NULL;
0N/A _blob = NULL;
0N/A _oop_recorder = NULL;
0N/A _decode_begin = NULL;
0N/A _overflow_arena = NULL;
0N/A }
0N/A
0N/A void initialize(address code_start, csize_t code_size) {
1682N/A _consts.initialize_outer(this, SECT_CONSTS);
0N/A _insts.initialize_outer(this, SECT_INSTS);
0N/A _stubs.initialize_outer(this, SECT_STUBS);
0N/A _total_start = code_start;
0N/A _total_size = code_size;
0N/A // Initialize the main section:
0N/A _insts.initialize(code_start, code_size);
0N/A assert(!_stubs.is_allocated(), "no garbage here");
0N/A assert(!_consts.is_allocated(), "no garbage here");
0N/A _oop_recorder = &_default_oop_recorder;
0N/A }
0N/A
0N/A void initialize_section_size(CodeSection* cs, csize_t size);
0N/A
0N/A void freeze_section(CodeSection* cs);
0N/A
0N/A // helper for CodeBuffer::expand()
0N/A void take_over_code_from(CodeBuffer* cs);
0N/A
0N/A // ensure sections are disjoint, ordered, and contained in the blob
2897N/A void verify_section_allocation();
0N/A
0N/A // copies combined relocations to the blob, returns bytes copied
0N/A // (if target is null, it is a dry run only, just for sizing)
0N/A csize_t copy_relocations_to(CodeBlob* blob) const;
0N/A
0N/A // copies combined code to the blob (assumes relocs are already in there)
0N/A void copy_code_to(CodeBlob* blob);
0N/A
0N/A // moves code sections to new buffer (assumes relocs are already in there)
0N/A void relocate_code_to(CodeBuffer* cb) const;
0N/A
0N/A // set up a model of the final layout of my contents
0N/A void compute_final_layout(CodeBuffer* dest) const;
0N/A
0N/A // Expand the given section so at least 'amount' is remaining.
0N/A // Creates a new, larger BufferBlob, and rewrites the code & relocs.
0N/A void expand(CodeSection* which_cs, csize_t amount);
0N/A
0N/A // Helper for expand.
0N/A csize_t figure_expanded_capacities(CodeSection* which_cs, csize_t amount, csize_t* new_capacity);
0N/A
0N/A public:
0N/A // (1) code buffer referring to pre-allocated instruction memory
1668N/A CodeBuffer(address code_start, csize_t code_size) {
1668N/A assert(code_start != NULL, "sanity");
1668N/A initialize_misc("static buffer");
1668N/A initialize(code_start, code_size);
2897N/A verify_section_allocation();
1668N/A }
0N/A
1668N/A // (2) CodeBuffer referring to pre-allocated CodeBlob.
1668N/A CodeBuffer(CodeBlob* blob);
1668N/A
1668N/A // (3) code buffer allocating codeBlob memory for code & relocation
0N/A // info but with lazy initialization. The name must be something
0N/A // informative.
0N/A CodeBuffer(const char* name) {
0N/A initialize_misc(name);
0N/A }
0N/A
0N/A
1668N/A // (4) code buffer allocating codeBlob memory for code & relocation
0N/A // info. The name must be something informative and code_size must
0N/A // include both code and stubs sizes.
0N/A CodeBuffer(const char* name, csize_t code_size, csize_t locs_size) {
0N/A initialize_misc(name);
0N/A initialize(code_size, locs_size);
0N/A }
0N/A
0N/A ~CodeBuffer();
0N/A
1668N/A // Initialize a CodeBuffer constructed using constructor 3. Using
1668N/A // constructor 4 is equivalent to calling constructor 3 and then
0N/A // calling this method. It's been factored out for convenience of
0N/A // construction.
0N/A void initialize(csize_t code_size, csize_t locs_size);
0N/A
1682N/A CodeSection* consts() { return &_consts; }
0N/A CodeSection* insts() { return &_insts; }
0N/A CodeSection* stubs() { return &_stubs; }
0N/A
1682N/A // present sections in order; return NULL at end; consts is #0, etc.
0N/A CodeSection* code_section(int n) {
1682N/A // This makes the slightly questionable but portable assumption
1682N/A // that the various members (_consts, _insts, _stubs, etc.) are
1682N/A // adjacent in the layout of CodeBuffer.
1682N/A CodeSection* cs = &_consts + n;
0N/A assert(cs->index() == n || !cs->is_allocated(), "sanity");
0N/A return cs;
0N/A }
0N/A const CodeSection* code_section(int n) const { // yucky const stuff
0N/A return ((CodeBuffer*)this)->code_section(n);
0N/A }
0N/A static const char* code_section_name(int n);
0N/A int section_index_of(address addr) const;
0N/A bool contains(address addr) const {
0N/A // handy for debugging
0N/A return section_index_of(addr) > SECT_NONE;
0N/A }
0N/A
0N/A // A stable mapping between 'locators' (small ints) and addresses.
0N/A static int locator_pos(int locator) { return locator >> sect_bits; }
0N/A static int locator_sect(int locator) { return locator & sect_mask; }
0N/A static int locator(int pos, int sect) { return (pos << sect_bits) | sect; }
0N/A int locator(address addr) const;
0N/A address locator_address(int locator) const;
0N/A
0N/A // Properties
0N/A const char* name() const { return _name; }
0N/A CodeBuffer* before_expand() const { return _before_expand; }
0N/A BufferBlob* blob() const { return _blob; }
0N/A void set_blob(BufferBlob* blob);
0N/A void free_blob(); // Free the blob, if we own one.
0N/A
0N/A // Properties relative to the insts section:
1668N/A address insts_begin() const { return _insts.start(); }
1668N/A address insts_end() const { return _insts.end(); }
1668N/A void set_insts_end(address end) { _insts.set_end(end); }
1668N/A address insts_limit() const { return _insts.limit(); }
1668N/A address insts_mark() const { return _insts.mark(); }
1668N/A void set_insts_mark() { _insts.set_mark(); }
1668N/A void clear_insts_mark() { _insts.clear_mark(); }
0N/A
0N/A // is there anything in the buffer other than the current section?
1668N/A bool is_pure() const { return insts_size() == total_content_size(); }
0N/A
0N/A // size in bytes of output so far in the insts sections
1668N/A csize_t insts_size() const { return _insts.size(); }
0N/A
1668N/A // same as insts_size(), except that it asserts there is no non-code here
1668N/A csize_t pure_insts_size() const { assert(is_pure(), "no non-code");
1668N/A return insts_size(); }
0N/A // capacity in bytes of the insts sections
1668N/A csize_t insts_capacity() const { return _insts.capacity(); }
0N/A
0N/A // number of bytes remaining in the insts section
1668N/A csize_t insts_remaining() const { return _insts.remaining(); }
0N/A
0N/A // is a given address in the insts section? (2nd version is end-inclusive)
1668N/A bool insts_contains(address pc) const { return _insts.contains(pc); }
1668N/A bool insts_contains2(address pc) const { return _insts.contains2(pc); }
0N/A
1668N/A // Allocated size in all sections, when aligned and concatenated
1668N/A // (this is the eventual state of the content in its final
1668N/A // CodeBlob).
1668N/A csize_t total_content_size() const;
0N/A
1682N/A // Combined offset (relative to start of first section) of given
1682N/A // section, as eventually found in the final CodeBlob.
1682N/A csize_t total_offset_of(CodeSection* cs) const;
0N/A
0N/A // allocated size of all relocation data, including index, rounded up
0N/A csize_t total_relocation_size() const;
0N/A
0N/A // allocated size of any and all recorded oops
0N/A csize_t total_oop_size() const {
0N/A OopRecorder* recorder = oop_recorder();
0N/A return (recorder == NULL)? 0: recorder->oop_size();
0N/A }
0N/A
0N/A // Configuration functions, called immediately after the CB is constructed.
0N/A // The section sizes are subtracted from the original insts section.
0N/A // Note: Call them in reverse section order, because each steals from insts.
0N/A void initialize_consts_size(csize_t size) { initialize_section_size(&_consts, size); }
0N/A void initialize_stubs_size(csize_t size) { initialize_section_size(&_stubs, size); }
0N/A // Override default oop recorder.
0N/A void initialize_oop_recorder(OopRecorder* r);
0N/A
0N/A OopRecorder* oop_recorder() const { return _oop_recorder; }
4332N/A CodeStrings& strings() { return _strings; }
0N/A
0N/A // Code generation
0N/A void relocate(address at, RelocationHolder const& rspec, int format = 0) {
0N/A _insts.relocate(at, rspec, format);
0N/A }
0N/A void relocate(address at, relocInfo::relocType rtype, int format = 0) {
0N/A _insts.relocate(at, rtype, format);
0N/A }
0N/A
0N/A // Management of overflow storage for binding of Labels.
0N/A GrowableArray<int>* create_patch_overflow();
0N/A
0N/A // NMethod generation
0N/A void copy_code_and_locs_to(CodeBlob* blob) {
0N/A assert(blob != NULL, "sane");
0N/A copy_relocations_to(blob);
0N/A copy_code_to(blob);
0N/A }
1483N/A void copy_oops_to(nmethod* nm) {
0N/A if (!oop_recorder()->is_unused()) {
1483N/A oop_recorder()->copy_to(nm);
0N/A }
0N/A }
0N/A
0N/A // Transform an address from the code in this code buffer to a specified code buffer
0N/A address transform_address(const CodeBuffer &cb, address addr) const;
0N/A
0N/A void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
4332N/A const char* code_string(const char* str) PRODUCT_RETURN_(return NULL;);
0N/A
2897N/A // Log a little info about section usage in the CodeBuffer
2897N/A void log_section_sizes(const char* name);
2897N/A
0N/A#ifndef PRODUCT
0N/A public:
0N/A // Printing / Decoding
0N/A // decodes from decode_begin() to code_end() and sets decode_begin to end
0N/A void decode();
0N/A void decode_all(); // decodes all the code
0N/A void skip_decode(); // sets decode_begin to code_end();
0N/A void print();
0N/A#endif
0N/A
0N/A
0N/A // The following header contains architecture-specific implementations
1879N/A#ifdef TARGET_ARCH_x86
1879N/A# include "codeBuffer_x86.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_ARCH_sparc
1879N/A# include "codeBuffer_sparc.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_ARCH_zero
1879N/A# include "codeBuffer_zero.hpp"
1879N/A#endif
2073N/A#ifdef TARGET_ARCH_arm
2073N/A# include "codeBuffer_arm.hpp"
2073N/A#endif
2073N/A#ifdef TARGET_ARCH_ppc
2073N/A# include "codeBuffer_ppc.hpp"
2073N/A#endif
1879N/A
0N/A};
0N/A
0N/A
0N/Ainline void CodeSection::freeze() {
0N/A _outer->freeze_section(this);
0N/A}
0N/A
0N/Ainline bool CodeSection::maybe_expand_to_ensure_remaining(csize_t amount) {
0N/A if (remaining() < amount) { _outer->expand(this, amount); return true; }
0N/A return false;
0N/A}
1879N/A
1879N/A#endif // SHARE_VM_ASM_CODEBUFFER_HPP