Skip to content

Commit 426c37d

Browse files
authored
jerry: merge a59cf4f from upstream to optimize the function call (#381)
Furthermore add a construct flag, which disallows calling certain functions without new. Constructing bound arrow functions correctly throws error now. Author: Zoltan Herczeg<[email protected]> PR-URL: jerryscript-project/jerryscript#2414
1 parent 5647f86 commit 426c37d

File tree

5 files changed

+279
-206
lines changed

5 files changed

+279
-206
lines changed

deps/jerry/jerry-core/debugger/debugger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ typedef enum
9393
JERRY_DEBUGGER_VM_STOP = 1u << 2, /**< stop at the next breakpoint even if disabled */
9494
JERRY_DEBUGGER_VM_IGNORE = 1u << 3, /**< ignore all breakpoints */
9595
JERRY_DEBUGGER_VM_IGNORE_EXCEPTION = 1u << 4, /**< debugger stop at an exception */
96+
JERRY_DEBUGGER_VM_EXCEPTION_THROWN = 1u << 5, /**< no need to stop for this exception */
9697
JERRY_DEBUGGER_PARSER_WAIT = 1u << 5, /**< debugger should wait after parsing is completed */
9798
JERRY_DEBUGGER_PARSER_WAIT_MODE = 1u << 6, /**< debugger is waiting after parsing is completed */
9899
JERRY_DEBUGGER_CLIENT_SOURCE_MODE = 1u << 7, /**< debugger waiting for client code */

deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,21 @@ ecma_builtin_get (ecma_builtin_id_t builtin_id) /**< id of built-in to check on
245245
return JERRY_CONTEXT (ecma_builtin_objects)[builtin_id];
246246
} /* ecma_builtin_get */
247247

248+
/**
249+
* Get reference to the global object
250+
*
251+
* Note:
252+
* Does not increase the reference counter.
253+
*
254+
* @return pointer to the global object
255+
*/
256+
inline ecma_object_t * __attr_always_inline___
257+
ecma_builtin_get_global (void)
258+
{
259+
JERRY_ASSERT (JERRY_CONTEXT (ecma_builtin_objects)[ECMA_BUILTIN_ID_GLOBAL] != NULL);
260+
return JERRY_CONTEXT (ecma_builtin_objects)[ECMA_BUILTIN_ID_GLOBAL];
261+
} /* ecma_builtin_get_global */
262+
248263
/**
249264
* Checks whether the given function is a built-in routine
250265
*

deps/jerry/jerry-core/ecma/builtin-objects/ecma-builtins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ bool
9898
ecma_builtin_is (ecma_object_t *obj_p, ecma_builtin_id_t builtin_id);
9999
ecma_object_t *
100100
ecma_builtin_get (ecma_builtin_id_t builtin_id);
101+
ecma_object_t *
102+
ecma_builtin_get_global (void);
101103
bool
102104
ecma_builtin_function_is_routine (ecma_object_t *func_obj_p);
103105

0 commit comments

Comments
 (0)