5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_vtableStubs_x86_64.cpp.incl" 27 28 // machine-dependent part of VtableStubs: create VtableStub of correct size and 29 // initialize its code 30 31 #define __ masm-> 32 33 #ifndef PRODUCT 34 extern "C" void bad_compiled_vtable_index(JavaThread* thread, 35 oop receiver, 36 int index); 37 #endif 38 39 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { 40 const int amd64_code_length = VtableStub::pd_code_size_limit(true); 41 VtableStub* s = new(amd64_code_length) VtableStub(true, vtable_index); 42 ResourceMark rm; 43 CodeBuffer cb(s->entry_point(), amd64_code_length); 44 MacroAssembler* masm = new MacroAssembler(&cb); 45 46 #ifndef PRODUCT | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/assembler.hpp" 27 #include "assembler_x86.inline.hpp" 28 #include "code/vtableStubs.hpp" 29 #include "interp_masm_x86_64.hpp" 30 #include "memory/resourceArea.hpp" 31 #include "oops/instanceKlass.hpp" 32 #include "oops/klassVtable.hpp" 33 #include "runtime/sharedRuntime.hpp" 34 #include "vmreg_x86.inline.hpp" 35 #ifdef COMPILER2 36 #include "opto/runtime.hpp" 37 #endif 38 39 // machine-dependent part of VtableStubs: create VtableStub of correct size and 40 // initialize its code 41 42 #define __ masm-> 43 44 #ifndef PRODUCT 45 extern "C" void bad_compiled_vtable_index(JavaThread* thread, 46 oop receiver, 47 int index); 48 #endif 49 50 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { 51 const int amd64_code_length = VtableStub::pd_code_size_limit(true); 52 VtableStub* s = new(amd64_code_length) VtableStub(true, vtable_index); 53 ResourceMark rm; 54 CodeBuffer cb(s->entry_point(), amd64_code_length); 55 MacroAssembler* masm = new MacroAssembler(&cb); 56 57 #ifndef PRODUCT |