comparison src/share/vm/graal/graalRuntime.hpp @ 16270:d56a09df1a1f

implemented eager checking of Graal options (GRAAL-807)
author Doug Simon <doug.simon@oracle.com>
date Fri, 27 Jun 2014 19:55:54 +0200
parents 66a9286203a2
children d6ffc6164830
comparison
equal deleted inserted replaced
16269:f5437f2db322 16270:d56a09df1a1f
43 43
44 /** 44 /**
45 * Parses the string form of a numeric, float or double option into a jlong (using raw bits for floats/doubles). 45 * Parses the string form of a numeric, float or double option into a jlong (using raw bits for floats/doubles).
46 * 46 *
47 * @param spec 'i', 'f' or 'd' (see HotSpotOptions.setOption()) 47 * @param spec 'i', 'f' or 'd' (see HotSpotOptions.setOption())
48 * @param name name option option 48 * @param name option name
49 * @param name_len length of option name
49 * @param value string value to parse 50 * @param value string value to parse
50 * @throws InternalError if value could not be parsed according to spec 51 * @throws InternalError if value could not be parsed according to spec
51 */ 52 */
52 static jlong parse_primitive_option_value(char spec, Handle name, const char* value, TRAPS); 53 static jlong parse_primitive_option_value(char spec, const char* name, int name_len, const char* value, TRAPS);
53 54
54 /** 55 /**
55 * Loads default option value overrides from a <jre_home>/lib/graal.options if it exists. Each 56 * Loads default option value overrides from a <jre_home>/lib/graal.options if it exists. Each
56 * line in this file must have the format of a Graal command line option without the 57 * line in this file must have the format of a Graal command line option without the
57 * leading "-G:" prefix. These option values are set prior to processing of any Graal 58 * leading "-G:" prefix. These option values are set prior to processing of any Graal
70 * Searches for a Graal option denoted by a given name and sets it value. 71 * Searches for a Graal option denoted by a given name and sets it value.
71 * 72 *
72 * The definition of this method is in graalRuntime.inline.hpp 73 * The definition of this method is in graalRuntime.inline.hpp
73 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp. 74 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp.
74 * 75 *
76 * @param hotSpotOptionsClass the HotSpotOptions klass or NULL if only checking for valid option
77 * @param name option name
78 * @param name_len length of option name
75 * @returns true if the option was found 79 * @returns true if the option was found
76 * @throws InternalError if there was a problem setting the option's value 80 * @throws InternalError if there was a problem setting the option's value
77 */ 81 */
78 static bool set_option(KlassHandle hotSpotOptionsClass, const char* name, int name_len, Handle name_handle, const char* value, TRAPS); 82 static bool set_option(KlassHandle hotSpotOptionsClass, char* name, int name_len, const char* value, TRAPS);
83
84 /**
85 * Raises an InternalError for an option that expects a value but was specified without a "=<value>" prefix.
86 */
87 static void check_required_value(const char* name, int name_len, const char* value, TRAPS);
79 88
80 /** 89 /**
81 * Java call to HotSpotOptions.setOption(String name, OptionValue<?> option, char spec, String stringValue, long primitiveValue) 90 * Java call to HotSpotOptions.setOption(String name, OptionValue<?> option, char spec, String stringValue, long primitiveValue)
82 */ 91 *
83 static void set_option_helper(KlassHandle hotSpotOptionsClass, Handle name, Handle option, jchar spec, Handle stringValue, jlong primitiveValue); 92 * @param name option name
93 * @param name_len length of option name
94 */
95 static void set_option_helper(KlassHandle hotSpotOptionsClass, char* name, int name_len, Handle option, jchar spec, Handle stringValue, jlong primitiveValue);
84 96
85 /** 97 /**
86 * Instantiates a service object, calls its default constructor and returns it. 98 * Instantiates a service object, calls its default constructor and returns it.
87 * 99 *
88 * @param name the name of a class implementing com.oracle.graal.api.runtime.Service 100 * @param name the name of a class implementing com.oracle.graal.api.runtime.Service
130 142
131 static Klass* load_required_class(Symbol* name); 143 static Klass* load_required_class(Symbol* name);
132 144
133 static BufferBlob* initialize_buffer_blob(); 145 static BufferBlob* initialize_buffer_blob();
134 146
147 /**
148 * Checks that all Graal specific VM options presented by the launcher are recognized
149 * and formatted correctly. To set relevant Java fields from the option, parse_arguments()
150 * must be called. This method makes no Java calls apart from creating exception objects
151 * if there is an errors in the Graal options.
152 */
153 static jint check_arguments(TRAPS);
154
155 /**
156 * Parses the Graal specific VM options that were presented by the launcher and sets
157 * the relevants Java fields.
158 */
135 static bool parse_arguments(KlassHandle hotSpotOptionsClass, TRAPS); 159 static bool parse_arguments(KlassHandle hotSpotOptionsClass, TRAPS);
136 160
137 static BasicType kindToBasicType(jchar ch); 161 static BasicType kindToBasicType(jchar ch);
138 static address create_external_deopt_i2c(); 162 static address create_external_deopt_i2c();
139 static address get_external_deopt_i2c_entry() {return _external_deopt_i2c_entry;} 163 static address get_external_deopt_i2c_entry() {return _external_deopt_i2c_entry;}