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
+2
View File
@@ -105,6 +105,7 @@ typedef enum
JERRY_FEATURE_WEAKMAP, /**< WeakMap support */
JERRY_FEATURE_WEAKSET, /**< WeakSet support */
JERRY_FEATURE_BIGINT, /**< BigInt support */
JERRY_FEATURE_REALM, /**< realm support */
JERRY_FEATURE__COUNT /**< number of features. NOTE: must be at the end of the list */
} jerry_feature_t;
@@ -600,6 +601,7 @@ jerry_value_t jerry_create_external_string_sz (const jerry_char_t *str_p, jerry_
jerry_value_t jerry_create_symbol (const jerry_value_t value);
jerry_value_t jerry_create_bigint (const uint64_t *digits_p, uint32_t size, bool sign);
jerry_value_t jerry_create_undefined (void);
jerry_value_t jerry_create_realm (void);
/**
* General API functions of JS objects.