Remove serialization.

Get rid of every class that implements "Serializable" and associated
machinery for readObject/writeObject and the like. Get rid of tests
that assume it's there (not very many of those actually).

Remove the "serialize" and "deserialize" commands from the shell.

Remove SerializableInputStream and SerializableOutputStream.
diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml
index 50bc787..61f30b4 100644
--- a/spotbugs-exclude.xml
+++ b/spotbugs-exclude.xml
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 
 <FindBugsFilter>
-  <!-- In general, do not run this on tests or generated benchmark classes -->
   <Match>
+    <!-- In general, do not run this on tests or generated benchmark classes -->
     <Source name="~.*\/testsrc\/.*"/>
   </Match>
   <Match>
@@ -103,21 +103,22 @@
     <Class name="org.mozilla.javascript.optimizer.OptRuntime$GeneratorState"/>
     <Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
   </Match>
-  <!-- Complex legacy stuff -->
-  <!--<Match>
-    <Class name="org.mozilla.javascript.regexp.RegExpImpl"/>
-    <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
-  </Match>-->
-
-  <!-- Things below are things that we aspire to fix! -->
   <Match>
-    <!-- We are planning to eliminate serialization -->
+    <!-- We are generally not making things serializable, so not comparators -->
+    <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE"/>
+  </Match>
+  <Match>
+    <!-- We aren't going to be serializing these inherited things -->
+    <Class name="org.mozilla.javascript.tools.shell.JavaPolicySecurity$ContextPermissions"/>
     <Bug pattern="SE_BAD_FIELD"/>
   </Match>
   <Match>
-    <!-- We are planning to eliminate serialization -->
-    <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED"/>
+    <!-- We aren't going to be serializing these inherited things -->
+    <Class name="org.mozilla.javascript.tools.shell.Main$ScriptCache"/>
+    <Bug pattern="SE_BAD_FIELD"/>
   </Match>
+
+  <!-- Things below are things that we aspire to fix! -->
   <Match>
     <!-- We are planning to get rid of synchronization -->
     <Bug pattern="DC_DOUBLECHECK"/>
diff --git a/src/org/mozilla/javascript/ClassCache.java b/src/org/mozilla/javascript/ClassCache.java
index 3876ae1..b69ad91 100644
--- a/src/org/mozilla/javascript/ClassCache.java
+++ b/src/org/mozilla/javascript/ClassCache.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -18,9 +17,8 @@
  *
  * @since Rhino 1.5 Release 5
  */
-public class ClassCache implements Serializable
+public class ClassCache
 {
-    private static final long serialVersionUID = -8866246036237312215L;
     private static final Object AKEY = "ClassCache";
     private volatile boolean cachingIsEnabled = true;
     private transient Map<Class<?>,JavaMembers> classTable;
diff --git a/src/org/mozilla/javascript/CodeGenerator.java b/src/org/mozilla/javascript/CodeGenerator.java
index 1322423..b2cefac 100644
--- a/src/org/mozilla/javascript/CodeGenerator.java
+++ b/src/org/mozilla/javascript/CodeGenerator.java
@@ -13,7 +13,6 @@
 import org.mozilla.javascript.ast.Jump;
 import org.mozilla.javascript.ast.Scope;
 import org.mozilla.javascript.ast.ScriptNode;
-import org.mozilla.javascript.ast.VariableInitializer;
 
 /**
  * Generates bytecode for the Interpreter.
@@ -112,8 +111,6 @@
             itsData.isES6Generator = true;
         }
 
-        itsData.declaredAsVar = (theFunction.getParent() instanceof VariableInitializer);
-
         generateICodeFromTree(theFunction.getLastChild());
     }
 
diff --git a/src/org/mozilla/javascript/ConsString.java b/src/org/mozilla/javascript/ConsString.java
index 47d541e..04a02ca 100644
--- a/src/org/mozilla/javascript/ConsString.java
+++ b/src/org/mozilla/javascript/ConsString.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.util.ArrayDeque;
 
 /**
@@ -25,9 +24,7 @@
  *
  * <p>Both the name and the concept are borrowed from V8.</p>
  */
-public class ConsString implements CharSequence, Serializable {
-
-    private static final long serialVersionUID = -8432806714471372570L;
+public class ConsString implements CharSequence {
 
     private CharSequence left, right;
     private final int length;
@@ -39,11 +36,6 @@
         length = left.length() + right.length();
         isFlat = false;
     }
-
-    // Replace with string representation when serializing
-    private Object writeReplace() {
-        return this.toString();
-    }
     
     @Override
     public String toString() {
diff --git a/src/org/mozilla/javascript/Hashtable.java b/src/org/mozilla/javascript/Hashtable.java
index 6e51538..d57d626 100644
--- a/src/org/mozilla/javascript/Hashtable.java
+++ b/src/org/mozilla/javascript/Hashtable.java
@@ -1,6 +1,5 @@
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
@@ -26,9 +25,8 @@
  * exist, and even lets an iterator keep on iterating on a collection that was
  * empty when it was created..
  */
-public class Hashtable implements Serializable, Iterable<Hashtable.Entry> {
+public class Hashtable implements Iterable<Hashtable.Entry> {
 
-    private static final long serialVersionUID = -7151554912419543747L;
     private final HashMap<Object, Entry> map = new HashMap<>();
     private Entry first = null;
     private Entry last = null;
@@ -39,8 +37,7 @@
      * node in the linked list.
      */
 
-      public static final class Entry implements Serializable {
-      private static final long serialVersionUID = 4086572107122965503L;
+      public static final class Entry {
       protected Object key;
       protected Object value;
       protected boolean deleted;
diff --git a/src/org/mozilla/javascript/IdScriptableObject.java b/src/org/mozilla/javascript/IdScriptableObject.java
index 12a18f7..2778106 100644
--- a/src/org/mozilla/javascript/IdScriptableObject.java
+++ b/src/org/mozilla/javascript/IdScriptableObject.java
@@ -6,11 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
 /**
  * Base class for native object implementation that uses IdFunctionObject to
  * export its methods to script via &lt;class-name&gt;.prototype object.
@@ -28,12 +23,9 @@
  * 
  */
 public abstract class IdScriptableObject extends ScriptableObject implements IdFunctionCall {
-    private static final long serialVersionUID = -3744239272168621609L;
     private transient PrototypeValues prototypeValues;
 
-    private static final class PrototypeValues implements Serializable {
-        private static final long serialVersionUID = 3038645279153854371L;
-
+    private static final class PrototypeValues {
         private static final int NAME_SLOT = 1;
         private static final int SLOT_SPAN = 2;
 
@@ -1039,27 +1031,5 @@
       }
       return null;
     }
-
-    private void readObject(ObjectInputStream stream)
-        throws IOException, ClassNotFoundException
-    {
-        stream.defaultReadObject();
-        int maxPrototypeId = stream.readInt();
-        if (maxPrototypeId != 0) {
-            activatePrototypeMap(maxPrototypeId);
-        }
-    }
-
-    private void writeObject(ObjectOutputStream stream)
-        throws IOException
-    {
-        stream.defaultWriteObject();
-        int maxPrototypeId = 0;
-        if (prototypeValues != null) {
-            maxPrototypeId = prototypeValues.getMaxId();
-        }
-        stream.writeInt(maxPrototypeId);
-    }
-
 }
 
diff --git a/src/org/mozilla/javascript/Interpreter.java b/src/org/mozilla/javascript/Interpreter.java
index ac4379e..7b3a755 100644
--- a/src/org/mozilla/javascript/Interpreter.java
+++ b/src/org/mozilla/javascript/Interpreter.java
@@ -9,7 +9,6 @@
 import static org.mozilla.javascript.UniqueTag.DOUBLE_MARK;
 
 import java.io.PrintStream;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -38,10 +37,8 @@
     /**
      * Class to hold data corresponding to one interpreted call stack frame.
      */
-    private static class CallFrame implements Cloneable, Serializable
+    private static class CallFrame implements Cloneable
     {
-        private static final long serialVersionUID = -2843792508994958978L;
-
         // fields marked "final" in a comment are effectively final except when they're modified immediately after cloning.
 
         /*final*/ CallFrame parentFrame;
@@ -293,10 +290,8 @@
         return i1 == i2 || Objects.equals(getEncodedSource(i1), getEncodedSource(i2));
     }
 
-    private static final class ContinuationJump implements Serializable
+    private static final class ContinuationJump
     {
-        private static final long serialVersionUID = 7687739156004308247L;
-
         CallFrame capturedFrame;
         CallFrame branchFrame;
         Object result;
diff --git a/src/org/mozilla/javascript/InterpreterData.java b/src/org/mozilla/javascript/InterpreterData.java
index 231e2b0..2d27075 100644
--- a/src/org/mozilla/javascript/InterpreterData.java
+++ b/src/org/mozilla/javascript/InterpreterData.java
@@ -6,15 +6,12 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.util.Arrays;
 
 import org.mozilla.javascript.debug.DebuggableScript;
 
-final class InterpreterData implements Serializable, DebuggableScript
+final class InterpreterData implements DebuggableScript
 {
-    private static final long serialVersionUID = 5067677351589230234L;
-
     static final int INITIAL_MAX_ICODE_LENGTH = 1024;
     static final int INITIAL_STRINGTABLE_SIZE = 64;
     static final int INITIAL_NUMBERTABLE_SIZE = 64;
@@ -93,9 +90,6 @@
 
     private int icodeHashCode = 0;
 
-    /** true if the function has been declared like "var foo = function() {...}" */
-    boolean declaredAsVar;
-
     /** true if the function has been declared like "!function() {}". */
     boolean declaredAsFunctionExpression;
 
diff --git a/src/org/mozilla/javascript/LazilyLoadedCtor.java b/src/org/mozilla/javascript/LazilyLoadedCtor.java
index de9b76f0..b6e13be 100644
--- a/src/org/mozilla/javascript/LazilyLoadedCtor.java
+++ b/src/org/mozilla/javascript/LazilyLoadedCtor.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -16,8 +15,7 @@
  *
  * <p> This improves startup time and average memory usage.
  */
-public final class LazilyLoadedCtor implements Serializable {
-    private static final long serialVersionUID = 1L;
+public final class LazilyLoadedCtor {
     private static final int STATE_BEFORE_INIT = 0;
     private static final int STATE_INITIALIZING = 1;
     private static final int STATE_WITH_VALUE = 2;
diff --git a/src/org/mozilla/javascript/MemberBox.java b/src/org/mozilla/javascript/MemberBox.java
index 651a1c5..219e9d0 100644
--- a/src/org/mozilla/javascript/MemberBox.java
+++ b/src/org/mozilla/javascript/MemberBox.java
@@ -6,10 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Member;
@@ -24,10 +20,8 @@
  * @author Igor Bukanov
  */
 
-final class MemberBox implements Serializable
+final class MemberBox
 {
-    private static final long serialVersionUID = 6358550398665688245L;
-
     private transient Member memberObject;
     transient Class<?>[] argTypes;
     transient Object delegateTo;
@@ -218,74 +212,6 @@
         return null;
     }
 
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject();
-        Member member = readMember(in);
-        if (member instanceof Method) {
-            init((Method)member);
-        } else {
-            init((Constructor<?>)member);
-        }
-    }
-
-    private void writeObject(ObjectOutputStream out)
-        throws IOException
-    {
-        out.defaultWriteObject();
-        writeMember(out, memberObject);
-    }
-
-    /**
-     * Writes a Constructor or Method object.
-     *
-     * Methods and Constructors are not serializable, so we must serialize
-     * information about the class, the name, and the parameters and
-     * recreate upon deserialization.
-     */
-    private static void writeMember(ObjectOutputStream out, Member member)
-        throws IOException
-    {
-        if (member == null) {
-            out.writeBoolean(false);
-            return;
-        }
-        out.writeBoolean(true);
-        if (!(member instanceof Method || member instanceof Constructor))
-            throw new IllegalArgumentException("not Method or Constructor");
-        out.writeBoolean(member instanceof Method);
-        out.writeObject(member.getName());
-        out.writeObject(member.getDeclaringClass());
-        if (member instanceof Method) {
-            writeParameters(out, ((Method) member).getParameterTypes());
-        } else {
-            writeParameters(out, ((Constructor<?>) member).getParameterTypes());
-        }
-    }
-
-    /**
-     * Reads a Method or a Constructor from the stream.
-     */
-    private static Member readMember(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        if (!in.readBoolean())
-            return null;
-        boolean isMethod = in.readBoolean();
-        String name = (String) in.readObject();
-        Class<?> declaring = (Class<?>) in.readObject();
-        Class<?>[] parms = readParameters(in);
-        try {
-            if (isMethod) {
-                return declaring.getMethod(name, parms);
-            }
-            return declaring.getConstructor(parms);
-        } catch (NoSuchMethodException e) {
-            throw new IOException("Cannot find member: " + e);
-        }
-    }
-
     private static final Class<?>[] primitives = {
         Boolean.TYPE,
         Byte.TYPE,
@@ -297,52 +223,5 @@
         Short.TYPE,
         Void.TYPE
     };
-
-    /**
-     * Writes an array of parameter types to the stream.
-     *
-     * Requires special handling because primitive types cannot be
-     * found upon deserialization by the default Java implementation.
-     */
-    private static void writeParameters(ObjectOutputStream out, Class<?>[] parms)
-        throws IOException
-    {
-        out.writeShort(parms.length);
-    outer:
-        for (int i=0; i < parms.length; i++) {
-            Class<?> parm = parms[i];
-            boolean primitive = parm.isPrimitive();
-            out.writeBoolean(primitive);
-            if (!primitive) {
-                out.writeObject(parm);
-                continue;
-            }
-            for (int j=0; j < primitives.length; j++) {
-                if (parm.equals(primitives[j])) {
-                    out.writeByte(j);
-                    continue outer;
-                }
-            }
-            throw new IllegalArgumentException("Primitive " + parm +
-                                               " not found");
-        }
-    }
-
-    /**
-     * Reads an array of parameter types from the stream.
-     */
-    private static Class<?>[] readParameters(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        Class<?>[] result = new Class[in.readShort()];
-        for (int i=0; i < result.length; i++) {
-            if (!in.readBoolean()) {
-                result[i] = (Class<?>) in.readObject();
-                continue;
-            }
-            result[i] = primitives[in.readByte()];
-        }
-        return result;
-    }
 }
 
diff --git a/src/org/mozilla/javascript/NativeArray.java b/src/org/mozilla/javascript/NativeArray.java
index 34130d7..95caadb 100644
--- a/src/org/mozilla/javascript/NativeArray.java
+++ b/src/org/mozilla/javascript/NativeArray.java
@@ -8,7 +8,6 @@
 
 import static org.mozilla.javascript.ScriptRuntimeES6.requireObjectCoercible;
 
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -27,8 +26,6 @@
  */
 public class NativeArray extends IdScriptableObject implements List
 {
-    private static final long serialVersionUID = 7331366857676127338L;
-
     /*
      * Optimization possibilities and open issues:
      * - Long vs. double schizophrenia.  I suspect it might be better
@@ -2309,9 +2306,7 @@
     private static final Comparator<Object> DEFAULT_COMPARATOR = new ElementComparator();
 
     public static final class StringLikeComparator
-      implements Comparator<Object>, Serializable {
-
-      private static final long serialVersionUID = 5299017659728190979L;
+      implements Comparator<Object> {
 
       @Override
       public int compare(final Object x, final Object y) {
@@ -2322,9 +2317,7 @@
     }
 
     public static final class ElementComparator
-      implements Comparator<Object>, Serializable {
-
-      private static final long serialVersionUID = -1189948017688708858L;
+      implements Comparator<Object> {
 
       private final Comparator<Object> child;
 
diff --git a/src/org/mozilla/javascript/NativeError.java b/src/org/mozilla/javascript/NativeError.java
index 9a3c342..3ee6e81 100644
--- a/src/org/mozilla/javascript/NativeError.java
+++ b/src/org/mozilla/javascript/NativeError.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.lang.reflect.Method;
 
 /**
@@ -17,8 +16,6 @@
  */
 final class NativeError extends IdScriptableObject
 {
-    private static final long serialVersionUID = -5338413581437645187L;
-
     private static final Object ERROR_TAG = "Error";
 
     private static final Method ERROR_DELEGATE_GET_STACK;
@@ -354,7 +351,6 @@
      * that are "global." We can't make them static because there can be many contexts in the same JVM.
      */
     private static final class ProtoProps
-        implements Serializable
     {
         static final String KEY = "_ErrorPrototypeProps";
 
@@ -374,8 +370,6 @@
             }
         }
 
-        private static final long serialVersionUID = 1907180507775337939L;
-
         private int stackTraceLimit = DEFAULT_STACK_LIMIT;
         private Function prepareStackTrace;
 
diff --git a/src/org/mozilla/javascript/NativeGlobal.java b/src/org/mozilla/javascript/NativeGlobal.java
index 60a35d0..1b8de05 100644
--- a/src/org/mozilla/javascript/NativeGlobal.java
+++ b/src/org/mozilla/javascript/NativeGlobal.java
@@ -10,8 +10,6 @@
 import static org.mozilla.javascript.ScriptableObject.PERMANENT;
 import static org.mozilla.javascript.ScriptableObject.READONLY;
 
-import java.io.Serializable;
-
 import org.mozilla.javascript.xml.XMLLib;
 
 /**
@@ -23,10 +21,8 @@
  * @author Mike Shaver
  */
 
-public class NativeGlobal implements Serializable, IdFunctionCall
+public class NativeGlobal implements IdFunctionCall
 {
-    static final long serialVersionUID = 6080442165748707530L;
-
     public static void init(Context cx, Scriptable scope, boolean sealed) {
         NativeGlobal obj = new NativeGlobal();
 
diff --git a/src/org/mozilla/javascript/NativeJavaObject.java b/src/org/mozilla/javascript/NativeJavaObject.java
index 254e1c5..22d5170 100644
--- a/src/org/mozilla/javascript/NativeJavaObject.java
+++ b/src/org/mozilla/javascript/NativeJavaObject.java
@@ -6,10 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.lang.reflect.Array;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -28,10 +24,8 @@
  */
 
 public class NativeJavaObject
-    implements Scriptable, SymbolScriptable, Wrapper, Serializable
+    implements Scriptable, SymbolScriptable, Wrapper
 {
-    private static final long serialVersionUID = -6948590651130498591L;
-
     public NativeJavaObject() { }
 
     public NativeJavaObject(Scriptable scope, Object javaObject,
@@ -906,62 +900,6 @@
             JavaMembers.javaSignature(type));
     }
 
-    private void writeObject(ObjectOutputStream out)
-        throws IOException
-    {
-        out.defaultWriteObject();
-
-        out.writeBoolean(isAdapter);
-        if (isAdapter) {
-            if (adapter_writeAdapterObject == null) {
-                throw new IOException();
-            }
-            Object[] args = { javaObject, out };
-            try {
-                adapter_writeAdapterObject.invoke(null, args);
-            } catch (Exception ex) {
-                throw new IOException();
-            }
-        } else {
-            out.writeObject(javaObject);
-        }
-
-        if (staticType != null) {
-            out.writeObject(staticType.getName());
-        } else {
-            out.writeObject(null);
-        }
-    }
-
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject();
-
-        isAdapter = in.readBoolean();
-        if (isAdapter) {
-            if (adapter_readAdapterObject == null)
-                throw new ClassNotFoundException();
-            Object[] args = { this, in };
-            try {
-                javaObject = adapter_readAdapterObject.invoke(null, args);
-            } catch (Exception ex) {
-                throw new IOException();
-            }
-        } else {
-            javaObject = in.readObject();
-        }
-
-        String className = (String)in.readObject();
-        if (className != null) {
-            staticType = Class.forName(className);
-        } else {
-            staticType = null;
-        }
-
-        initMembers();
-    }
-
     /**
      * The prototype of this object.
      */
diff --git a/src/org/mozilla/javascript/NativeWith.java b/src/org/mozilla/javascript/NativeWith.java
index 52face4..c577417 100644
--- a/src/org/mozilla/javascript/NativeWith.java
+++ b/src/org/mozilla/javascript/NativeWith.java
@@ -6,17 +6,13 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
-
 /**
  * This class implements the object lookup required for the
  * <code>with</code> statement.
  * It simply delegates every action to its prototype except
  * for operations on its parent.
  */
-public class NativeWith implements Scriptable, SymbolScriptable, IdFunctionCall, Serializable {
-    private static final long serialVersionUID = 1L;
-
+public class NativeWith implements Scriptable, SymbolScriptable, IdFunctionCall {
     static void init(Scriptable scope, boolean sealed) {
         NativeWith obj = new NativeWith();
 
diff --git a/src/org/mozilla/javascript/ObjArray.java b/src/org/mozilla/javascript/ObjArray.java
index 0cee0d6..6e1c4ad 100644
--- a/src/org/mozilla/javascript/ObjArray.java
+++ b/src/org/mozilla/javascript/ObjArray.java
@@ -6,19 +6,12 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
 /**
 Implementation of resizable array with focus on minimizing memory usage by storing few initial array elements in object fields. Can also be used as a stack.
 */
 
-public class ObjArray implements Serializable
+public class ObjArray
 {
-    private static final long serialVersionUID = 4174889037736658296L;
-
     public ObjArray() { }
 
     public final boolean isSealed()
@@ -321,30 +314,6 @@
         throw new IllegalStateException("Attempt to modify sealed array");
     }
 
-    private void writeObject(ObjectOutputStream os) throws IOException
-    {
-        os.defaultWriteObject();
-        int N = size;
-        for (int i = 0; i != N; ++i) {
-            Object obj = getImpl(i);
-            os.writeObject(obj);
-        }
-    }
-
-    private void readObject(ObjectInputStream is)
-        throws IOException, ClassNotFoundException
-    {
-        is.defaultReadObject(); // It reads size
-        int N = size;
-        if (N > FIELDS_STORE_SIZE) {
-            data = new Object[N - FIELDS_STORE_SIZE];
-        }
-        for (int i = 0; i != N; ++i) {
-            Object obj = is.readObject();
-            setImpl(i, obj);
-        }
-    }
-
 // Number of data elements
     private int size;
 
diff --git a/src/org/mozilla/javascript/ObjToIntMap.java b/src/org/mozilla/javascript/ObjToIntMap.java
index 4362799..d464108 100644
--- a/src/org/mozilla/javascript/ObjToIntMap.java
+++ b/src/org/mozilla/javascript/ObjToIntMap.java
@@ -6,11 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
 /**
  * Map to associate objects to integers.
  * The map does not synchronize any of its operation, so either use
@@ -21,10 +16,8 @@
  *
  */
 
-public class ObjToIntMap implements Serializable
+public class ObjToIntMap
 {
-    private static final long serialVersionUID = -1542220580748809402L;
-
 // Map implementation via hashtable,
 // follows "The Art of Computer Programming" by Donald E. Knuth
 
@@ -389,42 +382,6 @@
         return index;
     }
 
-    private void writeObject(ObjectOutputStream out)
-        throws IOException
-    {
-        out.defaultWriteObject();
-
-        int count = keyCount;
-        for (int i = 0; count != 0; ++i) {
-            Object key = keys[i];
-            if (key != null && key != DELETED) {
-                --count;
-                out.writeObject(key);
-                out.writeInt(values[i]);
-            }
-        }
-    }
-
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject();
-
-        int writtenKeyCount = keyCount;
-        if (writtenKeyCount != 0) {
-            keyCount = 0;
-            int N = 1 << power;
-            keys = new Object[N];
-            values = new int[2 * N];
-            for (int i = 0; i != writtenKeyCount; ++i) {
-                Object key = in.readObject();
-                int hash = key.hashCode();
-                int index = insertNewKey(key, hash);
-                values[index] = in.readInt();
-            }
-        }
-    }
-
 // A == golden_ratio * (1 << 32) = ((sqrt(5) - 1) / 2) * (1 << 32)
 // See Knuth etc.
     private static final int A = 0x9e3779b9;
diff --git a/src/org/mozilla/javascript/Ref.java b/src/org/mozilla/javascript/Ref.java
index bc4dcf5..975637a 100644
--- a/src/org/mozilla/javascript/Ref.java
+++ b/src/org/mozilla/javascript/Ref.java
@@ -5,18 +5,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.javascript;
-
-import java.io.Serializable;
-
 /**
  * Generic notion of reference object that know how to query/modify the
  * target objects based on some property/index.
  */
-public abstract class Ref implements Serializable
+public abstract class Ref
 {
-
-    private static final long serialVersionUID = 4044540354730911424L;
-
     public boolean has(Context cx)
     {
         return true;
diff --git a/src/org/mozilla/javascript/ScriptRuntime.java b/src/org/mozilla/javascript/ScriptRuntime.java
index 8ad064c..2dc4086 100644
--- a/src/org/mozilla/javascript/ScriptRuntime.java
+++ b/src/org/mozilla/javascript/ScriptRuntime.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.text.MessageFormat;
 import java.util.Arrays;
@@ -2179,8 +2178,7 @@
      * to see if a given property has already been enumerated.
      *
      */
-    private static class IdEnumeration implements Serializable {
-        private static final long serialVersionUID = 1L;
+    private static class IdEnumeration {
         Scriptable obj;
         Object[] ids;
         ObjToIntMap used;
diff --git a/src/org/mozilla/javascript/ScriptStackElement.java b/src/org/mozilla/javascript/ScriptStackElement.java
index 96cabdd..f627460 100644
--- a/src/org/mozilla/javascript/ScriptStackElement.java
+++ b/src/org/mozilla/javascript/ScriptStackElement.java
@@ -4,18 +4,13 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
-
 /**
  * This class represents an element on the script execution stack.
  * @see RhinoException#getScriptStack()
  * @author Hannes Wallnoefer
  * @since 1.7R3
  */
-public final class ScriptStackElement implements Serializable {
-
-    private static final long serialVersionUID = -6416688260860477449L;
-
+public final class ScriptStackElement {
     public final String fileName;
     public final String functionName;
     public final int lineNumber;
diff --git a/src/org/mozilla/javascript/ScriptableObject.java b/src/org/mozilla/javascript/ScriptableObject.java
index d369a2f..98986d1 100644
--- a/src/org/mozilla/javascript/ScriptableObject.java
+++ b/src/org/mozilla/javascript/ScriptableObject.java
@@ -8,10 +8,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Constructor;
@@ -49,13 +45,9 @@
 
 public abstract class ScriptableObject implements Scriptable,
                                                   SymbolScriptable,
-                                                  Serializable,
                                                   DebuggableObject,
                                                   ConstProperties
 {
-
-    private static final long serialVersionUID = 2829861078851942586L;
-
     /**
      * The empty property attribute.
      *
@@ -146,9 +138,8 @@
      * This is the object that is stored in the SlotMap. For historical reasons it remains
      * inside this class. SlotMap references a number of members of this class directly.
      */
-    static class Slot implements Serializable
+    static class Slot
     {
-        private static final long serialVersionUID = -6090581677123995491L;
         Object name; // This can change due to caching
         int indexOrHash;
         private short attributes;
@@ -163,15 +154,6 @@
             this.attributes = (short)attributes;
         }
 
-        private void readObject(ObjectInputStream in)
-            throws IOException, ClassNotFoundException
-        {
-            in.defaultReadObject();
-            if (name != null) {
-                indexOrHash = name.hashCode();
-            }
-        }
-
         boolean setValue(Object value, Scriptable owner, Scriptable start) {
             if ((attributes & READONLY) != 0) {
                 if (Context.getContext().isStrictMode()) {
@@ -225,8 +207,6 @@
      */
     static final class GetterSlot extends Slot
     {
-        private static final long serialVersionUID = -4900574849788797588L;
-
         Object getter;
         Object setter;
 
@@ -2971,39 +2951,6 @@
         return result;
     }
 
-    private void writeObject(ObjectOutputStream out)
-        throws IOException
-    {
-        out.defaultWriteObject();
-        final long stamp = slotMap.readLock();
-        try {
-            int objectsCount = slotMap.dirtySize();
-            if (objectsCount == 0) {
-                out.writeInt(0);
-            } else {
-                out.writeInt(objectsCount);
-                for (Slot slot : slotMap) {
-                    out.writeObject(slot);
-                }
-            }
-        } finally {
-            slotMap.unlockRead(stamp);
-        }
-    }
-
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject();
-
-        int tableSize = in.readInt();
-        slotMap = createSlotMap(tableSize);
-        for (int i = 0; i < tableSize; i++) {
-            Slot slot = (Slot)in.readObject();
-            slotMap.addSlot(slot);
-        }
-    }
-
     protected ScriptableObject getOwnPropertyDescriptor(Context cx, Object id) {
         Slot slot = getSlot(cx, id, SlotAccess.QUERY);
         if (slot == null) return null;
@@ -3062,10 +3009,8 @@
      * method is defined to be stable.
      */
     public static final class KeyComparator
-        implements Comparator<Object>, Serializable
+        implements Comparator<Object>
     {
-        private static final long serialVersionUID = 6411335891523988149L;
-
         @Override
         public int compare(Object o1, Object o2)
         {
diff --git a/src/org/mozilla/javascript/SymbolKey.java b/src/org/mozilla/javascript/SymbolKey.java
index 3988fe6..412f774 100644
--- a/src/org/mozilla/javascript/SymbolKey.java
+++ b/src/org/mozilla/javascript/SymbolKey.java
@@ -1,7 +1,5 @@
 package org.mozilla.javascript;
 
-import java.io.Serializable;
-
 /**
  * A SymbolKey is one of the implementations of Symbol. It is really there
  * so that we can easily use pre-defined symbols as keys in native code.
@@ -10,10 +8,8 @@
  */
 
 public class SymbolKey
-    implements Symbol, Serializable
+    implements Symbol
 {
-    private static final long serialVersionUID = -6019782713330994754L;
-
     // These are common SymbolKeys that are equivalent to well-known symbols
     // defined in ECMAScript.
     public static final SymbolKey ITERATOR = new SymbolKey("Symbol.iterator");
diff --git a/src/org/mozilla/javascript/UintMap.java b/src/org/mozilla/javascript/UintMap.java
index 99ba12e..2f46dc0 100644
--- a/src/org/mozilla/javascript/UintMap.java
+++ b/src/org/mozilla/javascript/UintMap.java
@@ -6,11 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
 /**
  * Map to associate non-negative integers to objects or integers.
  * The map does not synchronize any of its operation, so either use
@@ -21,10 +16,8 @@
  *
  */
 
-public class UintMap implements Serializable
+public class UintMap
 {
-    private static final long serialVersionUID = 4242698212885848444L;
-
 // Map implementation via hashtable,
 // follows "The Art of Computer Programming" by Donald E. Knuth
 
@@ -333,72 +326,6 @@
         return index;
     }
 
-    private void writeObject(ObjectOutputStream out)
-        throws IOException
-    {
-        out.defaultWriteObject();
-
-        int count = keyCount;
-        if (count != 0) {
-            boolean hasIntValues = (ivaluesShift != 0);
-            boolean hasObjectValues = (values != null);
-            out.writeBoolean(hasIntValues);
-            out.writeBoolean(hasObjectValues);
-
-            for (int i = 0; count != 0; ++i) {
-                int key = keys[i];
-                if (key != EMPTY && key != DELETED) {
-                    --count;
-                    out.writeInt(key);
-                    if (hasIntValues) {
-                        out.writeInt(keys[ivaluesShift + i]);
-                    }
-                    if (hasObjectValues) {
-                        out.writeObject(values[i]);
-                    }
-                }
-            }
-        }
-    }
-
-    private void readObject(ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject();
-
-        int writtenKeyCount = keyCount;
-        if (writtenKeyCount != 0) {
-            keyCount = 0;
-            boolean hasIntValues = in.readBoolean();
-            boolean hasObjectValues = in.readBoolean();
-
-            int N = 1 << power;
-            if (hasIntValues) {
-                keys = new int[2 * N];
-                ivaluesShift = N;
-            }else {
-                keys = new int[N];
-            }
-            for (int i = 0; i != N; ++i) {
-                keys[i] = EMPTY;
-            }
-            if (hasObjectValues) {
-                values = new Object[N];
-            }
-            for (int i = 0; i != writtenKeyCount; ++i) {
-                int key = in.readInt();
-                int index = insertNewKey(key);
-                if (hasIntValues) {
-                    int ivalue = in.readInt();
-                    keys[ivaluesShift + index] = ivalue;
-                }
-                if (hasObjectValues) {
-                    values[index] = in.readObject();
-                }
-            }
-        }
-    }
-
 // A == golden_ratio * (1 << 32) = ((sqrt(5) - 1) / 2) * (1 << 32)
 // See Knuth etc.
     private static final int A = 0x9e3779b9;
diff --git a/src/org/mozilla/javascript/Undefined.java b/src/org/mozilla/javascript/Undefined.java
index bdd7b2e..6318629 100644
--- a/src/org/mozilla/javascript/Undefined.java
+++ b/src/org/mozilla/javascript/Undefined.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
@@ -14,10 +13,8 @@
 /**
  * This class implements the Undefined value in JavaScript.
  */
-public class Undefined implements Serializable
+public class Undefined
 {
-    private static final long serialVersionUID = 9195680630202616767L;
-
     public static final Object instance = new Undefined();
 
     private Undefined()
diff --git a/src/org/mozilla/javascript/UniqueTag.java b/src/org/mozilla/javascript/UniqueTag.java
index 8982246..f20d513 100644
--- a/src/org/mozilla/javascript/UniqueTag.java
+++ b/src/org/mozilla/javascript/UniqueTag.java
@@ -6,8 +6,6 @@
 
 package org.mozilla.javascript;
 
-import java.io.Serializable;
-
 /**
  * Class instances represent serializable tags to mark special Object values.
  * <p>
@@ -17,10 +15,8 @@
  * ObjectInputStream would not restore them correctly as it lacks support
  * for readResolve method
  */
-public final class UniqueTag implements Serializable
+public final class UniqueTag
 {
-    private static final long serialVersionUID = -4320556826714577259L;
-
     private static final int ID_NOT_FOUND    = 1;
     private static final int ID_NULL_VALUE   = 2;
     private static final int ID_DOUBLE_MARK  = 3;
diff --git a/src/org/mozilla/javascript/ast/AstNode.java b/src/org/mozilla/javascript/ast/AstNode.java
index 4abd755..d40e7fb 100644
--- a/src/org/mozilla/javascript/ast/AstNode.java
+++ b/src/org/mozilla/javascript/ast/AstNode.java
@@ -6,7 +6,6 @@
 
 package org.mozilla.javascript.ast;
 
-import java.io.Serializable;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
@@ -131,8 +130,7 @@
         operatorNames.put(Token.VOID, "void");
     }
 
-    public static class PositionComparator implements Comparator<AstNode>, Serializable {
-        private static final long serialVersionUID = 1L;
+    public static class PositionComparator implements Comparator<AstNode> {
        /**
          * Sorts nodes by (relative) start position.  The start positions are
          * relative to their parent, so this comparator is only meaningful for
diff --git a/src/org/mozilla/javascript/commonjs/module/ModuleScript.java b/src/org/mozilla/javascript/commonjs/module/ModuleScript.java
index 128153c..62ff670 100644
--- a/src/org/mozilla/javascript/commonjs/module/ModuleScript.java
+++ b/src/org/mozilla/javascript/commonjs/module/ModuleScript.java
@@ -4,7 +4,6 @@
 
 package org.mozilla.javascript.commonjs.module;
 
-import java.io.Serializable;
 import java.net.URI;
 
 import org.mozilla.javascript.Script;
@@ -16,7 +15,7 @@
  * @author Attila Szegedi
  * @version $Id: ModuleScript.java,v 1.3 2011/04/07 20:26:11 hannes%helma.at Exp $
  */
-public class ModuleScript implements Serializable {
+public class ModuleScript {
     private static final long serialVersionUID = 1L;
     private final Script script;
     private final URI uri;
diff --git a/src/org/mozilla/javascript/commonjs/module/RequireBuilder.java b/src/org/mozilla/javascript/commonjs/module/RequireBuilder.java
index 74d2f1f..464782c 100644
--- a/src/org/mozilla/javascript/commonjs/module/RequireBuilder.java
+++ b/src/org/mozilla/javascript/commonjs/module/RequireBuilder.java
@@ -4,8 +4,6 @@
 
 package org.mozilla.javascript.commonjs.module;
 
-import java.io.Serializable;
-
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Script;
 import org.mozilla.javascript.Scriptable;
@@ -20,8 +18,7 @@
  * @author Attila Szegedi
  * @version $Id: RequireBuilder.java,v 1.4 2011/04/07 20:26:11 hannes%helma.at Exp $
  */
-public class RequireBuilder implements Serializable {
-    private static final long serialVersionUID = 1L;
+public class RequireBuilder {
     private boolean sandboxed = true;
     private ModuleScriptProvider moduleScriptProvider;
     private Script preExec;
diff --git a/src/org/mozilla/javascript/commonjs/module/provider/CachingModuleScriptProviderBase.java b/src/org/mozilla/javascript/commonjs/module/provider/CachingModuleScriptProviderBase.java
index 7985222..cc36b25 100644
--- a/src/org/mozilla/javascript/commonjs/module/provider/CachingModuleScriptProviderBase.java
+++ b/src/org/mozilla/javascript/commonjs/module/provider/CachingModuleScriptProviderBase.java
@@ -5,7 +5,6 @@
 package org.mozilla.javascript.commonjs.module.provider;
 
 import java.io.Reader;
-import java.io.Serializable;
 import java.net.URI;
 
 import org.mozilla.javascript.Context;
@@ -23,8 +22,7 @@
  * @author Attila Szegedi
  * @version $Id: CachingModuleScriptProviderBase.java,v 1.3 2011/04/07 20:26:12 hannes%helma.at Exp $
  */
-public abstract class CachingModuleScriptProviderBase implements ModuleScriptProvider, Serializable {
-    private static final long serialVersionUID = -1L;
+public abstract class CachingModuleScriptProviderBase implements ModuleScriptProvider {
     private static final int loadConcurrencyLevel = Runtime.getRuntime().availableProcessors() * 8;
     private static final int loadLockShift;
     private static final int loadLockMask;
diff --git a/src/org/mozilla/javascript/commonjs/module/provider/ModuleSource.java b/src/org/mozilla/javascript/commonjs/module/provider/ModuleSource.java
index 8a4a88d..36bc126 100644
--- a/src/org/mozilla/javascript/commonjs/module/provider/ModuleSource.java
+++ b/src/org/mozilla/javascript/commonjs/module/provider/ModuleSource.java
@@ -5,7 +5,6 @@
 package org.mozilla.javascript.commonjs.module.provider;
 
 import java.io.Reader;
-import java.io.Serializable;
 import java.net.URI;
 
 /**
@@ -30,8 +29,7 @@
  * @author Attila Szegedi
  * @version $Id: ModuleSource.java,v 1.3 2011/04/07 20:26:12 hannes%helma.at Exp $
  */
-public class ModuleSource implements Serializable {
-    private static final long serialVersionUID = 1L;
+public class ModuleSource {
     private final Reader reader;
     private final Object securityDomain;
     private final URI uri;
diff --git a/src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProviderBase.java b/src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProviderBase.java
index 00236f8..9ef52aa 100644
--- a/src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProviderBase.java
+++ b/src/org/mozilla/javascript/commonjs/module/provider/ModuleSourceProviderBase.java
@@ -6,7 +6,6 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.Serializable;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -26,9 +25,7 @@
  * @author Attila Szegedi
  * @version $Id: ModuleSourceProviderBase.java,v 1.3 2011/04/07 20:26:12 hannes%helma.at Exp $
  */
-public abstract class ModuleSourceProviderBase implements ModuleSourceProvider, Serializable {
-    private static final long serialVersionUID = 1L;
-
+public abstract class ModuleSourceProviderBase implements ModuleSourceProvider {
     @Override
     public ModuleSource loadSource(String moduleId, Scriptable paths,
             Object validator) throws IOException, URISyntaxException
diff --git a/src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java b/src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java
index 65e6e71..cff1f03 100644
--- a/src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java
+++ b/src/org/mozilla/javascript/commonjs/module/provider/StrongCachingModuleScriptProvider.java
@@ -19,7 +19,6 @@
  */
 public class StrongCachingModuleScriptProvider extends CachingModuleScriptProviderBase {
 
-    private static final long serialVersionUID = 1L;
     private final Map<String, CachedModuleScript> modules = new ConcurrentHashMap<String, CachedModuleScript>(16, .75f, getConcurrencyLevel());
 
     /**
diff --git a/src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java b/src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java
index d50ccd5..4f0b5da 100644
--- a/src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java
+++ b/src/org/mozilla/javascript/commonjs/module/provider/UrlModuleSourceProvider.java
@@ -32,7 +32,6 @@
  * @version $Id: UrlModuleSourceProvider.java,v 1.4 2011/04/07 20:26:12 hannes%helma.at Exp $
  */
 public class UrlModuleSourceProvider extends ModuleSourceProviderBase {
-    private static final long serialVersionUID = 1L;
     private final Iterable<URI> privilegedUris;
     private final Iterable<URI> fallbackUris;
     private final UrlConnectionSecurityDomainProvider urlConnectionSecurityDomainProvider;
diff --git a/src/org/mozilla/javascript/regexp/NativeRegExp.java b/src/org/mozilla/javascript/regexp/NativeRegExp.java
index 3e3d172..81568d4 100644
--- a/src/org/mozilla/javascript/regexp/NativeRegExp.java
+++ b/src/org/mozilla/javascript/regexp/NativeRegExp.java
@@ -6,8 +6,6 @@
 
 package org.mozilla.javascript.regexp;
 
-import java.io.Serializable;
-
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.IdFunctionObject;
@@ -37,8 +35,6 @@
 
 public class NativeRegExp extends IdScriptableObject implements Function
 {
-    private static final long serialVersionUID = 4965263491464903264L;
-
     private static final Object REGEXP_TAG = new Object();
 
     public static final int JSREG_GLOB = 0x1;       // 'g' flag: global
@@ -340,7 +336,6 @@
         regexp.program = new byte[state.progLength + 1];
         if (state.classCount != 0) {
             regexp.classList = new RECharSet[state.classCount];
-            regexp.classCount = state.classCount;
         }
         int endPC = emitREBytecode(state, regexp, 0, state.result);
         regexp.program[endPC++] = REOP_END;
@@ -2783,15 +2778,12 @@
 
 }       // class NativeRegExp
 
-class RECompiled implements Serializable
+class RECompiled
 {
-    private static final long serialVersionUID = -6144956577595844213L;
-
     final char[] source;    /* locked source string, sans // */
     int parenCount;         /* number of parenthesized submatches */
     int flags;              /* flags  */
     byte[] program;         /* regular expression bytecode */
-    int classCount;         /* count [...] bitmaps */
     RECharSet[] classList;  /* list of [...] bitmaps */
     int anchorCh = -1;      /* if >= 0, then re starts with this literal char */
 
@@ -2963,10 +2955,8 @@
  * use of the class converts the source representation into a bitmap.
  *
  */
-final class RECharSet implements Serializable
+final class RECharSet
 {
-    private static final long serialVersionUID = 7931787979395898394L;
-
     RECharSet(int length, int startIndex, int strlength, boolean sense)
     {
         this.length = length;
diff --git a/src/org/mozilla/javascript/serialize/ScriptableInputStream.java b/src/org/mozilla/javascript/serialize/ScriptableInputStream.java
deleted file mode 100644
index ac02da8..0000000
--- a/src/org/mozilla/javascript/serialize/ScriptableInputStream.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// API class
-
-package org.mozilla.javascript.serialize;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectStreamClass;
-
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.Undefined;
-import org.mozilla.javascript.UniqueTag;
-
-/**
- * Class ScriptableInputStream is used to read in a JavaScript
- * object or function previously serialized with a ScriptableOutputStream.
- * References to names in the exclusion list
- * replaced with references to the top-level scope specified during
- * creation of the ScriptableInputStream.
- *
- * @author Norris Boyd
- */
-
-public class ScriptableInputStream extends ObjectInputStream {
-
-    /**
-     * Create a ScriptableInputStream.
-     * @param in the InputStream to read from.
-     * @param scope the top-level scope to create the object in.
-     */
-    public ScriptableInputStream(InputStream in, Scriptable scope)
-        throws IOException
-    {
-        super(in);
-        this.scope = scope;
-        enableResolveObject(true);
-        Context cx = Context.getCurrentContext();
-        if (cx != null) {
-            this.classLoader = cx.getApplicationClassLoader();
-        }
-    }
-
-    @Override
-    protected Class<?> resolveClass(ObjectStreamClass desc)
-        throws IOException, ClassNotFoundException
-    {
-        String name = desc.getName();
-        if (classLoader != null) {
-            try {
-                return classLoader.loadClass(name);
-            } catch (ClassNotFoundException ex) {
-                // fall through to default loading
-            }
-        }
-        return super.resolveClass(desc);
-    }
-
-    @Override
-    protected Object resolveObject(Object obj)
-        throws IOException
-    {
-        if (obj instanceof ScriptableOutputStream.PendingLookup) {
-            String name = ((ScriptableOutputStream.PendingLookup)obj).getName();
-            obj = ScriptableOutputStream.lookupQualifiedName(scope, name);
-            if (obj == Scriptable.NOT_FOUND) {
-                throw new IOException("Object " + name + " not found upon " +
-                                      "deserialization.");
-            }
-        }else if (obj instanceof UniqueTag) {
-            obj = ((UniqueTag)obj).readResolve();
-        }else if (obj instanceof Undefined) {
-            obj = ((Undefined)obj).readResolve();
-        }
-        return obj;
-    }
-
-    private Scriptable scope;
-    private ClassLoader classLoader;
-}
diff --git a/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java b/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java
deleted file mode 100644
index 0fdf985..0000000
--- a/src/org/mozilla/javascript/serialize/ScriptableOutputStream.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.javascript.serialize;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.ScriptableObject;
-import org.mozilla.javascript.UniqueTag;
-
-/**
- * Class ScriptableOutputStream is an ObjectOutputStream used
- * to serialize JavaScript objects and functions. Note that
- * compiled functions currently cannot be serialized, only
- * interpreted functions. The top-level scope containing the
- * object is not written out, but is instead replaced with
- * another top-level object when the ScriptableInputStream
- * reads in this object. Also, object corresponding to names
- * added to the exclude list are not written out but instead
- * are looked up during deserialization. This approach avoids
- * the creation of duplicate copies of standard objects
- * during deserialization.
- *
- * @author Norris Boyd
- */
-
-// API class
-
-public class ScriptableOutputStream extends ObjectOutputStream {
-
-    /**
-     * ScriptableOutputStream constructor.
-     * Creates a ScriptableOutputStream for use in serializing
-     * JavaScript objects. Calls excludeStandardObjectNames.
-     *
-     * @param out the OutputStream to write to.
-     * @param scope the scope containing the object.
-     */
-    public ScriptableOutputStream(OutputStream out, Scriptable scope)
-        throws IOException
-    {
-        super(out);
-        this.scope = scope;
-        table = new HashMap<Object,String>();
-        table.put(scope, "");
-        enableReplaceObject(true);
-        excludeStandardObjectNames(); // XXX
-    }
-
-    public void excludeAllIds(Object[] ids) {
-        for (Object id: ids) {
-            if (id instanceof String &&
-                (scope.get((String) id, scope) instanceof Scriptable))
-            {
-                this.addExcludedName((String)id);
-            }
-        }
-    }
-
-    /**
-     * Adds a qualified name to the list of object to be excluded from
-     * serialization. Names excluded from serialization are looked up
-     * in the new scope and replaced upon deserialization.
-     * @param name a fully qualified name (of the form "a.b.c", where
-     *             "a" must be a property of the top-level object). The object
-     *             need not exist, in which case the name is ignored.
-     * @throws IllegalArgumentException if the object is not a
-     *         {@link Scriptable}.
-     */
-    public void addOptionalExcludedName(String name) {
-        Object obj = lookupQualifiedName(scope, name);
-        if(obj != null && obj != UniqueTag.NOT_FOUND) {
-            if (!(obj instanceof Scriptable)) {
-                throw new IllegalArgumentException(
-                        "Object for excluded name " + name +
-                        " is not a Scriptable, it is " +
-                        obj.getClass().getName());
-            }
-            table.put(obj, name);
-        }
-    }
-
-    /**
-     * Adds a qualified name to the list of objects to be excluded from
-     * serialization. Names excluded from serialization are looked up
-     * in the new scope and replaced upon deserialization.
-     * @param name a fully qualified name (of the form "a.b.c", where
-     *             "a" must be a property of the top-level object)
-     * @throws IllegalArgumentException if the object is not found or is not
-     *         a {@link Scriptable}.
-     */
-    public void addExcludedName(String name) {
-        Object obj = lookupQualifiedName(scope, name);
-        if (!(obj instanceof Scriptable)) {
-            throw new IllegalArgumentException("Object for excluded name " +
-                                               name + " not found.");
-        }
-        table.put(obj, name);
-    }
-
-    /**
-     * Returns true if the name is excluded from serialization.
-     */
-    public boolean hasExcludedName(String name) {
-        return table.get(name) != null;
-    }
-
-    /**
-     * Removes a name from the list of names to exclude.
-     */
-    public void removeExcludedName(String name) {
-        table.remove(name);
-    }
-
-    /**
-     * Adds the names of the standard objects and their
-     * prototypes to the list of excluded names.
-     */
-    public void excludeStandardObjectNames() {
-        String[] names = { "Object", "Object.prototype",
-                           "Function", "Function.prototype",
-                           "String", "String.prototype",
-                           "Math",  // no Math.prototype
-                           "Array", "Array.prototype",
-                           "Error", "Error.prototype",
-                           "Number", "Number.prototype",
-                           "Date", "Date.prototype",
-                           "RegExp", "RegExp.prototype",
-                           "Script", "Script.prototype",
-                           "Continuation", "Continuation.prototype",
-                         };
-        for (int i=0; i < names.length; i++) {
-            addExcludedName(names[i]);
-        }
-
-        String[] optionalNames = {
-                "XML", "XML.prototype",
-                "XMLList", "XMLList.prototype",
-        };
-        for (int i=0; i < optionalNames.length; i++) {
-            addOptionalExcludedName(optionalNames[i]);
-        }
-    }
-
-    static Object lookupQualifiedName(Scriptable scope,
-                                      String qualifiedName)
-    {
-        StringTokenizer st = new StringTokenizer(qualifiedName, ".");
-        Object result = scope;
-        while (st.hasMoreTokens()) {
-            String s = st.nextToken();
-            result = ScriptableObject.getProperty((Scriptable)result, s);
-            if (result == null || !(result instanceof Scriptable))
-                break;
-        }
-        return result;
-    }
-
-    static class PendingLookup implements Serializable
-    {
-        private static final long serialVersionUID = -2692990309789917727L;
-
-        PendingLookup(String name) { this.name = name; }
-
-        String getName() { return name; }
-
-        private String name;
-    }
-
-    @Override
-    protected Object replaceObject(Object obj) throws IOException
-    {
-        if (false) throw new IOException(); // suppress warning
-        String name = table.get(obj);
-        if (name == null)
-            return obj;
-        return new PendingLookup(name);
-    }
-
-    private Scriptable scope;
-    private Map<Object,String> table;
-}
diff --git a/testsrc/doctests/442922.doctest b/testsrc/doctests/442922.doctest
deleted file mode 100644
index b729ee2..0000000
--- a/testsrc/doctests/442922.doctest
+++ /dev/null
@@ -1,12 +0,0 @@
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-js> var x = <blah x="asdf"><a a="asdf"/></blah>;
-js> serialize(x, "x.ser");
-js> deserialize("x.ser");
-<blah x="asdf">
-  <a a="asdf"/>
-</blah>
-js> (new java.io.File("x.ser"))["delete"]();
-true
\ No newline at end of file
diff --git a/testsrc/doctests/serialize.doctest b/testsrc/doctests/serialize.doctest
deleted file mode 100644
index f6d1f1c..0000000
--- a/testsrc/doctests/serialize.doctest
+++ /dev/null
@@ -1,14 +0,0 @@
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-js> var obj = { a:3, b:"hi", 9:"nine", 12:1200 };
-js> serialize(obj, "foo.bin");
-js> obj2 = deserialize("foo.bin");
-[object Object]
-js> uneval(obj)
-({a:3, b:"hi", 9:"nine", 12:1200})
-js> uneval(obj2)
-({a:3, b:"hi", 9:"nine", 12:1200})
-js> (new java.io.File("foo.bin"))["delete"]();
-true
diff --git a/testsrc/org/mozilla/javascript/tests/ContinuationsApiTest.java b/testsrc/org/mozilla/javascript/tests/ContinuationsApiTest.java
index 8e206a3..dcc5cd44 100644
--- a/testsrc/org/mozilla/javascript/tests/ContinuationsApiTest.java
+++ b/testsrc/org/mozilla/javascript/tests/ContinuationsApiTest.java
@@ -6,22 +6,12 @@
 
 package org.mozilla.javascript.tests;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-
-import org.mozilla.javascript.ConsString;
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.ContinuationPending;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.Script;
 import org.mozilla.javascript.Scriptable;
 import org.mozilla.javascript.WrappedException;
-import org.mozilla.javascript.serialize.ScriptableInputStream;
-import org.mozilla.javascript.serialize.ScriptableOutputStream;
 
 import junit.framework.TestCase;
 
@@ -36,9 +26,7 @@
 public class ContinuationsApiTest extends TestCase {
   Scriptable globalScope;
 
-  public static class MyClass implements Serializable {
-
-    private static final long serialVersionUID = 4189002778806232070L;
+  public static class MyClass {
 
     public int f(int a) {
         Context cx = Context.enter();
@@ -207,173 +195,4 @@
           Context.exit();
       }
   }
-
-  public void testSerializationWithContinuations()
-      throws IOException, ClassNotFoundException
-  {
-      Context cx = Context.enter();
-      try {
-          cx.setOptimizationLevel(-1); // must use interpreter mode
-          cx.evaluateString(globalScope,
-                  "function f(a) { var k = myObject.f(a); var t = []; return k; }",
-                  "function test source", 1, null);
-          Function f = (Function) globalScope.get("f", globalScope);
-          Object[] args = { 7 };
-          cx.callFunctionWithContinuations(f, globalScope, args);
-          fail("Should throw ContinuationPending");
-      } catch (ContinuationPending pending) {
-          // serialize
-          ByteArrayOutputStream baos = new ByteArrayOutputStream();
-          ScriptableOutputStream sos = new ScriptableOutputStream(baos, globalScope);
-          sos.writeObject(globalScope);
-          sos.writeObject(pending.getContinuation());
-          sos.close();
-          baos.close();
-          byte[] serializedData = baos.toByteArray();
-
-          // deserialize
-          ByteArrayInputStream bais = new ByteArrayInputStream(serializedData);
-          ScriptableInputStream sis = new ScriptableInputStream(bais, globalScope);
-          globalScope = (Scriptable) sis.readObject();
-          Object continuation = sis.readObject();
-          sis.close();
-          bais.close();
-
-          Object result = cx.resumeContinuation(continuation, globalScope, 8);
-          assertEquals(8, ((Number)result).intValue());
-      } finally {
-          Context.exit();
-      }
-  }
-
-  public void testContinuationsPrototypesAndSerialization() throws IOException, ClassNotFoundException {
-
-      byte[] serializedData = null;
-
-      {
-          Scriptable globalScope;
-          Context cx = Context.enter();
-          try {
-              globalScope = cx.initStandardObjects();
-              cx.setOptimizationLevel(-1); // must use interpreter mode
-              globalScope.put("myObject", globalScope, Context.javaToJS(new MyClass(), globalScope));
-          } finally {
-              Context.exit();
-          }
-
-          cx = Context.enter();
-          try {
-              cx.setOptimizationLevel(-1); // must use interpreter mode
-              cx.evaluateString(
-                      globalScope,
-                      "function f(a) { Number.prototype.blargh = function() {return 'foo';}; var k = myObject.f(a); var t = []; return new Number(8).blargh(); }",
-                      "function test source", 1, null);
-              Function f = (Function) globalScope.get("f", globalScope);
-              Object[] args = { 7 };
-              cx.callFunctionWithContinuations(f, globalScope, args);
-              fail("Should throw ContinuationPending");
-          } catch (ContinuationPending pending) {
-              // serialize
-              ByteArrayOutputStream baos = new ByteArrayOutputStream();
-              ObjectOutputStream sos = new ObjectOutputStream(baos);
-              sos.writeObject(globalScope);
-              sos.writeObject(pending.getContinuation());
-              sos.close();
-              baos.close();
-              serializedData = baos.toByteArray();
-          } finally {
-              Context.exit();
-          }
-      }
-
-      {
-          try {
-              Context cx = Context.enter();
-
-              Scriptable globalScope;
-
-              // deserialize
-              ByteArrayInputStream bais = new ByteArrayInputStream(serializedData);
-              ObjectInputStream sis = new ObjectInputStream(bais);
-              globalScope = (Scriptable) sis.readObject();
-              Object continuation = sis.readObject();
-              sis.close();
-              bais.close();
-
-              Object result = cx.resumeContinuation(continuation, globalScope, 8);
-              assertEquals("foo", result);
-          } finally {
-              Context.exit();
-          }
-      }
-
-  }
-
-  public void testContinuationsInlineFunctionsSerialization() throws IOException, ClassNotFoundException {
-
-      Scriptable globalScope;
-      Context cx = Context.enter();
-      try {
-          globalScope = cx.initStandardObjects();
-          cx.setOptimizationLevel(-1); // must use interpreter mode
-          globalScope.put("myObject", globalScope, Context.javaToJS(new MyClass(), globalScope));
-      } finally {
-          Context.exit();
-      }
-
-      cx = Context.enter();
-      try {
-          cx.setOptimizationLevel(-1); // must use interpreter mode
-          cx.evaluateString(globalScope, "function f(a) { var k = eval(myObject.h()); var t = []; return k; }",
-                  "function test source", 1, null);
-          Function f = (Function) globalScope.get("f", globalScope);
-          Object[] args = { 7 };
-          cx.callFunctionWithContinuations(f, globalScope, args);
-          fail("Should throw ContinuationPending");
-      } catch (ContinuationPending pending) {
-          // serialize
-          ByteArrayOutputStream baos = new ByteArrayOutputStream();
-          ScriptableOutputStream sos = new ScriptableOutputStream(baos, globalScope);
-          sos.writeObject(globalScope);
-          sos.writeObject(pending.getContinuation());
-          sos.close();
-          baos.close();
-          byte[] serializedData = baos.toByteArray();
-
-          // deserialize
-          ByteArrayInputStream bais = new ByteArrayInputStream(serializedData);
-          ScriptableInputStream sis = new ScriptableInputStream(bais, globalScope);
-          globalScope = (Scriptable) sis.readObject();
-          Object continuation = sis.readObject();
-          sis.close();
-          bais.close();
-
-          Object result = cx.resumeContinuation(continuation, globalScope, "2+3");
-          assertEquals(5, ((Number) result).intValue());
-      } finally {
-          Context.exit();
-      }
-  }
-
-  public void testConsStringSerialization() throws IOException, ClassNotFoundException {
-      
-      ConsString r1 = new ConsString("foo", "bar");
-      
-      ByteArrayOutputStream baos = new ByteArrayOutputStream();
-      ObjectOutputStream oos = new ObjectOutputStream(baos);
-      
-      oos.writeObject(r1);
-      
-      oos.flush();
-      
-      ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-      
-      ObjectInputStream ois = new ObjectInputStream(bais);
-      
-      CharSequence r2 = (CharSequence) ois.readObject();
-      
-      assertEquals("still the same at the other end", r1.toString(), r2.toString());
-      
-  }
-
 }
diff --git a/testsrc/org/mozilla/javascript/tests/es6/CollectionHashtableTest.java b/testsrc/org/mozilla/javascript/tests/es6/CollectionHashtableTest.java
index 9b39348..2ce1f11 100644
--- a/testsrc/org/mozilla/javascript/tests/es6/CollectionHashtableTest.java
+++ b/testsrc/org/mozilla/javascript/tests/es6/CollectionHashtableTest.java
@@ -10,18 +10,12 @@
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
 import java.util.Iterator;
 
 import org.junit.Before;
 import org.junit.Test;
 import org.mozilla.javascript.Hashtable;
 import org.mozilla.javascript.Hashtable.Entry;
-import org.mozilla.javascript.Undefined;
 
 /**
  * These are some tests for the Hashtable implementation that's used by the collection
@@ -248,73 +242,4 @@
     assertEquals("bb", e.key());
     assertFalse(i.hasNext());
   }
-
-  /**
-   * Test serialization of an empty object.
-   */
-  @Test
-  public void testEmptySerialization()
-      throws IOException, ClassNotFoundException {
-
-    ByteArrayOutputStream bos = new ByteArrayOutputStream();
-    ObjectOutputStream oout = new ObjectOutputStream(bos);
-    oout.writeObject(ht);
-    oout.close();
-
-    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-    ObjectInputStream oin = new ObjectInputStream(bis);
-    Hashtable sht = (Hashtable)oin.readObject();
-    assertEquals(0, sht.size());
-  }
-
-  /**
-   * Test serialization of a non-empty object with a bunch of different data types,
-   * including the iteration order.
-   */
-  @Test
-  public void testSerialization()
-      throws IOException, ClassNotFoundException {
-
-    ht.put("one", 1);
-    ht.put("two", 2);
-    ht.put("three", 3);
-    ht.put(Undefined.instance, "undefined");
-    ht.put("undefined", Undefined.instance);
-    ht.put(null, "null");
-    ht.put("null", null);
-
-    ByteArrayOutputStream bos = new ByteArrayOutputStream();
-    ObjectOutputStream oout = new ObjectOutputStream(bos);
-    oout.writeObject(ht);
-    oout.close();
-
-    ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-    ObjectInputStream oin = new ObjectInputStream(bis);
-    Hashtable sht = (Hashtable)oin.readObject();
-
-    assertEquals(1, sht.get("one"));
-    assertEquals(2, sht.get("two"));
-    assertEquals(3, sht.get("three"));
-    assertEquals(Undefined.instance, sht.get("undefined"));
-    assertEquals("undefined", sht.get(Undefined.instance));
-    assertNull(sht.get("null"));
-    assertEquals("null", sht.get(null));
-
-    Iterator<Entry> i = ht.iterator();
-    Hashtable.Entry e = i.next();
-    assertEquals("one", e.key());
-    e = i.next();
-    assertEquals("two", e.key());
-    e = i.next();
-    assertEquals("three", e.key());
-    e = i.next();
-    assertEquals(Undefined.instance, e.key());
-    e = i.next();
-    assertEquals("undefined", e.key());
-    e = i.next();
-    assertNull(e.key());
-    e = i.next();
-    assertEquals("null", e.key());
-    assertFalse(i.hasNext());
-  }
 }
diff --git a/testsrc/org/mozilla/javascript/tests/es6/NativeArrayIteratorTest.java b/testsrc/org/mozilla/javascript/tests/es6/NativeArrayIteratorTest.java
deleted file mode 100644
index 83a6cfa..0000000
--- a/testsrc/org/mozilla/javascript/tests/es6/NativeArrayIteratorTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.javascript.tests.es6;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.mozilla.javascript.Context;
-import org.mozilla.javascript.NativeArrayIterator;
-import org.mozilla.javascript.NativeArrayIterator.ARRAY_ITERATOR_TYPE;
-import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.tools.shell.Global;
-
-public class NativeArrayIteratorTest
-{
-    private Context cx;
-    private Scriptable root;
-
-    @Before
-    public void init()
-    {
-        cx = Context.enter();
-        cx.setLanguageVersion(Context.VERSION_ES6);
-        cx.setGeneratingDebug(true);
-
-        Global global = new Global(cx);
-        root = cx.newObject(global);
-    }
-
-    @After
-    public void terminate()
-    {
-        Context.exit();
-    }
-
-    /**
-     * Test serialization of an empty object.
-     */
-    @Test
-    public void testSerialization()
-        throws IOException, ClassNotFoundException {
-
-        NativeArrayIterator iter = new NativeArrayIterator(root, null, ARRAY_ITERATOR_TYPE.VALUES);
-
-        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
-                ObjectOutputStream oout = new ObjectOutputStream(bos)) {
-            oout.writeObject(iter);
-
-            try (ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-                    ObjectInputStream oin = new ObjectInputStream(bis)) {
-                NativeArrayIterator result = (NativeArrayIterator)oin.readObject();
-                assertEquals(0, result.getIds().length);
-            }
-        }
-    }
-}
diff --git a/testsrc/org/mozilla/javascript/tests/es6/NativeWeakMap2Test.java b/testsrc/org/mozilla/javascript/tests/es6/NativeWeakMap2Test.java
deleted file mode 100644
index 50c8f44..0000000
--- a/testsrc/org/mozilla/javascript/tests/es6/NativeWeakMap2Test.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.javascript.tests.es6;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.junit.Test;
-import org.mozilla.javascript.NativeWeakMap;
-
-public class NativeWeakMap2Test
-{
-
-    /**
-     * Test serialization of an empty object.
-     */
-    @Test
-    public void testSerialization()
-        throws IOException, ClassNotFoundException {
-
-        NativeWeakMap weakMap = new NativeWeakMap();
-
-        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
-                ObjectOutputStream oout = new ObjectOutputStream(bos)) {
-            oout.writeObject(weakMap);
-
-            try (ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-                    ObjectInputStream oin = new ObjectInputStream(bis)) {
-                NativeWeakMap result = (NativeWeakMap)oin.readObject();
-                assertEquals(0, result.getIds().length);
-            }
-        }
-    }
-}
diff --git a/testsrc/org/mozilla/javascript/tests/es6/NativeWeakSet2Test.java b/testsrc/org/mozilla/javascript/tests/es6/NativeWeakSet2Test.java
deleted file mode 100644
index ae1d399..0000000
--- a/testsrc/org/mozilla/javascript/tests/es6/NativeWeakSet2Test.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.javascript.tests.es6;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.junit.Test;
-import org.mozilla.javascript.NativeWeakSet;
-
-public class NativeWeakSet2Test
-{
-
-    /**
-     * Test serialization of an empty object.
-     */
-    @Test
-    public void testSerialization()
-        throws IOException, ClassNotFoundException {
-
-        NativeWeakSet weakSet = new NativeWeakSet();
-
-        try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
-                ObjectOutputStream oout = new ObjectOutputStream(bos)) {
-            oout.writeObject(weakSet);
-
-            try (ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
-                    ObjectInputStream oin = new ObjectInputStream(bis)) {
-                NativeWeakSet result = (NativeWeakSet)oin.readObject();
-                assertEquals(0, result.getIds().length);
-            }
-        }
-    }
-}
diff --git a/toolsrc/org/mozilla/javascript/tools/shell/Global.java b/toolsrc/org/mozilla/javascript/tools/shell/Global.java
index e3c4df1..bdad80a 100644
--- a/toolsrc/org/mozilla/javascript/tools/shell/Global.java
+++ b/toolsrc/org/mozilla/javascript/tools/shell/Global.java
@@ -11,11 +11,9 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.io.ObjectInputStream;
 import java.io.OutputStream;
 import java.io.PrintStream;
 import java.io.Reader;
@@ -51,8 +49,6 @@
 import org.mozilla.javascript.commonjs.module.RequireBuilder;
 import org.mozilla.javascript.commonjs.module.provider.SoftCachingModuleScriptProvider;
 import org.mozilla.javascript.commonjs.module.provider.UrlModuleSourceProvider;
-import org.mozilla.javascript.serialize.ScriptableInputStream;
-import org.mozilla.javascript.serialize.ScriptableOutputStream;
 import org.mozilla.javascript.tools.ToolErrorReporter;
 
 /**
@@ -63,8 +59,6 @@
  */
 public class Global extends ImporterTopLevel
 {
-    static final long serialVersionUID = 4029130780977538005L;
-
     NativeArray history;
     boolean attemptedJLineLoad;
     private ShellConsole console;
@@ -118,7 +112,6 @@
         initStandardObjects(cx, sealedStdLib);
         String[] names = {
             "defineClass",
-            "deserialize",
             "doctest",
             "gc",
             "help",
@@ -131,7 +124,6 @@
             "readUrl",
             "runCommand",
             "seal",
-            "serialize",
             "spawn",
             "sync",
             "toint32",
@@ -377,41 +369,6 @@
         }
     }
 
-    public static void serialize(Context cx, Scriptable thisObj,
-                                 Object[] args, Function funObj)
-        throws IOException
-    {
-        if (args.length < 2) {
-            throw Context.reportRuntimeError(
-                "Expected an object to serialize and a filename to write " +
-                "the serialization to");
-        }
-        Object obj = args[0];
-        String filename = Context.toString(args[1]);
-        FileOutputStream fos = new FileOutputStream(filename);
-        Scriptable scope = ScriptableObject.getTopLevelScope(thisObj);
-        ScriptableOutputStream out = new ScriptableOutputStream(fos, scope);
-        out.writeObject(obj);
-        out.close();
-    }
-
-    public static Object deserialize(Context cx, Scriptable thisObj,
-                                     Object[] args, Function funObj)
-        throws IOException, ClassNotFoundException
-    {
-        if (args.length < 1) {
-            throw Context.reportRuntimeError(
-                "Expected a filename to read the serialization from");
-        }
-        String filename = Context.toString(args[0]);
-        FileInputStream fis = new FileInputStream(filename);
-        Scriptable scope = ScriptableObject.getTopLevelScope(thisObj);
-        ObjectInputStream in = new ScriptableInputStream(fis, scope);
-        Object deserialized = in.readObject();
-        in.close();
-        return Context.toObject(deserialized, scope);
-    }
-
     public String[] getPrompts(Context cx) {
         if (ScriptableObject.hasProperty(this, "prompts")) {
             Object promptsJS = ScriptableObject.getProperty(this,
diff --git a/toolsrc/org/mozilla/javascript/tools/shell/Main.java b/toolsrc/org/mozilla/javascript/tools/shell/Main.java
index 2bf173b..efb9cf1 100644
--- a/toolsrc/org/mozilla/javascript/tools/shell/Main.java
+++ b/toolsrc/org/mozilla/javascript/tools/shell/Main.java
@@ -711,7 +711,6 @@
     }
 
     static class ScriptCache extends LinkedHashMap<String, ScriptReference> {
-        private static final long serialVersionUID = -6866856136258508615L;
         ReferenceQueue<Script> queue;
         int capacity;
 
diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
index d29cd07..5ce72c3 100644
--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
+++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
@@ -6,8 +6,6 @@
 
 package org.mozilla.javascript.xmlimpl;
 
-import java.io.Serializable;
-
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.Kit;
 import org.mozilla.javascript.Node;
@@ -20,13 +18,11 @@
 import org.mozilla.javascript.xml.XMLObject;
 import org.xml.sax.SAXException;
 
-public final class XMLLibImpl extends XMLLib implements Serializable {
+public final class XMLLibImpl extends XMLLib {
 
     //
     //    EXPERIMENTAL Java interface
     //
-   
-    private static final long serialVersionUID = 1L;
 
     /**
       This experimental interface is undocumented.
diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
index 8d69145..4e252da 100644
--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
+++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
@@ -4,7 +4,6 @@
 
 package org.mozilla.javascript.xmlimpl;
 
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -20,9 +19,8 @@
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.UserDataHandler;
 
-class XmlNode implements Serializable {
-    private static final long serialVersionUID = 1L;
-    
+class XmlNode {
+
     private static final String XML_NAMESPACES_NAMESPACE_URI = "http://www.w3.org/2000/xmlns/";
     
     private static final String USER_DATA_XMLNODE_KEY = XmlNode.class.getName();
@@ -305,9 +303,7 @@
         return getNamespaceDeclaration(dom.getPrefix());
     }
 
-    static class XmlNodeUserDataHandler implements UserDataHandler, Serializable {
-        private static final long serialVersionUID = 4666895518900769588L;
-
+    static class XmlNodeUserDataHandler implements UserDataHandler {
         public void handle(short operation, String key, Object data, Node src, Node dest) {
         }
     }
@@ -559,13 +555,7 @@
         }
     }
 
-    static class Namespace implements Serializable {
-
-        /**
-         * Serial version id for Namespace with fields prefix and uri
-         */
-        private static final long serialVersionUID = 4073904386884677090L;
-
+    static class Namespace {
         static Namespace create(String prefix, String uri) {
             if (prefix == null) {
                 throw new IllegalArgumentException(
@@ -644,9 +634,7 @@
     }
 
     //    TODO    Where is this class used?  No longer using it in QName implementation
-    static class QName implements Serializable {
-        private static final long serialVersionUID = -6587069811691451077L;
-
+    static class QName {
         static QName create(Namespace namespace, String localName) {
             //    A null namespace indicates a wild-card match for any namespace
             //    A null localName indicates "*" from the point of view of ECMA357
@@ -764,8 +752,7 @@
         }
     }
 
-    static class InternalList implements Serializable {
-        private static final long serialVersionUID = -3633151157292048978L;
+    static class InternalList {
         private List<XmlNode> list;
 
         InternalList() {
diff --git a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java
index 0f19ded..dd5e5c8 100644
--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java
+++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java
@@ -6,7 +6,6 @@
 
 import java.io.IOException;
 import java.io.ObjectInputStream;
-import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.LinkedBlockingDeque;
@@ -31,9 +30,7 @@
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.SAXParseException;
 
-class XmlProcessor implements Serializable {
-
-    private static final long serialVersionUID = 6903514433204808713L;
+class XmlProcessor {
 
     private boolean ignoreComments;
     private boolean ignoreProcessingInstructions;
@@ -124,7 +121,7 @@
         }
     }
 
-    private static class RhinoSAXErrorHandler implements ErrorHandler, Serializable {
+    private static class RhinoSAXErrorHandler implements ErrorHandler {
 
         private static final long serialVersionUID = 6918417235413084055L;