vtableStubs.cpp revision 1472
5023N/A * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 5023N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5023N/A * This code is free software; you can redistribute it and/or modify it 5023N/A * under the terms of the GNU General Public License version 2 only, as 5023N/A * published by the Free Software Foundation. 5023N/A * This code is distributed in the hope that it will be useful, but WITHOUT 5023N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5023N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5023N/A * version 2 for more details (a copy is included in the LICENSE file that 5023N/A * You should have received a copy of the GNU General Public License version 5023N/A * 2 along with this work; if not, write to the Free Software Foundation, 5023N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5023N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 5023N/A#
include "incls/_precompiled.incl" 5023N/A// ----------------------------------------------------------------------------------------- 5023N/A// Implementation of VtableStub 5023N/A // compute real VtableStub size (rounded to nearest word) 5023N/A // malloc them in chunks to minimize header overhead 5023N/A // Notify JVMTI about this stub. The event will be recorded by the enclosing 5023N/A // JvmtiDynamicCodeEventCollector and posted when this thread has released 5023N/A// ----------------------------------------------------------------------------------------- 5023N/A// Implementation of VtableStubs 5023N/A// For each hash value there's a linked list of vtable stubs (with that 5023N/A// hash value). Each list is anchored in a little hash _table, indexed for (
int i = 0; i < N; i++) {
// Assumption: receiver_location < 4 in most cases. // enter s at the beginning of the corresponding list // simple solution for now - we may want to use // a faster way if this function is called often // Note: No locking needed since any change to the data structure // happens with an atomic store into it (we don't care about // consistency with the _number_of_vtable_stubs counter). for (
int i = 0; i < N; i++) {
//----------------------------------------------------------------------------------------------------- "index %d (vtable length %d)",