comparison src/share/vm/graal/graalRuntime.hpp @ 21516:fe4a77bec5b7

Use GraalRuntime::parse_lines in GraalRuntime::parse_graal_options_file
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Thu, 07 May 2015 16:59:34 +0200
parents 1ab7802d35c9
children cecb4e39521c
comparison
equal deleted inserted replaced
21515:1ab7802d35c9 21516:fe4a77bec5b7
27 #include "interpreter/interpreter.hpp" 27 #include "interpreter/interpreter.hpp"
28 #include "memory/allocation.hpp" 28 #include "memory/allocation.hpp"
29 #include "runtime/deoptimization.hpp" 29 #include "runtime/deoptimization.hpp"
30 30
31 class ParseClosure : public StackObj { 31 class ParseClosure : public StackObj {
32 protected:
33 int _lineNo;
34 char* _filename;
35 bool _abort;
36 void abort() { _abort = true; }
37 void warn_and_abort(const char* message) {
38 warning("Error at line %d while parsing %s: %s", _lineNo, _filename == NULL ? "?" : _filename, message);
39 abort();
40 }
32 public: 41 public:
42 ParseClosure() : _lineNo(0), _filename(NULL) {}
43 void parse_line(char* line) {
44 _lineNo++;
45 do_line(line);
46 }
33 virtual void do_line(char* line) = 0; 47 virtual void do_line(char* line) = 0;
48 int lineNo() { return _lineNo; }
49 bool is_aborted() { return _abort; }
50 void set_filename(char* path) {_filename = path; }
34 }; 51 };
35 52
36 class GraalRuntime: public CHeapObj<mtCompiler> { 53 class GraalRuntime: public CHeapObj<mtCompiler> {
37 private: 54 private:
38 55
65 * line in this file must have the format of a Graal command line option without the 82 * line in this file must have the format of a Graal command line option without the
66 * leading "-G:" prefix. These option values are set prior to processing of any Graal 83 * leading "-G:" prefix. These option values are set prior to processing of any Graal
67 * options present on the command line. 84 * options present on the command line.
68 */ 85 */
69 static void parse_graal_options_file(KlassHandle hotSpotOptionsClass, TRAPS); 86 static void parse_graal_options_file(KlassHandle hotSpotOptionsClass, TRAPS);
70
71 /**
72 * Parses a given argument and sets the denoted Graal option.
73 *
74 * @throws InternalError if there was a problem parsing or setting the option
75 */
76 static void parse_argument(KlassHandle hotSpotOptionsClass, char* arg, TRAPS);
77 87
78 /** 88 /**
79 * Searches for a Boolean Graal option denoted by a given name and sets it value. 89 * Searches for a Boolean Graal option denoted by a given name and sets it value.
80 * 90 *
81 * The definition of this method is in graalRuntime.inline.hpp 91 * The definition of this method is in graalRuntime.inline.hpp
130 static void check_generated_sources_sha1(TRAPS); 140 static void check_generated_sources_sha1(TRAPS);
131 141
132 public: 142 public:
133 143
134 /** 144 /**
145 * Parses a given argument and sets the denoted Graal option.
146 *
147 * @throws InternalError if there was a problem parsing or setting the option
148 */
149 static void parse_argument(KlassHandle hotSpotOptionsClass, char* arg, TRAPS);
150
151 /**
135 * Ensures that the Graal class loader is initialized and the well known Graal classes are loaded. 152 * Ensures that the Graal class loader is initialized and the well known Graal classes are loaded.
136 */ 153 */
137 static void ensure_graal_class_loader_is_initialized(); 154 static void ensure_graal_class_loader_is_initialized();
138 155
139 static void initialize_natives(JNIEnv *env, jclass c2vmClass); 156 static void initialize_natives(JNIEnv *env, jclass c2vmClass);
180 * The definition of this method is in graalRuntime.inline.hpp 197 * The definition of this method is in graalRuntime.inline.hpp
181 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp. 198 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp.
182 */ 199 */
183 static Handle get_service_impls(KlassHandle serviceKlass, TRAPS); 200 static Handle get_service_impls(KlassHandle serviceKlass, TRAPS);
184 201
185 static void parse_lines(char* path, ParseClosure* closure, TRAPS); 202 static void parse_lines(char* path, ParseClosure* closure, bool warnStatFailure, TRAPS);
186 203
187 /** 204 /**
188 * Aborts the VM due to an unexpected exception. 205 * Aborts the VM due to an unexpected exception.
189 */ 206 */
190 static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); 207 static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false);