equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
46 "string", |
46 "string", |
47 "string list", |
47 "string list", |
48 "unknown" |
48 "unknown" |
49 }; |
49 }; |
50 |
50 |
|
51 class DirectivesParserTest; |
|
52 |
51 class DirectivesParser : public JSON { |
53 class DirectivesParser : public JSON { |
52 public: |
54 friend class DirectivesParserTest; |
|
55 public: |
53 static bool has_file(); |
56 static bool has_file(); |
54 static bool parse_from_flag(); |
57 static bool parse_from_flag(); |
55 static bool parse_from_file(const char* filename, outputStream* st); |
58 static bool parse_from_file(const char* filename, outputStream* st); |
56 static int parse_string(const char* string, outputStream* st); |
59 static int parse_string(const char* string, outputStream* st); |
57 int install_directives(); |
60 int install_directives(); |
58 |
61 |
59 private: |
62 private: |
60 DirectivesParser(const char* text, outputStream* st, bool silent); |
63 DirectivesParser(const char* text, outputStream* st, bool silent); |
61 ~DirectivesParser(); |
64 ~DirectivesParser(); |
62 |
65 |
63 bool callback(JSON_TYPE t, JSON_VAL* v, uint level); |
66 bool callback(JSON_TYPE t, JSON_VAL* v, uint level); |
64 static bool parse_from_file_inner(const char* filename, outputStream* st); |
67 static bool parse_from_file_inner(const char* filename, outputStream* st); |
132 CompilerDirectives* pop_tmp(); |
135 CompilerDirectives* pop_tmp(); |
133 CompilerDirectives* _tmp_top; // temporary storage for dirs while parsing |
136 CompilerDirectives* _tmp_top; // temporary storage for dirs while parsing |
134 int _tmp_depth; // Number of directives that has been parsed but not installed. |
137 int _tmp_depth; // Number of directives that has been parsed but not installed. |
135 |
138 |
136 static uint mask(keytype kt); |
139 static uint mask(keytype kt); |
137 |
|
138 #ifndef PRODUCT |
|
139 static void test(const char* json, bool valid); |
|
140 public: |
|
141 static void test(); |
|
142 #endif |
|
143 }; |
140 }; |
144 |
141 |
145 #endif // SHARE_VM_COMPILER_DIRECTIVESPARSER_HPP |
142 #endif // SHARE_VM_COMPILER_DIRECTIVESPARSER_HPP |