Class JavaScriptCore
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Like jsc_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final int
Like jsc_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final int
Like jsc_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.static final String
Allows the DFG JIT to be used iftrue
.static final String
Allows the FTL JIT to be used iftrue
.static final String
Allows the executable pages to be allocated for JIT and thunks iftrue
.static final String
Allows the LLINT to be used iftrue
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the major version number of the JavaScriptCore library.static int
Returns the micro version number of the JavaScriptCore library.static int
Returns the minor version number of the JavaScriptCore library.static void
static void
optionsForeach
(OptionsFunc function) Iterates all available options callingfunction
for each one.static boolean
optionsGetBoolean
(String option, Out<Boolean> value) Getoption
as agboolean
value.static boolean
optionsGetDouble
(String option, Out<Double> value) Getoption
as agdouble
value.static boolean
optionsGetInt
(String option, Out<Integer> value) Getoption
as agint
value.static OptionGroup
Create aGOptionGroup
to handle JSCOptions as command line arguments.static boolean
optionsGetRangeString
(String option, Out<String> value) Getoption
as a range string.static boolean
optionsGetSize
(String option, Out<Long> value) Getoption
as agsize
value.static boolean
optionsGetString
(String option, Out<String> value) Getoption
as a string.static boolean
optionsGetUint
(String option, Out<Integer> value) Getoption
as aguint
value.static boolean
optionsSetBoolean
(String option, boolean value) Setoption
as agboolean
value.static boolean
optionsSetDouble
(String option, double value) Setoption
as agdouble
value.static boolean
optionsSetInt
(String option, int value) Setoption
as agint
value.static boolean
optionsSetRangeString
(String option, String value) Setoption
as a range string.static boolean
optionsSetSize
(String option, long value) Setoption
as agsize
value.static boolean
optionsSetString
(String option, String value) Setoption
as a string.static boolean
optionsSetUint
(String option, int value) Setoption
as aguint
value.
-
Field Details
-
MAJOR_VERSION
public static final int MAJOR_VERSIONLike jsc_get_major_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
MICRO_VERSION
public static final int MICRO_VERSIONLike jsc_get_micro_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
MINOR_VERSION
public static final int MINOR_VERSIONLike jsc_get_minor_version(), but from the headers used at application compile time, rather than from the library linked against at application run time.- See Also:
-
OPTIONS_USE_DFG
- See Also:
-
OPTIONS_USE_FTL
- See Also:
-
OPTIONS_USE_JIT
Allows the executable pages to be allocated for JIT and thunks iftrue
. Option type:OptionType.BOOLEAN
Default value:true
.- See Also:
-
OPTIONS_USE_LLINT
- See Also:
-
-
Constructor Details
-
JavaScriptCore
public JavaScriptCore()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
getMajorVersion
Returns the major version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 1.)This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the
JSC_MAJOR_VERSION
macro, which represents the major version of the JavaScriptCore headers you have included when compiling your code.- Returns:
- the major version number of the JavaScriptCore library
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
getMicroVersion
Returns the micro version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 3.)This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the
JSC_MICRO_VERSION
macro, which represents the micro version of the JavaScriptCore headers you have included when compiling your code.- Returns:
- the micro version number of the JavaScriptCore library
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
getMinorVersion
Returns the minor version number of the JavaScriptCore library. (e.g. in JavaScriptCore version 1.8.3 this is 8.)This function is in the library, so it represents the JavaScriptCore library your code is running against. Contrast with the
JSC_MINOR_VERSION
macro, which represents the minor version of the JavaScriptCore headers you have included when compiling your code.- Returns:
- the minor version number of the JavaScriptCore library
- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsForeach
Iterates all available options callingfunction
for each one. Iteration can stop early iffunction
returnsfalse
.- Parameters:
function
- aJSCOptionsFunc
callback- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetBoolean
public static boolean optionsGetBoolean(String option, Out<Boolean> value) throws UnsupportedPlatformException Getoption
as agboolean
value.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetDouble
public static boolean optionsGetDouble(String option, Out<Double> value) throws UnsupportedPlatformException Getoption
as agdouble
value.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetInt
public static boolean optionsGetInt(String option, Out<Integer> value) throws UnsupportedPlatformException Getoption
as agint
value.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetOptionGroup
Create aGOptionGroup
to handle JSCOptions as command line arguments. The options will be exposed as command line arguments with the form <emphasis>--jsc-<option>=<value></emphasis>. Each entry in the returnedGOptionGroup
is configured to apply the corresponding option during command line parsing. Applications only need to pass the returned group to g_option_context_add_group(), and the rest will be taken care for automatically.- Returns:
- a
GOptionGroup
for the JSCOptions - Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetRangeString
public static boolean optionsGetRangeString(String option, Out<String> value) throws UnsupportedPlatformException Getoption
as a range string. The string must be in the format <emphasis>[!]<low>[:<high>]</emphasis> where low and high areguint
values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetSize
public static boolean optionsGetSize(String option, Out<Long> value) throws UnsupportedPlatformException Getoption
as agsize
value.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetString
public static boolean optionsGetString(String option, Out<String> value) throws UnsupportedPlatformException Getoption
as a string.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsGetUint
public static boolean optionsGetUint(String option, Out<Integer> value) throws UnsupportedPlatformException Getoption
as aguint
value.- Parameters:
option
- the option identifiervalue
- return location for the option value- Returns:
true
ifvalue
has been set orfalse
if the option doesn't exist- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetBoolean
public static boolean optionsSetBoolean(String option, boolean value) throws UnsupportedPlatformException Setoption
as agboolean
value.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetDouble
public static boolean optionsSetDouble(String option, double value) throws UnsupportedPlatformException Setoption
as agdouble
value.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetInt
Setoption
as agint
value.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetRangeString
public static boolean optionsSetRangeString(String option, String value) throws UnsupportedPlatformException Setoption
as a range string. The string must be in the format <emphasis>[!]<low>[:<high>]</emphasis> where low and high areguint
values. Values between low and high (both included) will be considered in the range, unless <emphasis>!</emphasis> is used to invert the range.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetSize
Setoption
as agsize
value.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetString
public static boolean optionsSetString(String option, String value) throws UnsupportedPlatformException Setoption
as a string.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-
optionsSetUint
Setoption
as aguint
value.- Parameters:
option
- the option identifiervalue
- the value to set- Returns:
true
if option was correctly set orfalse
otherwise.- Throws:
UnsupportedPlatformException
- when run on a platform other than linux
-