/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*
*/
#ifndef SHARE_VM_CODE_ICBUFFER_HPP
#define SHARE_VM_CODE_ICBUFFER_HPP
#include "asm/codeBuffer.hpp"
#include "interpreter/bytecodes.hpp"
#include "memory/allocation.hpp"
//
// For CompiledIC's:
//
// In cases where we do not have MT-safe state transformation,
// we go to a transition state, using ICStubs. At a safepoint,
// the inline caches are transferred from the transitional code:
//
// instruction_address --> 01 set xxx_oop, Ginline_cache_klass
// 23 jump_to Gtemp, yyyy
// 4 nop
private:
/* stub code follows here */
protected:
friend class ICStubInterface;
// This will be called only by ICStubInterface
void finalize(); // called when a method is removed
// General info
static int code_size_to_size(int code_size) { return round_to(sizeof(ICStub), CodeEntryAlignment) + code_size; }
public:
// Creation
// Code info
// Call site info
void clear();
// stub info
// Debugging
// Creation
};
// ICStub Creation
#ifdef ASSERT
#endif
return stub;
}
private:
// friends
friend class ICStub;
static int ic_stub_code_size();
static void init_next_stub();
static ICStub* new_ic_stub();
// Machine-dependent implementation of ICBuffer
public:
// Initialization; must be called before first usage
static void initialize();
// Access
// removes the ICStubs after backpatching
static void update_inline_caches();
// for debugging
static bool is_empty();
// New interface
};
#endif // SHARE_VM_CODE_ICBUFFER_HPP