hotspot/src/share/vm/classfile/vmSymbols.cpp
changeset 35135 dd2ce9021031
parent 35110 f19bcdf40799
parent 34666 1c7168ea0034
child 35154 a9b3c1984a01
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Thu Dec 17 23:36:28 2015 +0000
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Fri Dec 18 12:39:02 2015 -0800
@@ -34,7 +34,7 @@
 
 Symbol* vmSymbols::_type_signatures[T_VOID+1] = { NULL /*, NULL...*/ };
 
-inline int compare_symbol(Symbol* a, Symbol* b) {
+inline int compare_symbol(const Symbol* a, const Symbol* b) {
   if (a == b)  return 0;
   // follow the natural address order:
   return (address)a > (address)b ? +1 : -1;
@@ -43,8 +43,8 @@
 static vmSymbols::SID vm_symbol_index[vmSymbols::SID_LIMIT];
 extern "C" {
   static int compare_vmsymbol_sid(const void* void_a, const void* void_b) {
-    Symbol* a = vmSymbols::symbol_at(*((vmSymbols::SID*) void_a));
-    Symbol* b = vmSymbols::symbol_at(*((vmSymbols::SID*) void_b));
+    const Symbol* a = vmSymbols::symbol_at(*((vmSymbols::SID*) void_a));
+    const Symbol* b = vmSymbols::symbol_at(*((vmSymbols::SID*) void_b));
     return compare_symbol(a, b);
   }
 }
@@ -188,7 +188,7 @@
 }
 
 
-BasicType vmSymbols::signature_type(Symbol* s) {
+BasicType vmSymbols::signature_type(const Symbol* s) {
   assert(s != NULL, "checking");
   for (int i = T_BOOLEAN; i < T_VOID+1; i++) {
     if (s == _type_signatures[i]) {
@@ -206,7 +206,7 @@
 // (Typical counts are calls=7000 and probes=17000.)
 #endif
 
-vmSymbols::SID vmSymbols::find_sid(Symbol* symbol) {
+vmSymbols::SID vmSymbols::find_sid(const Symbol* symbol) {
   // 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.