hotspot/src/share/vm/compiler/abstractCompiler.hpp
changeset 22236 44508442b8da
parent 22234 da823d78ad65
child 31962 d05e0a4d1b43
--- a/hotspot/src/share/vm/compiler/abstractCompiler.hpp	Mon Jan 06 15:35:20 2014 -0800
+++ b/hotspot/src/share/vm/compiler/abstractCompiler.hpp	Mon Jan 06 17:23:07 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2014, Oracle and/or its affiliates. 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
@@ -40,8 +40,19 @@
   // This thread will initialize the compiler runtime.
   bool should_perform_init();
 
+  // The (closed set) of concrete compiler classes.
+  enum Type {
+    none,
+    c1,
+    c2,
+    shark
+  };
+
+ private:
+  Type _type;
+
  public:
-  AbstractCompiler() : _compiler_state(uninitialized), _num_compiler_threads(0) {}
+  AbstractCompiler(Type type) : _type(type), _compiler_state(uninitialized), _num_compiler_threads(0) {}
 
   // This function determines the compiler thread that will perform the
   // shutdown of the corresponding compiler runtime.
@@ -54,27 +65,11 @@
   virtual bool supports_native()                 { return true; }
   virtual bool supports_osr   ()                 { return true; }
   virtual bool can_compile_method(methodHandle method)  { return true; }
-#if defined(TIERED) || ( !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK))
-  virtual bool is_c1   ()                        { return false; }
-  virtual bool is_c2   ()                        { return false; }
-  virtual bool is_shark()                        { return false; }
-#else
-#ifdef COMPILER1
-  bool is_c1   ()                                { return true; }
-  bool is_c2   ()                                { return false; }
-  bool is_shark()                                { return false; }
-#endif // COMPILER1
-#ifdef COMPILER2
-  bool is_c1   ()                                { return false; }
-  bool is_c2   ()                                { return true; }
-  bool is_shark()                                { return false; }
-#endif // COMPILER2
-#ifdef SHARK
-  bool is_c1   ()                                { return false; }
-  bool is_c2   ()                                { return false; }
-  bool is_shark()                                { return true; }
-#endif // SHARK
-#endif // TIERED
+
+  // Compiler type queries.
+  bool is_c1()                                   { return _type == c1; }
+  bool is_c2()                                   { return _type == c2; }
+  bool is_shark()                                { return _type == shark; }
 
   // Customization
   virtual void initialize () = 0;