src/share/vm/compiler/methodMatcher.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/methodMatcher.hpp

Print this page
rev 9032 : 8137167: JEP165: Compiler Control: Implementation task
Summary: Compiler Control JEP
Reviewed-by: roland, twisti


  64   void print_base(outputStream* st);
  65 
  66  private:
  67   static bool canonicalize(char * line, const char *& error_msg);
  68   bool match(Symbol* candidate, Symbol* match, Mode match_mode) const;
  69 };
  70 
  71 class BasicMatcher : public MethodMatcher {
  72 private:
  73   BasicMatcher* _next;
  74 public:
  75 
  76   BasicMatcher() : MethodMatcher(),
  77     _next(NULL) {
  78   }
  79 
  80   BasicMatcher(BasicMatcher* next) :
  81     _next(next) {
  82   }
  83 
  84   static BasicMatcher* parse_method_pattern(char* line, const char*& error_msg) {
  85     assert(error_msg == NULL, "Dont call here with error_msg already set");
  86     BasicMatcher* bm = new BasicMatcher();
  87     MethodMatcher::parse_method_pattern(line, error_msg, bm);
  88     if (error_msg != NULL) {
  89       delete bm;
  90       return NULL;
  91     }
  92 
  93     // check for bad trailing characters
  94     int bytes_read = 0;
  95     sscanf(line, "%*[ \t]%n", &bytes_read);
  96     if (line[bytes_read] != '\0') {
  97       error_msg = "Unrecognized trailing text after method pattern";
  98       delete bm;
  99       return NULL;
 100     }
 101     return bm;
 102   }
 103 
 104   bool match(methodHandle method) {
 105     for (BasicMatcher* current = this; current != NULL; current = current->next()) {
 106       if (current->matches(method)) {
 107         return true;
 108       }
 109     }
 110     return false;
 111   }
 112 
 113   void set_next(BasicMatcher* next) { _next = next; }
 114   BasicMatcher* next() { return _next; }
 115 
 116   void print(outputStream* st) { print_base(st); }
 117   void print_all(outputStream* st) {
 118     print_base(st);
 119     if (_next != NULL) {
 120       _next->print_all(st);
 121     }
 122   }




























 123 };
 124 
 125 #endif // SHARE_VM_COMPILER_METHODMATCHER_HPP
 126 


  64   void print_base(outputStream* st);
  65 
  66  private:
  67   static bool canonicalize(char * line, const char *& error_msg);
  68   bool match(Symbol* candidate, Symbol* match, Mode match_mode) const;
  69 };
  70 
  71 class BasicMatcher : public MethodMatcher {
  72 private:
  73   BasicMatcher* _next;
  74 public:
  75 
  76   BasicMatcher() : MethodMatcher(),
  77     _next(NULL) {
  78   }
  79 
  80   BasicMatcher(BasicMatcher* next) :
  81     _next(next) {
  82   }
  83 
  84   static BasicMatcher* parse_method_pattern(char* line, const char*& error_msg);
  85   bool match(methodHandle method);



























  86   void set_next(BasicMatcher* next) { _next = next; }
  87   BasicMatcher* next() { return _next; }
  88 
  89   void print(outputStream* st) { print_base(st); }
  90   void print_all(outputStream* st) {
  91     print_base(st);
  92     if (_next != NULL) {
  93       _next->print_all(st);
  94     }
  95   }
  96 };
  97 
  98 class InlineMatcher : public MethodMatcher {
  99 public:
 100   enum InlineType {
 101       unknown_inline,
 102       dont_inline,
 103       force_inline
 104     };
 105 
 106 private:
 107   InlineType _inline_action;
 108   InlineMatcher * _next;
 109 
 110   InlineMatcher() : MethodMatcher(),
 111     _inline_action(unknown_inline), _next(NULL) {
 112   }
 113 
 114 public:
 115   static InlineMatcher* parse_method_pattern(char* line, const char*& error_msg);
 116   bool match(methodHandle method, int inline_action);
 117   void print(outputStream* st);
 118   void set_next(InlineMatcher* next) { _next = next; }
 119   InlineMatcher* next() { return _next; }
 120   void set_action(InlineType inline_action) { _inline_action = inline_action; }
 121   int inline_action() { return _inline_action; }
 122   static InlineMatcher* parse_inline_pattern(char* line, const char*& error_msg);
 123   InlineMatcher* clone();
 124 };
 125 
 126 #endif // SHARE_VM_COMPILER_METHODMATCHER_HPP
 127 
src/share/vm/compiler/methodMatcher.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File