Commits

Anonymous committed 872f335

LowMemoryWatch is not being used, removing.

Comments (0)

Files changed (3)

src/share/classes/com/sun/tools/javac/comp/Enter.java

     JavaFileManager fileManager;
     PkgInfo pkginfoOpt;
     
-    private final LowMemoryWatch memoryWatch;
     private final LazyTreeLoader treeLoader;
     private final DuplicateClassChecker duplicateClassChecker;
     private final Source source;
         annotate = Annotate.instance(context);
         lint = Lint.instance(context);
         names = Names.instance(context);
-        memoryWatch = LowMemoryWatch.instance(context);
         treeLoader = LazyTreeLoader.instance(context);
         duplicateClassChecker = context.get(DuplicateClassChecker.class);
 
             Type t = classEnter(l.head, env);
             if (t != null)
                 ts.append(t);
-            memoryWatch.abortIfMemoryLow();
         }
         return ts.toList();
     }
                     else
                         // defer
                         prevUncompleted.append(clazz);
-                    memoryWatch.abortIfMemoryLow();
                 }
 
                 // if there remain any unimported toplevels (these must have
                         Env<AttrContext> topEnv = topLevelEnv(tree);
                         memberEnter.memberEnter(tree, topEnv);
                         log.useSource(prev);
-                        memoryWatch.abortIfMemoryLow();
                     }
                 }
             }

src/share/classes/com/sun/tools/javac/main/JavaCompiler.java

 
     protected FlowListener flowListener;
     
-    protected LowMemoryWatch memoryWatch;
-
     /**
      * Annotation processing may require and provide a new instance
      * of the compiler to be used for the analyze and generate phases.
         memberEnter = MemberEnter.instance(context);
         todo = Todo.instance(context);
         flowListener = FlowListener.instance(context);
-        memoryWatch = LowMemoryWatch.instance(context);
 
         fileManager = context.get(JavaFileManager.class);
         parserFactory = ParserFactory.instance(context);
                 filesSoFar.add(fileObject);
                 trees.append(parse(fileObject));
             }
-            memoryWatch.abortIfMemoryLow();
         }
         return trees.toList();
     }
         ListBuffer<Env<AttrContext>> results = lb();
         while (!envs.isEmpty()) {
             results.append(attribute(envs.remove()));
-            memoryWatch.abortIfMemoryLow();
         }
         return stopIfError(CompileState.ATTR, results);
     }
         ListBuffer<Env<AttrContext>> results = lb();
         for (Env<AttrContext> env: envs) {
             flow(env, results);
-            memoryWatch.abortIfMemoryLow();
         }
         return stopIfError(CompileState.FLOW, results);
     }
         ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = lb();
         for (Env<AttrContext> env: envs) {
             desugar(env, results);
-            memoryWatch.abortIfMemoryLow();
         }
         return stopIfError(CompileState.FLOW, results);
     }
             }
 
             taskFinished(new TaskEvent(TaskEvent.Kind.GENERATE, env.toplevel, cdef.sym));
-            
-            memoryWatch.abortIfMemoryLow();
         }
     }
 

src/share/classes/com/sun/tools/javac/util/LowMemoryWatch.java

-/*
- * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package com.sun.tools.javac.util;
-
-/**
- *
- * @author Dusan Balek
- */
-public class LowMemoryWatch {
-    
-    /** The context key for the low memory watch. */
-    protected static final Context.Key<LowMemoryWatch> lowMemoryWatchKey =
-        new Context.Key<LowMemoryWatch>();
-
-    public static LowMemoryWatch instance(Context context) {
-        LowMemoryWatch instance = context.get(lowMemoryWatchKey);
-        if (instance == null) {
-            instance = new LowMemoryWatch();
-            context.put(lowMemoryWatchKey, instance);
-        }
-        return instance;
-    }
-
-    protected LowMemoryWatch() {
-    }
-
-    public final void abortIfMemoryLow () {
-        if (isMemoryLow()) {
-            throw new MemoryLowAbort();
-        }
-    }
-
-    protected boolean isMemoryLow() {
-        return false;
-    }
-}