classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Patch: FYI: avoid some trampolines


From: Tom Tromey
Subject: [cp-patches] Patch: FYI: avoid some trampolines
Date: 06 Nov 2004 15:42:09 -0700

I'm checking this in to classpath and libgcj.

A while back I wrote a jumbo patch to avoid trampolines of various
kinds.  These occur when a class references a private member of an
inner or outer class.

I'm going to break the patch into pieces and check it in piecemeal.
This is the first installment.

Tom

Index: ChangeLog
from  Tom Tromey  <address@hidden>

        * gnu/java/nio/charset/ISO_8859_1.java (Decoder): Now
        package-private.
        (Encoder): Likewise.
        * gnu/java/nio/charset/UTF_8.java (Decoder): Now package-private.
        (Encoder): Likewise.
        * gnu/java/nio/charset/US_ASCII.java (Decoder): Now
        package-private.
        (Encoder): Likewise.

Index: gnu/java/nio/charset/ISO_8859_1.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/ISO_8859_1.java,v
retrieving revision 1.2
diff -u -r1.2 ISO_8859_1.java
--- gnu/java/nio/charset/ISO_8859_1.java 8 Nov 2002 14:05:22 -0000 1.2
+++ gnu/java/nio/charset/ISO_8859_1.java 6 Nov 2004 22:43:06 -0000
@@ -1,5 +1,5 @@
 /* ISO_8859_1.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -73,7 +73,8 @@
 
   private static final class Decoder extends CharsetDecoder
   {
-    private Decoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Decoder (Charset cs)
     {
       super (cs, 1.0f, 1.0f);
     }
@@ -100,7 +101,8 @@
 
   private static final class Encoder extends CharsetEncoder
   {
-    private Encoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Encoder (Charset cs)
     {
       super (cs, 1.0f, 1.0f);
     }
Index: gnu/java/nio/charset/US_ASCII.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/US_ASCII.java,v
retrieving revision 1.2
diff -u -r1.2 US_ASCII.java
--- gnu/java/nio/charset/US_ASCII.java 8 Nov 2002 14:05:22 -0000 1.2
+++ gnu/java/nio/charset/US_ASCII.java 6 Nov 2004 22:43:06 -0000
@@ -1,5 +1,5 @@
 /* US_ASCII.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -73,7 +73,8 @@
 
   private static final class Decoder extends CharsetDecoder
   {
-    private Decoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Decoder (Charset cs)
     {
       super (cs, 1.0f, 1.0f);
     }
@@ -105,7 +106,8 @@
 
   private static final class Encoder extends CharsetEncoder
   {
-    private Encoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Encoder (Charset cs)
     {
       super (cs, 1.0f, 1.0f);
     }
Index: gnu/java/nio/charset/UTF_8.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/nio/charset/UTF_8.java,v
retrieving revision 1.2
diff -u -r1.2 UTF_8.java
--- gnu/java/nio/charset/UTF_8.java 8 Nov 2002 14:05:22 -0000 1.2
+++ gnu/java/nio/charset/UTF_8.java 6 Nov 2004 22:43:06 -0000
@@ -1,5 +1,5 @@
 /* UTF_8.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -84,7 +84,8 @@
 
   private static final class Decoder extends CharsetDecoder
   {
-    private Decoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Decoder (Charset cs)
     {
       super (cs, 1.0f, 1.0f);
     }
@@ -171,7 +172,8 @@
 
   private static final class Encoder extends CharsetEncoder
   {
-    private Encoder (Charset cs)
+    // Package-private to avoid a trampoline constructor.
+    Encoder (Charset cs)
     {
       // According to
       // 
http://www-106.ibm.com/developerworks/unicode/library/utfencodingforms/index.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]