Path: blob/master/src/hotspot/cpu/arm/icBuffer_arm.cpp
40930 views
/*1* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "asm/assembler.inline.hpp"26#include "code/icBuffer.hpp"27#include "gc/shared/collectedHeap.inline.hpp"28#include "interpreter/bytecodes.hpp"29#include "memory/resourceArea.hpp"30#include "nativeInst_arm.hpp"31#include "oops/oop.inline.hpp"3233#define __ masm->3435int InlineCacheBuffer::ic_stub_code_size() {36return (4 * Assembler::InstructionSize);37}3839void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, void* cached_value, address entry_point) {40ResourceMark rm;41CodeBuffer code(code_begin, ic_stub_code_size());42MacroAssembler* masm = new MacroAssembler(&code);4344InlinedAddress oop_literal((address) cached_value);45__ ldr_literal(Ricklass, oop_literal);46// FIXME: OK to remove reloc here?47__ patchable_jump(entry_point, relocInfo::runtime_call_type, Rtemp);48__ bind_literal(oop_literal);49__ flush();50}5152address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {53address jump_address;54jump_address = code_begin + NativeInstruction::instruction_size;55NativeJump* jump = nativeJump_at(jump_address);56return jump->jump_destination();57}5859void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {60NativeMovConstReg* move = nativeMovConstReg_at(code_begin);61return (void*)move->data();62}6364#undef __656667