vmSymbols.cpp revision 1080
2362N/A * Copyright 1997-2008 Sun Microsystems, Inc. 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 2362N/A * published by the Free Software Foundation. 2362N/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. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A#
include "incls/_precompiled.incl" 0N/A if (a == b)
return 0;
0N/A // follow the natural address order: 0N/A// Put all the VM symbol strings in one place. 0N/A// Makes for a more compact libjvm. 0N/A // no single signatures for T_OBJECT or T_ARRAY 0N/A // Check for duplicates: tty->
print(
"*** Duplicate VM symbol SIDs %s(%d) and %s(%d): \"",
// Create an index for find_id: // Spot-check correspondence between strings, symbols, and enums: // Make sure find_sid produces the right answer in each case. // Note: If there are duplicates, this assert will fail. // A "Duplicate VM symbol" message will have already been printed. // The string "format" happens (at the moment) not to be a vmSymbol, // though it is a method name in java.lang.String. string +=
1;
// skip trailing null for (
int i = 0; i <
T_VOID+
1; i++) {
// (Typical counts are calls=7000 and probes=17000.) // Handle the majority of misses by a bounds check. // Then, use a binary search over the index. // Expected trip count is less than log2_SID_LIMIT, about eight. // This is slow but acceptable, given that calls are not // dynamically common. (methodOop::intrinsic_id has a cache.) if (
cmp1 <= 0) {
// before the first if (
cmp1 >= 0) {
// after the last // After checking the extremes, do a binary search. ++
min; --
max;
// endpoints are done max =
mid -
1;
// symbol < symbol_at(sid) // Pick a new probe point: // Perform the exhaustive self-check the first 1000 calls, // and every 100 calls thereafter. // Make sure this is the right answer, using linear search. // (We have already proven that there are no duplicates in the list.) // Unless it's a duplicate, assert that the sids are the same. string +=
1;
// skip trailing null return "(unknown intrinsic)";
// These are flag-matching functions: // These are for forming case labels: #
define ID3(x, y, z) ((
jint)(z) + \
// Let the C compiler build the decision tree. case F_Y:
fname =
"synchronized ";
break;
// These are for friendly printouts of intrinsics: // verify_method performs an extra check on a matched intrinsic method return (m->
name() == n &&
// Here are a few special cases in StrictMath not declared in vmSymbols.hpp. tty->
print_cr(
"*** misidentified method; %s(%d) should be %s(%d):",