Update the 'README.md' of the JerryScript profiles. (#2309)

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó 2018-05-08 10:14:41 +02:00 committed by yichoi
parent fbb9bf31b2
commit a1f71f8937
2 changed files with 67 additions and 10 deletions

View File

@ -51,6 +51,8 @@ python tools/build.py --cmake-param=CMAKE_PARAM
python tools/build.py --profile=es5.1|es2015-subset|minimal
```
See also the related [README.md](https://github.com/jerryscript-project/jerryscript/blob/master/jerry-core/profiles/README.md).
**Use (jerry, compiler-default, external) libc**
The default libc is jerry-libc, but you can use compiler-default libc or an external libc:

View File

@ -1,4 +1,3 @@
### About profile files
Specify compile definitions in profile files to use when compiling the `jerry-core` target.
@ -14,26 +13,82 @@ You can specify the profile for the build system in the following ways:
#### Restrictions
Only single line options are allowed in the profile file. Any line starting with hash-mark is ignored. Semicolon character is not allowed.
### Example usage:
### Example usage
#### 1. Using the build script
```
# assuming you are in jerryscript folder
./tools/build.py --profile=/absolute/path/to/my_profile.any_extension
```
or
If you want to use a predefined profile, run the build script as follows
(assuming that you are in the project root folder):
```
# assuming you are in jerryscript folder
./tools/build.py --profile=minimal
```
This command selects the profiles/minimal.profile file.
Alternatively, if you want to use a custom profile at
`/absolute/path/to/my.profile`:
```
# Turn off every ES2015 feature EXCEPT the arrow functions
CONFIG_DISABLE_ES2015_BUILTIN
CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS
CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
```
Run the build script as follows (assuming that you are in the project root
folder):
```
./tools/build.py --profile=/absolute/path/to/my.profile
```
#### 2. Using only CMake build system
Set FEATURE_PROFILE option to one of the following values:
* the profile with absolute path
* name of the profile (which needs to exist in the `profiles` folder)
### Configurations
In JerryScript all of the features are enabled by default, so an empty profile file turns on all of the available ECMA features.
* `CONFIG_DISABLE_ANNEXB_BUILTIN`:
Disable the [Annex B](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-B) of the ECMA5.1 standard.
* `CONFIG_DISABLE_ARRAY_BUILTIN`:
Disable the [Array](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.4) built-in.
* `CONFIG_DISABLE_BOOLEAN_BUILTIN`:
Disable the [Boolean](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.6) built-in.
* `CONFIG_DISABLE_DATE_BUILTIN`:
Disable the [Date](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.9) built-in.
* `CONFIG_DISABLE_ERROR_BUILTINS`:
Disable the [Native Error Types](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.11.6) (EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError).
**Note**: The [Error](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.11.2) object remains available.
* `CONFIG_DISABLE_JSON_BUILTIN`:
Disable the [JSON](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.12) built-in.
* `CONFIG_DISABLE_MATH_BUILTIN`:
Disable the [Math](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.8) built-in.
* `CONFIG_DISABLE_NUMBER_BUILTIN`:
Disable the [Number](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.7) built-in.
* `CONFIG_DISABLE_REGEXP_BUILTIN`:
Disable the [RegExp](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.10) built-in.
* `CONFIG_DISABLE_STRING_BUILTIN`:
Disable the [String](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15.5) built-in.
* `CONFIG_DISABLE_BUILTINS`:
Disable all of the [Standard Built-in ECMAScript 5.1 Objects](http://www.ecma-international.org/ecma-262/5.1/index.html#sec-15)
(equivalent to `CONFIG_DISABLE_ANNEXB_BUILTIN`, `CONFIG_DISABLE_ARRAY_BUILTIN`, `CONFIG_DISABLE_BOOLEAN_BUILTIN`, `CONFIG_DISABLE_DATE_BUILTIN`, `CONFIG_DISABLE_ERROR_BUILTINS`, `CONFIG_DISABLE_JSON_BUILTIN`, `CONFIG_DISABLE_MATH_BUILTIN`, `CONFIG_DISABLE_NUMBER_BUILTIN`, `CONFIG_DISABLE_REGEXP_BUILTIN`, and `CONFIG_DISABLE_STRING_BUILTIN`).
* `CONFIG_DISABLE_ES2015_ARROW_FUNCTION`:
Disable the [arrow functions](http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions).
* `CONFIG_DISABLE_ES2015_BUILTIN`:
Disable the built-in updates of the 5.1 standard. There are some differences in those built-ins which available in both [5.1](http://www.ecma-international.org/ecma-262/5.1/) and [2015](http://www.ecma-international.org/ecma-262/6.0/) versions of the standard. JerryScript uses the latest definition by default.
* `CONFIG_DISABLE_ES2015_PROMISE_BUILTIN`:
Disable the [Promise](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects) built-in.
* `CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS`:
Disable the [template strings](http://www.ecma-international.org/ecma-262/6.0/#sec-static-semantics-templatestrings).
* `CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN`:
Disable the [ArrayBuffer](http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-objects) and [TypedArray](http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects) built-ins.
* `CONFIG_DISABLE_ES2015`: Disable all of the implemented [ECMAScript2015 features](http://www.ecma-international.org/ecma-262/6.0/).
(equivalent to `CONFIG_DISABLE_ES2015_ARROW_FUNCTION`, `CONFIG_DISABLE_ES2015_BUILTIN`, `CONFIG_DISABLE_ES2015_PROMISE_BUILTIN`, `CONFIG_DISABLE_ES2015_TEMPLATE_STRINGS`, and `CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN`).