Implement realm object and support realms for built-ins and JS functions (#4354)

- Type for realm objects is introduced (ecma_global_object_t)
- Realm reference is added to built-in objects and ECMAScript functions
- Resolving built-ins, global environments, and scopes require realm object
- Unnecessary global object accesses are removed from the code

Missing: external functions and static snapshot functions have no realm reference

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-12-08 14:36:36 +01:00
committed by GitHub
parent 7cb9f808f7
commit df92c86ecf
32 changed files with 1128 additions and 188 deletions
@@ -56,6 +56,11 @@ ecma_op_create_external_function_object (ecma_native_handler_t handler_cb);
const ecma_compiled_code_t *
ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p);
#if ENABLED (JERRY_BUILTIN_REALMS)
ecma_value_t
ecma_op_function_get_realm (const ecma_compiled_code_t *bytecode_header_p);
#endif /* ENABLED (JERRY_BUILTIN_REALMS) */
ecma_value_t
ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p,
uint32_t arguments_list_len,