You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2012/07/06 21:04:57 UTC
svn commit: r1358351 - in
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util:
SoftReferenceSymbolTable.java SymbolTable.java
Author: mrglavas
Date: Fri Jul 6 19:04:57 2012
New Revision: 1358351
URL: http://svn.apache.org/viewvc?rev=1358351&view=rev
Log:
Refactor addSymbol() methods into smaller methods. May help the JIT with inlining.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SoftReferenceSymbolTable.java
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SymbolTable.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SoftReferenceSymbolTable.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SoftReferenceSymbolTable.java?rev=1358351&r1=1358350&r2=1358351&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SoftReferenceSymbolTable.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SoftReferenceSymbolTable.java Fri Jul 6 19:04:57 2012
@@ -139,7 +139,10 @@ public class SoftReferenceSymbolTable ex
}
++collisionCount;
}
-
+ return addSymbol0(symbol, bucket, collisionCount);
+ } // addSymbol(String):String
+
+ private String addSymbol0(String symbol, int bucket, int collisionCount) {
if (fCount >= fThreshold) {
// Rehash the table if the threshold is exceeded
rehash();
@@ -158,7 +161,7 @@ public class SoftReferenceSymbolTable ex
fBuckets[bucket] = entry;
++fCount;
return symbol;
- } // addSymbol(String):String
+ } // addSymbol0(String,int,int):String
/**
* Adds the specified symbol to the symbol table and returns a
@@ -191,7 +194,10 @@ public class SoftReferenceSymbolTable ex
}
++collisionCount;
}
-
+ return addSymbol0(buffer, offset, length, bucket, collisionCount);
+ } // addSymbol(char[],int,int):String
+
+ private String addSymbol0(char[] buffer, int offset, int length, int bucket, int collisionCount) {
if (fCount >= fThreshold) {
// Rehash the table if the threshold is exceeded
rehash();
@@ -210,7 +216,7 @@ public class SoftReferenceSymbolTable ex
fBuckets[bucket] = entry;
++fCount;
return symbol;
- } // addSymbol(char[],int,int):String
+ } // addSymbol0(char[],int,int,int,int):String
/**
* Increases the capacity of and internally reorganizes this
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SymbolTable.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SymbolTable.java?rev=1358351&r1=1358350&r2=1358351&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SymbolTable.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/util/SymbolTable.java Fri Jul 6 19:04:57 2012
@@ -201,6 +201,11 @@ public class SymbolTable {
}
++collisionCount;
}
+ return addSymbol0(symbol, bucket, collisionCount);
+
+ } // addSymbol(String):String
+
+ private String addSymbol0(String symbol, int bucket, int collisionCount) {
if (fCount >= fThreshold) {
// Rehash the table if the threshold is exceeded
@@ -220,7 +225,7 @@ public class SymbolTable {
++fCount;
return entry.symbol;
- } // addSymbol(String):String
+ } // addSymbol0(String,int,int):String
/**
* Adds the specified symbol to the symbol table and returns a
@@ -249,6 +254,11 @@ public class SymbolTable {
}
++collisionCount;
}
+ return addSymbol0(buffer, offset, length, bucket, collisionCount);
+
+ } // addSymbol(char[],int,int):String
+
+ private String addSymbol0(char[] buffer, int offset, int length, int bucket, int collisionCount) {
if (fCount >= fThreshold) {
// Rehash the table if the threshold is exceeded
@@ -268,7 +278,7 @@ public class SymbolTable {
++fCount;
return entry.symbol;
- } // addSymbol(char[],int,int):String
+ } // addSymbol0(char[],int,int,int,int):String
/**
* Returns a hashcode value for the specified symbol. The value
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org