1879N/A * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 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 * 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 * 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. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Generate the self-patching vtable method: 0N/A// This method will be called (as any other Klass virtual method) with 0N/A// the Klass itself as the first argument. Example: 0N/A// int size = obj->klass()->klass_part()->oop_size(this); 0N/A// for which the virtual method call is Klass::oop_size(); 0N/A// The dummy method is called with the Klass object as the first 0N/A// operand, and an object as the second argument. 0N/A//===================================================================== 0N/A// All of the dummy methods in the vtable are essentially identical, 0N/A// differing only by an ordinal constant, and they bear no releationship 0N/A// to the original method which the caller intended. Also, there needs 0N/A// to be 'vtbl_list_size' instances of the vtable in order to 0N/A// differentiate between the 'vtable_list_size' original Klass objects. 0N/A // Get ready to generate dummy methods. 0N/A // -- bits[ 7..0] (8 bits) which virtual method in table? 0N/A // -- bits[12..8] (5 bits) which virtual method table? 0N/A // -- must fit in 13-bit instruction immediate field. 0N/A // Expecting to be called with "thiscall" convections -- the arguments 0N/A // are on the stack and the "this" pointer is in c_rarg0. In addition, rax 0N/A // was set (above) to the offset of the method in the table.