vmSymbols.cpp revision 1879
765N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 765N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 765N/A * This code is free software; you can redistribute it and/or modify it 765N/A * under the terms of the GNU General Public License version 2 only, as 765N/A * published by the Free Software Foundation. 765N/A * This code is distributed in the hope that it will be useful, but WITHOUT 765N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 765N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 765N/A * version 2 for more details (a copy is included in the LICENSE file that 765N/A * accompanied this code). 765N/A * You should have received a copy of the GNU General Public License version 765N/A * 2 along with this work; if not, write to the Free Software Foundation, 765N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 765N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 765N/A // follow the natural address order: 765N/A// Put all the VM symbol strings in one place. 765N/A// Makes for a more compact libjvm. 765N/A // no single signatures for T_OBJECT or T_ARRAY 765N/A // Check for duplicates: 765N/A tty->
print(
"*** Duplicate VM symbol SIDs %s(%d) and %s(%d): \"",
765N/A // Create an index for find_id: 765N/A // Spot-check correspondence between strings, symbols, and enums: 765N/A // Make sure find_sid produces the right answer in each case. 765N/A // Note: If there are duplicates, this assert will fail. 765N/A // A "Duplicate VM symbol" message will have already been printed. 765N/A // The string "format" happens (at the moment) not to be a vmSymbol, 765N/A // 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. #
define SRC_DEST(s,d) (((
int)(s) <<
4) + (
int)(d))
string +=
1;
// skip trailing null return "(unknown intrinsic)";
// These are flag-matching functions: // These are for forming case labels: // Let the C compiler build the decision tree. case F_Y:
fname =
"synchronized ";
break;
// These are to get information about 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):",