Replace vera++ with clang-format (#4518)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-number-arithmetic.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "opcodes.h"
|
||||
|
||||
#include "jrt-libc-includes.h"
|
||||
#include "opcodes.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
* @{
|
||||
@@ -200,8 +201,7 @@ opfunc_addition (ecma_value_t left_value, /**< left value */
|
||||
|
||||
ecma_value_t ret_value = ECMA_VALUE_EMPTY;
|
||||
|
||||
if (ecma_is_value_string (left_value)
|
||||
|| ecma_is_value_string (right_value))
|
||||
if (ecma_is_value_string (left_value) || ecma_is_value_string (right_value))
|
||||
{
|
||||
ecma_string_t *string1_p = ecma_op_to_string (left_value);
|
||||
|
||||
@@ -240,8 +240,7 @@ opfunc_addition (ecma_value_t left_value, /**< left value */
|
||||
ecma_deref_ecma_string (string2_p);
|
||||
}
|
||||
#if JERRY_BUILTIN_BIGINT
|
||||
else if (JERRY_UNLIKELY (ecma_is_value_bigint (left_value))
|
||||
&& JERRY_UNLIKELY (ecma_is_value_bigint (right_value)))
|
||||
else if (JERRY_UNLIKELY (ecma_is_value_bigint (left_value)) && JERRY_UNLIKELY (ecma_is_value_bigint (right_value)))
|
||||
{
|
||||
ret_value = ecma_bigint_add_sub (left_value, right_value, true);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-objects.h"
|
||||
|
||||
#include "opcodes.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
@@ -44,8 +45,7 @@ do_number_bitwise_logic (number_bitwise_logic_op op, /**< number bitwise logic o
|
||||
ecma_value_t left_value, /**< left value */
|
||||
ecma_value_t right_value) /**< right value */
|
||||
{
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
|
||||
&& !ECMA_IS_VALUE_ERROR (right_value));
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value) && !ECMA_IS_VALUE_ERROR (right_value));
|
||||
|
||||
ecma_number_t left_number;
|
||||
left_value = ecma_op_to_numeric (left_value, &left_number, ECMA_TO_NUMERIC_ALLOW_BIGINT);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "ecma-function-object.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-objects.h"
|
||||
|
||||
#include "opcodes.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
@@ -29,24 +30,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Equality opcode handler.
|
||||
*
|
||||
* See also: ECMA-262 v5, 11.9.1, 11.9.2
|
||||
*
|
||||
* @return ecma value
|
||||
* Returned value must be freed with ecma_free_value
|
||||
*/
|
||||
* Equality opcode handler.
|
||||
*
|
||||
* See also: ECMA-262 v5, 11.9.1, 11.9.2
|
||||
*
|
||||
* @return ecma value
|
||||
* Returned value must be freed with ecma_free_value
|
||||
*/
|
||||
ecma_value_t
|
||||
opfunc_equality (ecma_value_t left_value, /**< left value */
|
||||
ecma_value_t right_value) /**< right value */
|
||||
{
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
|
||||
&& !ECMA_IS_VALUE_ERROR (right_value));
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value) && !ECMA_IS_VALUE_ERROR (right_value));
|
||||
|
||||
ecma_value_t compare_result = ecma_op_abstract_equality_compare (left_value, right_value);
|
||||
|
||||
JERRY_ASSERT (ecma_is_value_boolean (compare_result)
|
||||
|| ECMA_IS_VALUE_ERROR (compare_result));
|
||||
JERRY_ASSERT (ecma_is_value_boolean (compare_result) || ECMA_IS_VALUE_ERROR (compare_result));
|
||||
|
||||
return compare_result;
|
||||
} /* opfunc_equality */
|
||||
@@ -65,8 +64,7 @@ opfunc_relation (ecma_value_t left_value, /**< left value */
|
||||
bool left_first, /**< 'LeftFirst' flag */
|
||||
bool is_invert) /**< is invert */
|
||||
{
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value)
|
||||
&& !ECMA_IS_VALUE_ERROR (right_value));
|
||||
JERRY_ASSERT (!ECMA_IS_VALUE_ERROR (left_value) && !ECMA_IS_VALUE_ERROR (right_value));
|
||||
|
||||
ecma_value_t ret_value = ecma_op_abstract_relational_compare (left_value, right_value, left_first);
|
||||
|
||||
|
||||
+26
-49
@@ -13,10 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "opcodes.h"
|
||||
|
||||
#include "ecma-alloc.h"
|
||||
#include "ecma-array-object.h"
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-builtin-helpers.h"
|
||||
#include "ecma-builtins.h"
|
||||
#include "ecma-conversion.h"
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-function-object.h"
|
||||
@@ -28,8 +30,8 @@
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-promise-object.h"
|
||||
#include "ecma-proxy-object.h"
|
||||
|
||||
#include "jcontext.h"
|
||||
#include "opcodes.h"
|
||||
#include "vm-defines.h"
|
||||
#include "vm-stack.h"
|
||||
|
||||
@@ -69,10 +71,8 @@ opfunc_set_data_property (ecma_object_t *object_p, /**< object */
|
||||
|
||||
if (property_p == NULL)
|
||||
{
|
||||
prop_value_p = ecma_create_named_data_property (object_p,
|
||||
prop_name_p,
|
||||
ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
|
||||
NULL);
|
||||
prop_value_p =
|
||||
ecma_create_named_data_property (object_p, prop_name_p, ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -284,8 +284,7 @@ opfunc_for_in (ecma_value_t iterable_value, /**< ideally an iterable value */
|
||||
ecma_value_t *result_obj_p) /**< expression object */
|
||||
{
|
||||
/* 3. */
|
||||
if (ecma_is_value_undefined (iterable_value)
|
||||
|| ecma_is_value_null (iterable_value))
|
||||
if (ecma_is_value_undefined (iterable_value) || ecma_is_value_null (iterable_value))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -621,13 +620,10 @@ opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context
|
||||
}
|
||||
|
||||
JERRY_ASSERT (frame_ctx_p->shared_p->status_flags & VM_FRAME_CTX_SHARED_NON_ARROW_FUNC);
|
||||
proto_p = ecma_op_get_prototype_from_constructor (frame_ctx_p->shared_p->function_object_p,
|
||||
default_proto_id);
|
||||
proto_p = ecma_op_get_prototype_from_constructor (frame_ctx_p->shared_p->function_object_p, default_proto_id);
|
||||
}
|
||||
|
||||
ecma_object_t *object_p = ecma_create_object (proto_p,
|
||||
total_size,
|
||||
ECMA_OBJECT_TYPE_CLASS);
|
||||
ecma_object_t *object_p = ecma_create_object (proto_p, total_size, ECMA_OBJECT_TYPE_CLASS);
|
||||
|
||||
vm_executable_object_t *executable_object_p = (vm_executable_object_t *) object_p;
|
||||
|
||||
@@ -677,10 +673,7 @@ opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context
|
||||
ecma_deref_if_object (*new_registers_p++);
|
||||
}
|
||||
|
||||
vm_ref_lex_env_chain (frame_ctx_p->lex_env_p,
|
||||
frame_ctx_p->context_depth,
|
||||
new_registers_p,
|
||||
false);
|
||||
vm_ref_lex_env_chain (frame_ctx_p->lex_env_p, frame_ctx_p->context_depth, new_registers_p, false);
|
||||
|
||||
new_registers_p += frame_ctx_p->context_depth;
|
||||
|
||||
@@ -704,18 +697,12 @@ opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p, /**< frame context
|
||||
/**
|
||||
* Byte code which resumes an executable object with throw
|
||||
*/
|
||||
const uint8_t opfunc_resume_executable_object_with_throw[1] =
|
||||
{
|
||||
CBC_THROW
|
||||
};
|
||||
const uint8_t opfunc_resume_executable_object_with_throw[1] = { CBC_THROW };
|
||||
|
||||
/**
|
||||
* Byte code which resumes an executable object with return
|
||||
*/
|
||||
const uint8_t opfunc_resume_executable_object_with_return[2] =
|
||||
{
|
||||
CBC_EXT_OPCODE, CBC_EXT_RETURN
|
||||
};
|
||||
const uint8_t opfunc_resume_executable_object_with_return[2] = { CBC_EXT_OPCODE, CBC_EXT_RETURN };
|
||||
|
||||
/**
|
||||
* Resume the execution of an inactive executable object
|
||||
@@ -843,8 +830,7 @@ opfunc_async_generator_yield (ecma_extended_object_t *async_generator_object_p,
|
||||
ecma_value_t value) /**< value (takes the reference) */
|
||||
{
|
||||
ecma_async_generator_task_t *task_p;
|
||||
task_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_async_generator_task_t,
|
||||
async_generator_object_p->u.cls.u3.head);
|
||||
task_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_async_generator_task_t, async_generator_object_p->u.cls.u3.head);
|
||||
|
||||
ecma_value_t iter_result = ecma_create_iter_result_object (value, ECMA_VALUE_FALSE);
|
||||
ecma_fulfill_promise (task_p->promise, iter_result);
|
||||
@@ -878,9 +864,9 @@ opfunc_async_create_and_await (vm_frame_ctx_t *frame_ctx_p, /**< frame context *
|
||||
ecma_value_t value, /**< awaited value (takes reference) */
|
||||
uint16_t extra_flags) /**< extra flags */
|
||||
{
|
||||
JERRY_ASSERT (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags) == CBC_FUNCTION_ASYNC
|
||||
|| (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags)
|
||||
== CBC_FUNCTION_ASYNC_ARROW));
|
||||
JERRY_ASSERT (
|
||||
CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags) == CBC_FUNCTION_ASYNC
|
||||
|| (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags) == CBC_FUNCTION_ASYNC_ARROW));
|
||||
|
||||
ecma_object_t *promise_p = ecma_builtin_get (ECMA_BUILTIN_ID_PROMISE);
|
||||
ecma_value_t result = ecma_promise_reject_or_resolve (ecma_make_object_value (promise_p), value, true);
|
||||
@@ -949,8 +935,8 @@ opfunc_init_class_fields (ecma_object_t *class_object_p, /**< the function itsel
|
||||
shared_class_fields.header.bytecode_header_p = ecma_op_function_get_compiled_code (ext_function_p);
|
||||
shared_class_fields.header.function_object_p = &ext_function_p->object;
|
||||
|
||||
ecma_object_t *scope_p = ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t,
|
||||
ext_function_p->u.function.scope_cp);
|
||||
ecma_object_t *scope_p =
|
||||
ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, ext_function_p->u.function.scope_cp);
|
||||
|
||||
ecma_value_t result = vm_run (&shared_class_fields.header, this_val, scope_p);
|
||||
|
||||
@@ -989,8 +975,8 @@ opfunc_init_static_class_fields (ecma_value_t function_object, /**< the function
|
||||
ecma_extended_object_t *ext_function_p = (ecma_extended_object_t *) function_object_p;
|
||||
shared_class_fields.header.bytecode_header_p = ecma_op_function_get_compiled_code (ext_function_p);
|
||||
|
||||
ecma_object_t *scope_p = ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t,
|
||||
ext_function_p->u.function.scope_cp);
|
||||
ecma_object_t *scope_p =
|
||||
ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t, ext_function_p->u.function.scope_cp);
|
||||
|
||||
ecma_value_t result = vm_run (&shared_class_fields.header, this_val, scope_p);
|
||||
|
||||
@@ -1297,8 +1283,7 @@ opfunc_set_class_attributes (ecma_object_t *obj_p, /**< object */
|
||||
|
||||
if (property & ECMA_PROPERTY_FLAG_DATA)
|
||||
{
|
||||
if (ecma_is_value_object (property_pair_p->values[index].value)
|
||||
&& ecma_is_property_enumerable (property))
|
||||
if (ecma_is_value_object (property_pair_p->values[index].value) && ecma_is_property_enumerable (property))
|
||||
{
|
||||
property_pair_p->header.types[index] = (uint8_t) (property & ~ECMA_PROPERTY_FLAG_ENUMERABLE);
|
||||
opfunc_set_home_object (ecma_get_object_from_value (property_pair_p->values[index].value), parent_env_p);
|
||||
@@ -1497,11 +1482,8 @@ opfunc_assign_super_reference (ecma_value_t **vm_stack_top_p, /**< vm stack top
|
||||
|
||||
bool is_strict = (frame_ctx_p->status_flags & VM_FRAME_CTX_IS_STRICT) != 0;
|
||||
|
||||
ecma_value_t result = ecma_op_object_put_with_receiver (base_obj_p,
|
||||
prop_name_p,
|
||||
stack_top_p[-1],
|
||||
frame_ctx_p->this_binding,
|
||||
is_strict);
|
||||
ecma_value_t result =
|
||||
ecma_op_object_put_with_receiver (base_obj_p, prop_name_p, stack_top_p[-1], frame_ctx_p->this_binding, is_strict);
|
||||
|
||||
ecma_deref_ecma_string (prop_name_p);
|
||||
ecma_deref_object (base_obj_p);
|
||||
@@ -1604,8 +1586,7 @@ opfunc_copy_data_properties (ecma_value_t target_object, /**< target object */
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (++filter_p < filter_end_p);
|
||||
} while (++filter_p < filter_end_p);
|
||||
|
||||
if (filter_p != filter_end_p)
|
||||
{
|
||||
@@ -1721,13 +1702,9 @@ opfunc_lexical_scope_has_restricted_binding (vm_frame_ctx_t *frame_ctx_p, /**< f
|
||||
}
|
||||
#endif /* JERRY_BUILTIN_PROXY */
|
||||
|
||||
ecma_property_t property = ecma_op_object_get_own_property (global_obj_p,
|
||||
name_p,
|
||||
NULL,
|
||||
ECMA_PROPERTY_GET_NO_OPTIONS);
|
||||
ecma_property_t property = ecma_op_object_get_own_property (global_obj_p, name_p, NULL, ECMA_PROPERTY_GET_NO_OPTIONS);
|
||||
|
||||
JERRY_ASSERT (property == ECMA_PROPERTY_TYPE_NOT_FOUND
|
||||
|| ECMA_PROPERTY_IS_FOUND (property));
|
||||
JERRY_ASSERT (property == ECMA_PROPERTY_TYPE_NOT_FOUND || ECMA_PROPERTY_IS_FOUND (property));
|
||||
|
||||
return ecma_make_boolean_value (property != ECMA_PROPERTY_TYPE_NOT_FOUND
|
||||
&& !ecma_is_property_configurable (property));
|
||||
|
||||
+37
-65
@@ -17,6 +17,7 @@
|
||||
#define OPCODES_H
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#include "vm-defines.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
@@ -71,106 +72,78 @@ typedef enum
|
||||
*/
|
||||
#define OPFUNC_HAS_SPREAD_ELEMENT (1 << 8)
|
||||
|
||||
ecma_value_t
|
||||
opfunc_equality (ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t opfunc_equality (ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
do_number_arithmetic (number_arithmetic_op op, ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t do_number_arithmetic (number_arithmetic_op op, ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_unary_operation (ecma_value_t left_value, bool is_plus);
|
||||
ecma_value_t opfunc_unary_operation (ecma_value_t left_value, bool is_plus);
|
||||
|
||||
ecma_value_t
|
||||
do_number_bitwise_logic (number_bitwise_logic_op op, ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t do_number_bitwise_logic (number_bitwise_logic_op op, ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
do_number_bitwise_not (ecma_value_t value);
|
||||
ecma_value_t do_number_bitwise_not (ecma_value_t value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_addition (ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t opfunc_addition (ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_relation (ecma_value_t left_value, ecma_value_t right_value, bool left_first, bool is_invert);
|
||||
ecma_value_t opfunc_relation (ecma_value_t left_value, ecma_value_t right_value, bool left_first, bool is_invert);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_in (ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t opfunc_in (ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value);
|
||||
ecma_value_t opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_typeof (ecma_value_t left_value);
|
||||
ecma_value_t opfunc_typeof (ecma_value_t left_value);
|
||||
|
||||
void
|
||||
opfunc_set_data_property (ecma_object_t *object_p, ecma_string_t *prop_name_p, ecma_value_t value);
|
||||
void opfunc_set_data_property (ecma_object_t *object_p, ecma_string_t *prop_name_p, ecma_value_t value);
|
||||
|
||||
void
|
||||
opfunc_set_accessor (bool is_getter, ecma_value_t object, ecma_string_t *accessor_name_p, ecma_value_t accessor);
|
||||
void opfunc_set_accessor (bool is_getter, ecma_value_t object, ecma_string_t *accessor_name_p, ecma_value_t accessor);
|
||||
|
||||
ecma_value_t
|
||||
vm_op_delete_prop (ecma_value_t object, ecma_value_t property, bool is_strict);
|
||||
ecma_value_t vm_op_delete_prop (ecma_value_t object, ecma_value_t property, bool is_strict);
|
||||
|
||||
ecma_value_t
|
||||
vm_op_delete_var (ecma_value_t name_literal, ecma_object_t *lex_env_p);
|
||||
ecma_value_t vm_op_delete_var (ecma_value_t name_literal, ecma_object_t *lex_env_p);
|
||||
|
||||
ecma_collection_t *
|
||||
opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p);
|
||||
ecma_collection_t *opfunc_for_in (ecma_value_t left_value, ecma_value_t *result_obj_p);
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
ecma_collection_t *
|
||||
opfunc_spread_arguments (ecma_value_t *stack_top_p, uint8_t argument_list_len);
|
||||
ecma_collection_t *opfunc_spread_arguments (ecma_value_t *stack_top_p, uint8_t argument_list_len);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
ecma_value_t
|
||||
opfunc_append_array (ecma_value_t *stack_top_p, uint16_t values_length);
|
||||
ecma_value_t opfunc_append_array (ecma_value_t *stack_top_p, uint16_t values_length);
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
vm_executable_object_t *
|
||||
opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p, vm_create_executable_object_type_t type);
|
||||
vm_executable_object_t *opfunc_create_executable_object (vm_frame_ctx_t *frame_ctx_p,
|
||||
vm_create_executable_object_type_t type);
|
||||
|
||||
extern const uint8_t opfunc_resume_executable_object_with_throw[];
|
||||
extern const uint8_t opfunc_resume_executable_object_with_return[];
|
||||
|
||||
ecma_value_t
|
||||
opfunc_resume_executable_object (vm_executable_object_t *executable_object_p, ecma_value_t value);
|
||||
ecma_value_t opfunc_resume_executable_object (vm_executable_object_t *executable_object_p, ecma_value_t value);
|
||||
|
||||
void
|
||||
opfunc_async_generator_yield (ecma_extended_object_t *async_generator_object_p, ecma_value_t value);
|
||||
void opfunc_async_generator_yield (ecma_extended_object_t *async_generator_object_p, ecma_value_t value);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_async_create_and_await (vm_frame_ctx_t *frame_ctx_p, ecma_value_t value, uint16_t extra_flags);
|
||||
ecma_value_t opfunc_async_create_and_await (vm_frame_ctx_t *frame_ctx_p, ecma_value_t value, uint16_t extra_flags);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_init_class_fields (ecma_object_t *class_object_p, ecma_value_t this_val);
|
||||
ecma_value_t opfunc_init_class_fields (ecma_object_t *class_object_p, ecma_value_t this_val);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_init_static_class_fields (ecma_value_t function_object, ecma_value_t this_val);
|
||||
ecma_value_t opfunc_init_static_class_fields (ecma_value_t function_object, ecma_value_t this_val);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_add_computed_field (ecma_value_t class_object, ecma_value_t name);
|
||||
ecma_value_t opfunc_add_computed_field (ecma_value_t class_object, ecma_value_t name);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_create_implicit_class_constructor (uint8_t opcode, const ecma_compiled_code_t *bytecode_p);
|
||||
ecma_value_t opfunc_create_implicit_class_constructor (uint8_t opcode, const ecma_compiled_code_t *bytecode_p);
|
||||
|
||||
void
|
||||
opfunc_set_home_object (ecma_object_t *func_p, ecma_object_t *parent_env_p);
|
||||
void opfunc_set_home_object (ecma_object_t *func_p, ecma_object_t *parent_env_p);
|
||||
|
||||
void
|
||||
opfunc_push_class_environment (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top, ecma_value_t class_name);
|
||||
void opfunc_push_class_environment (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top, ecma_value_t class_name);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_init_class (vm_frame_ctx_t *frame_context_p, ecma_value_t *stack_top_p);
|
||||
ecma_value_t opfunc_init_class (vm_frame_ctx_t *frame_context_p, ecma_value_t *stack_top_p);
|
||||
|
||||
void
|
||||
opfunc_pop_lexical_environment (vm_frame_ctx_t *frame_ctx_p);
|
||||
void opfunc_pop_lexical_environment (vm_frame_ctx_t *frame_ctx_p);
|
||||
|
||||
void
|
||||
opfunc_finalize_class (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top_p, ecma_value_t class_name);
|
||||
void opfunc_finalize_class (vm_frame_ctx_t *frame_ctx_p, ecma_value_t **vm_stack_top_p, ecma_value_t class_name);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_form_super_reference (ecma_value_t **vm_stack_top_p, vm_frame_ctx_t *frame_ctx_p, ecma_value_t prop_name,
|
||||
uint8_t opcode);
|
||||
ecma_value_t opfunc_form_super_reference (ecma_value_t **vm_stack_top_p,
|
||||
vm_frame_ctx_t *frame_ctx_p,
|
||||
ecma_value_t prop_name,
|
||||
uint8_t opcode);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_assign_super_reference (ecma_value_t **vm_stack_top_p, vm_frame_ctx_t *frame_ctx_p, uint32_t opcode_data);
|
||||
@@ -178,8 +151,7 @@ opfunc_assign_super_reference (ecma_value_t **vm_stack_top_p, vm_frame_ctx_t *fr
|
||||
ecma_value_t
|
||||
opfunc_copy_data_properties (ecma_value_t target_object, ecma_value_t source_object, ecma_value_t filter_array);
|
||||
|
||||
ecma_value_t
|
||||
opfunc_lexical_scope_has_restricted_binding (vm_frame_ctx_t *vm_frame_ctx_p, ecma_string_t *name_p);
|
||||
ecma_value_t opfunc_lexical_scope_has_restricted_binding (vm_frame_ctx_t *vm_frame_ctx_p, ecma_string_t *name_p);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
|
||||
+35
-35
@@ -15,9 +15,10 @@
|
||||
#ifndef VM_DEFINES_H
|
||||
#define VM_DEFINES_H
|
||||
|
||||
#include "byte-code.h"
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#include "byte-code.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
* @{
|
||||
*
|
||||
@@ -40,16 +41,16 @@
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_FRAME_CTX_SHARED_HAS_ARG_LIST = (1 << 0), /**< has argument list */
|
||||
VM_FRAME_CTX_SHARED_DIRECT_EVAL = (1 << 1), /**< direct eval call */
|
||||
VM_FRAME_CTX_SHARED_FREE_THIS = (1 << 2), /**< free this binding */
|
||||
VM_FRAME_CTX_SHARED_FREE_LOCAL_ENV = (1 << 3), /**< free local environment */
|
||||
VM_FRAME_CTX_SHARED_HAS_ARG_LIST = (1 << 0), /**< has argument list */
|
||||
VM_FRAME_CTX_SHARED_DIRECT_EVAL = (1 << 1), /**< direct eval call */
|
||||
VM_FRAME_CTX_SHARED_FREE_THIS = (1 << 2), /**< free this binding */
|
||||
VM_FRAME_CTX_SHARED_FREE_LOCAL_ENV = (1 << 3), /**< free local environment */
|
||||
#if JERRY_ESNEXT
|
||||
VM_FRAME_CTX_SHARED_NON_ARROW_FUNC = (1 << 4), /**< non-arrow function */
|
||||
VM_FRAME_CTX_SHARED_HERITAGE_PRESENT = (1 << 5), /**< class heritage present */
|
||||
VM_FRAME_CTX_SHARED_HAS_CLASS_FIELDS = (1 << 6), /**< has class fields */
|
||||
VM_FRAME_CTX_SHARED_EXECUTABLE = (1 << 7), /**< frame is an executable object constructed
|
||||
* with opfunc_create_executable_object */
|
||||
VM_FRAME_CTX_SHARED_NON_ARROW_FUNC = (1 << 4), /**< non-arrow function */
|
||||
VM_FRAME_CTX_SHARED_HERITAGE_PRESENT = (1 << 5), /**< class heritage present */
|
||||
VM_FRAME_CTX_SHARED_HAS_CLASS_FIELDS = (1 << 6), /**< has class fields */
|
||||
VM_FRAME_CTX_SHARED_EXECUTABLE = (1 << 7), /**< frame is an executable object constructed
|
||||
* with opfunc_create_executable_object */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
} vm_frame_ctx_shared_flags_t;
|
||||
|
||||
@@ -58,9 +59,9 @@ typedef enum
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const ecma_compiled_code_t *bytecode_header_p; /**< currently executed byte-code data */
|
||||
ecma_object_t *function_object_p; /**< function obj */
|
||||
uint32_t status_flags; /**< combination of vm_frame_ctx_shared_flags_t bits */
|
||||
const ecma_compiled_code_t *bytecode_header_p; /**< currently executed byte-code data */
|
||||
ecma_object_t *function_object_p; /**< function obj */
|
||||
uint32_t status_flags; /**< combination of vm_frame_ctx_shared_flags_t bits */
|
||||
} vm_frame_ctx_shared_t;
|
||||
|
||||
/**
|
||||
@@ -68,9 +69,9 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
vm_frame_ctx_shared_t header; /**< shared data header */
|
||||
const ecma_value_t *arg_list_p; /**< arguments list */
|
||||
uint32_t arg_list_len; /**< arguments list length */
|
||||
vm_frame_ctx_shared_t header; /**< shared data header */
|
||||
const ecma_value_t *arg_list_p; /**< arguments list */
|
||||
uint32_t arg_list_len; /**< arguments list length */
|
||||
} vm_frame_ctx_shared_args_t;
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
@@ -80,8 +81,8 @@ typedef struct
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
vm_frame_ctx_shared_t header; /**< shared data header */
|
||||
ecma_value_t *computed_class_fields_p; /**< names of the computed class fields */
|
||||
vm_frame_ctx_shared_t header; /**< shared data header */
|
||||
ecma_value_t *computed_class_fields_p; /**< names of the computed class fields */
|
||||
} vm_frame_ctx_shared_class_fields_t;
|
||||
|
||||
/**
|
||||
@@ -97,8 +98,8 @@ typedef struct
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_FRAME_CTX_DIRECT_EVAL = (1 << 1), /**< direct eval call */
|
||||
VM_FRAME_CTX_IS_STRICT = (1 << 2), /**< strict mode */
|
||||
VM_FRAME_CTX_DIRECT_EVAL = (1 << 1), /**< direct eval call */
|
||||
VM_FRAME_CTX_IS_STRICT = (1 << 2), /**< strict mode */
|
||||
} vm_frame_ctx_flags_t;
|
||||
|
||||
/**
|
||||
@@ -106,17 +107,17 @@ typedef enum
|
||||
*/
|
||||
typedef struct vm_frame_ctx_t
|
||||
{
|
||||
vm_frame_ctx_shared_t *shared_p; /**< shared information */
|
||||
const uint8_t *byte_code_p; /**< current byte code pointer */
|
||||
const uint8_t *byte_code_start_p; /**< byte code start pointer */
|
||||
ecma_value_t *stack_top_p; /**< stack top pointer */
|
||||
ecma_value_t *literal_start_p; /**< literal list start pointer */
|
||||
ecma_object_t *lex_env_p; /**< current lexical environment */
|
||||
struct vm_frame_ctx_t *prev_context_p; /**< previous context */
|
||||
ecma_value_t this_binding; /**< this binding */
|
||||
uint16_t context_depth; /**< current context depth */
|
||||
uint8_t status_flags; /**< combination of vm_frame_ctx_flags_t bits */
|
||||
uint8_t call_operation; /**< perform a call or construct operation */
|
||||
vm_frame_ctx_shared_t *shared_p; /**< shared information */
|
||||
const uint8_t *byte_code_p; /**< current byte code pointer */
|
||||
const uint8_t *byte_code_start_p; /**< byte code start pointer */
|
||||
ecma_value_t *stack_top_p; /**< stack top pointer */
|
||||
ecma_value_t *literal_start_p; /**< literal list start pointer */
|
||||
ecma_object_t *lex_env_p; /**< current lexical environment */
|
||||
struct vm_frame_ctx_t *prev_context_p; /**< previous context */
|
||||
ecma_value_t this_binding; /**< this binding */
|
||||
uint16_t context_depth; /**< current context depth */
|
||||
uint8_t status_flags; /**< combination of vm_frame_ctx_flags_t bits */
|
||||
uint8_t call_operation; /**< perform a call or construct operation */
|
||||
/* Registers start immediately after the frame context. */
|
||||
} vm_frame_ctx_t;
|
||||
|
||||
@@ -139,10 +140,9 @@ typedef struct vm_frame_ctx_t
|
||||
/**
|
||||
* Calculate the shared_part from a vm_executable_object frame context.
|
||||
*/
|
||||
#define VM_GET_EXECUTABLE_ITERATOR(frame_ctx_p) \
|
||||
((ecma_value_t *) ((uintptr_t) (frame_ctx_p) \
|
||||
- (uintptr_t) offsetof (vm_executable_object_t, frame_ctx) \
|
||||
+ (uintptr_t) offsetof (vm_executable_object_t, iterator)))
|
||||
#define VM_GET_EXECUTABLE_ITERATOR(frame_ctx_p) \
|
||||
((ecma_value_t *) ((uintptr_t) (frame_ctx_p) - (uintptr_t) offsetof (vm_executable_object_t, frame_ctx) \
|
||||
+ (uintptr_t) offsetof (vm_executable_object_t, iterator)))
|
||||
|
||||
/**
|
||||
* Generator frame context.
|
||||
|
||||
+14
-24
@@ -13,6 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "vm-stack.h"
|
||||
|
||||
#include "ecma-alloc.h"
|
||||
#include "ecma-exceptions.h"
|
||||
#include "ecma-function-object.h"
|
||||
@@ -21,9 +23,9 @@
|
||||
#include "ecma-iterator-object.h"
|
||||
#include "ecma-objects.h"
|
||||
#include "ecma-promise-object.h"
|
||||
|
||||
#include "jcontext.h"
|
||||
#include "vm-defines.h"
|
||||
#include "vm-stack.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
* @{
|
||||
@@ -204,10 +206,7 @@ vm_decode_branch_offset (const uint8_t *branch_offset_p, /**< start offset of by
|
||||
/**
|
||||
* Byte code which resumes an executable object with throw
|
||||
*/
|
||||
static const uint8_t vm_stack_resume_executable_object_with_context_end[1] =
|
||||
{
|
||||
CBC_CONTEXT_END
|
||||
};
|
||||
static const uint8_t vm_stack_resume_executable_object_with_context_end[1] = { CBC_CONTEXT_END };
|
||||
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
@@ -269,12 +268,10 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
{
|
||||
JERRY_ASSERT (byte_code_p[0] == CBC_EXT_OPCODE);
|
||||
|
||||
if (byte_code_p[1] >= CBC_EXT_CATCH
|
||||
&& byte_code_p[1] <= CBC_EXT_CATCH_3)
|
||||
if (byte_code_p[1] >= CBC_EXT_CATCH && byte_code_p[1] <= CBC_EXT_CATCH_3)
|
||||
{
|
||||
branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (byte_code_p[1]);
|
||||
branch_offset = vm_decode_branch_offset (byte_code_p + 2,
|
||||
branch_offset_length);
|
||||
branch_offset = vm_decode_branch_offset (byte_code_p + 2, branch_offset_length);
|
||||
|
||||
if (finally_type == VM_CONTEXT_FINALLY_THROW)
|
||||
{
|
||||
@@ -337,12 +334,10 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
}
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
JERRY_ASSERT (byte_code_p[1] >= CBC_EXT_FINALLY
|
||||
&& byte_code_p[1] <= CBC_EXT_FINALLY_3);
|
||||
JERRY_ASSERT (byte_code_p[1] >= CBC_EXT_FINALLY && byte_code_p[1] <= CBC_EXT_FINALLY_3);
|
||||
|
||||
branch_offset_length = CBC_BRANCH_OFFSET_LENGTH (byte_code_p[1]);
|
||||
branch_offset = vm_decode_branch_offset (byte_code_p + 2,
|
||||
branch_offset_length);
|
||||
branch_offset = vm_decode_branch_offset (byte_code_p + 2, branch_offset_length);
|
||||
|
||||
branch_offset += (uint32_t) (byte_code_p - frame_ctx_p->byte_code_start_p);
|
||||
|
||||
@@ -356,8 +351,7 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
#if JERRY_ESNEXT
|
||||
else if (stack_top_p[-1] & VM_CONTEXT_CLOSE_ITERATOR)
|
||||
{
|
||||
JERRY_ASSERT (context_type == VM_CONTEXT_FOR_OF
|
||||
|| context_type == VM_CONTEXT_FOR_AWAIT_OF
|
||||
JERRY_ASSERT (context_type == VM_CONTEXT_FOR_OF || context_type == VM_CONTEXT_FOR_AWAIT_OF
|
||||
|| context_type == VM_CONTEXT_ITERATOR);
|
||||
JERRY_ASSERT (finally_type == VM_CONTEXT_FINALLY_THROW || !jcontext_has_pending_exception ());
|
||||
|
||||
@@ -392,8 +386,8 @@ vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
||||
|
||||
if (!ECMA_IS_VALUE_ERROR (result))
|
||||
{
|
||||
uint16_t extra_flags = (ECMA_EXECUTABLE_OBJECT_DO_AWAIT_OR_YIELD
|
||||
| (ECMA_AWAIT_FOR_CLOSE << ECMA_AWAIT_STATE_SHIFT));
|
||||
uint16_t extra_flags =
|
||||
(ECMA_EXECUTABLE_OBJECT_DO_AWAIT_OR_YIELD | (ECMA_AWAIT_FOR_CLOSE << ECMA_AWAIT_STATE_SHIFT));
|
||||
async_generator_object_p->u.cls.u2.executable_obj_flags |= extra_flags;
|
||||
|
||||
stack_top_p = vm_stack_context_abort (frame_ctx_p, stack_top_p);
|
||||
@@ -494,9 +488,7 @@ vm_get_context_value_offsets (ecma_value_t *context_item_p) /**< any item of a c
|
||||
|| VM_GET_CONTEXT_TYPE (context_item_p[-1]) == VM_CONTEXT_FOR_AWAIT_OF);
|
||||
|
||||
return ((PARSER_FOR_OF_CONTEXT_STACK_ALLOCATION << (VM_CONTEXT_OFFSET_SHIFT * 3))
|
||||
| (4 << (VM_CONTEXT_OFFSET_SHIFT * 2))
|
||||
| (3 << VM_CONTEXT_OFFSET_SHIFT)
|
||||
| 2);
|
||||
| (4 << (VM_CONTEXT_OFFSET_SHIFT * 2)) | (3 << VM_CONTEXT_OFFSET_SHIFT) | 2);
|
||||
}
|
||||
}
|
||||
} /* vm_get_context_value_offsets */
|
||||
@@ -548,8 +540,7 @@ vm_ref_lex_env_chain (ecma_object_t *lex_env_p, /**< top of lexical environment
|
||||
{
|
||||
ecma_deref_if_object (*(--context_top_p));
|
||||
}
|
||||
}
|
||||
while (context_top_p > last_item_p);
|
||||
} while (context_top_p > last_item_p);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -574,8 +565,7 @@ vm_ref_lex_env_chain (ecma_object_t *lex_env_p, /**< top of lexical environment
|
||||
|
||||
JERRY_ASSERT (context_top_p >= context_end_p + offsets);
|
||||
context_top_p -= offsets;
|
||||
}
|
||||
while (context_top_p > context_end_p);
|
||||
} while (context_top_p > context_end_p);
|
||||
} /* vm_ref_lex_env_chain */
|
||||
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
+30
-29
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "ecma-globals.h"
|
||||
|
||||
#include "vm-defines.h"
|
||||
|
||||
/** \addtogroup vm Virtual machine
|
||||
* @{
|
||||
*
|
||||
@@ -33,13 +35,12 @@
|
||||
/**
|
||||
* Create context on the vm stack with environment.
|
||||
*/
|
||||
#define VM_CREATE_CONTEXT_WITH_ENV(type, end_offset) \
|
||||
(VM_CREATE_CONTEXT ((type),(end_offset)) | VM_CONTEXT_HAS_LEX_ENV)
|
||||
#define VM_CREATE_CONTEXT_WITH_ENV(type, end_offset) (VM_CREATE_CONTEXT ((type), (end_offset)) | VM_CONTEXT_HAS_LEX_ENV)
|
||||
|
||||
/**
|
||||
* Get type of a vm context.
|
||||
*/
|
||||
#define VM_GET_CONTEXT_TYPE(value) ((vm_stack_context_type_t) ((value) & 0x1f))
|
||||
#define VM_GET_CONTEXT_TYPE(value) ((vm_stack_context_type_t) ((value) &0x1f))
|
||||
|
||||
/**
|
||||
* Get the end position of a vm context.
|
||||
@@ -62,24 +63,24 @@
|
||||
typedef enum
|
||||
{
|
||||
/* Update VM_CONTEXT_IS_FINALLY macro if the following three values are changed. */
|
||||
VM_CONTEXT_FINALLY_JUMP, /**< finally context with a jump */
|
||||
VM_CONTEXT_FINALLY_THROW, /**< finally context with a throw */
|
||||
VM_CONTEXT_FINALLY_RETURN, /**< finally context with a return */
|
||||
VM_CONTEXT_TRY, /**< try context */
|
||||
VM_CONTEXT_CATCH, /**< catch context */
|
||||
VM_CONTEXT_FINALLY_JUMP, /**< finally context with a jump */
|
||||
VM_CONTEXT_FINALLY_THROW, /**< finally context with a throw */
|
||||
VM_CONTEXT_FINALLY_RETURN, /**< finally context with a return */
|
||||
VM_CONTEXT_TRY, /**< try context */
|
||||
VM_CONTEXT_CATCH, /**< catch context */
|
||||
#if JERRY_ESNEXT
|
||||
VM_CONTEXT_BLOCK, /**< block context */
|
||||
VM_CONTEXT_BLOCK, /**< block context */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
VM_CONTEXT_WITH, /**< with context */
|
||||
VM_CONTEXT_FOR_IN, /**< for-in context */
|
||||
VM_CONTEXT_WITH, /**< with context */
|
||||
VM_CONTEXT_FOR_IN, /**< for-in context */
|
||||
#if JERRY_ESNEXT
|
||||
VM_CONTEXT_FOR_OF, /**< for-of context */
|
||||
VM_CONTEXT_FOR_AWAIT_OF, /**< for-await-of context */
|
||||
VM_CONTEXT_FOR_OF, /**< for-of context */
|
||||
VM_CONTEXT_FOR_AWAIT_OF, /**< for-await-of context */
|
||||
|
||||
/* contexts with variable length */
|
||||
VM_CONTEXT_ITERATOR, /**< iterator context */
|
||||
VM_CONTEXT_OBJ_INIT, /**< object-initializer context */
|
||||
VM_CONTEXT_OBJ_INIT_REST, /**< object-initializer-rest context */
|
||||
VM_CONTEXT_ITERATOR, /**< iterator context */
|
||||
VM_CONTEXT_OBJ_INIT, /**< object-initializer context */
|
||||
VM_CONTEXT_OBJ_INIT_REST, /**< object-initializer-rest context */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
} vm_stack_context_type_t;
|
||||
|
||||
@@ -88,12 +89,12 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_CONTEXT_FOUND_FINALLY, /**< found finally */
|
||||
VM_CONTEXT_FOUND_FINALLY, /**< found finally */
|
||||
#if JERRY_ESNEXT
|
||||
VM_CONTEXT_FOUND_ERROR, /**< found an error */
|
||||
VM_CONTEXT_FOUND_AWAIT, /**< found an await operation */
|
||||
VM_CONTEXT_FOUND_ERROR, /**< found an error */
|
||||
VM_CONTEXT_FOUND_AWAIT, /**< found an await operation */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
VM_CONTEXT_FOUND_EXPECTED, /**< found the type specified in finally_type */
|
||||
VM_CONTEXT_FOUND_EXPECTED, /**< found the type specified in finally_type */
|
||||
} vm_stack_found_type;
|
||||
|
||||
/**
|
||||
@@ -105,8 +106,7 @@ typedef enum
|
||||
* - [previous JS values stored by the VM stack]
|
||||
*/
|
||||
#if JERRY_ESNEXT
|
||||
#define VM_CONTEXT_IS_VARIABLE_LENGTH(context_type) \
|
||||
((context_type) >= VM_CONTEXT_ITERATOR)
|
||||
#define VM_CONTEXT_IS_VARIABLE_LENGTH(context_type) ((context_type) >= VM_CONTEXT_ITERATOR)
|
||||
#else /* !JERRY_ESNEXT */
|
||||
#define VM_CONTEXT_IS_VARIABLE_LENGTH(context_type) false
|
||||
#endif /* JERRY_ESNEXT */
|
||||
@@ -114,8 +114,7 @@ typedef enum
|
||||
/**
|
||||
* Checks whether the context type is a finally type.
|
||||
*/
|
||||
#define VM_CONTEXT_IS_FINALLY(context_type) \
|
||||
((context_type) <= VM_CONTEXT_FINALLY_RETURN)
|
||||
#define VM_CONTEXT_IS_FINALLY(context_type) ((context_type) <= VM_CONTEXT_FINALLY_RETURN)
|
||||
|
||||
/**
|
||||
* Shift needs to be applied to get the next item of the offset array.
|
||||
@@ -133,15 +132,17 @@ typedef enum
|
||||
#define VM_CONTEXT_GET_NEXT_OFFSET(offsets) (-((int32_t) ((offsets) & ((1 << VM_CONTEXT_OFFSET_SHIFT) - 1))))
|
||||
|
||||
#if JERRY_ESNEXT
|
||||
ecma_value_t *vm_stack_context_abort_variable_length (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *vm_stack_top_p,
|
||||
ecma_value_t *vm_stack_context_abort_variable_length (vm_frame_ctx_t *frame_ctx_p,
|
||||
ecma_value_t *vm_stack_top_p,
|
||||
uint32_t context_stack_allocation);
|
||||
#endif /* JERRY_ESNEXT */
|
||||
ecma_value_t *vm_stack_context_abort (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *vm_stack_top_p);
|
||||
vm_stack_found_type vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p, ecma_value_t *stack_top_p,
|
||||
vm_stack_context_type_t finally_type, uint32_t search_limit);
|
||||
vm_stack_found_type vm_stack_find_finally (vm_frame_ctx_t *frame_ctx_p,
|
||||
ecma_value_t *stack_top_p,
|
||||
vm_stack_context_type_t finally_type,
|
||||
uint32_t search_limit);
|
||||
uint32_t vm_get_context_value_offsets (ecma_value_t *context_item_p);
|
||||
void vm_ref_lex_env_chain (ecma_object_t *lex_env_p, uint16_t context_depth,
|
||||
ecma_value_t *context_end_p, bool do_ref);
|
||||
void vm_ref_lex_env_chain (ecma_object_t *lex_env_p, uint16_t context_depth, ecma_value_t *context_end_p, bool do_ref);
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ecma-array-object.h"
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-line-info.h"
|
||||
|
||||
#include "jcontext.h"
|
||||
#include "lit-char-helpers.h"
|
||||
#include "vm.h"
|
||||
@@ -83,7 +84,7 @@ vm_get_backtrace (uint32_t max_depth) /**< maximum backtrace depth, 0 = unlimite
|
||||
|
||||
if (ecma_string_is_empty (str_p))
|
||||
{
|
||||
ecma_stringbuilder_append_raw (&builder, (const lit_utf8_byte_t *)"<unknown>:", 10);
|
||||
ecma_stringbuilder_append_raw (&builder, (const lit_utf8_byte_t *) "<unknown>:", 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -110,7 +111,7 @@ vm_get_backtrace (uint32_t max_depth) /**< maximum backtrace depth, 0 = unlimite
|
||||
}
|
||||
else
|
||||
{
|
||||
ecma_stringbuilder_append_raw (&builder, (const lit_utf8_byte_t *)"1:1", 3);
|
||||
ecma_stringbuilder_append_raw (&builder, (const lit_utf8_byte_t *) "1:1", 3);
|
||||
}
|
||||
|
||||
ecma_string_t *builder_str_p = ecma_stringbuilder_finalize (&builder);
|
||||
|
||||
+195
-335
File diff suppressed because it is too large
Load Diff
+249
-248
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "ecma-globals.h"
|
||||
#include "ecma-module.h"
|
||||
|
||||
#include "jrt.h"
|
||||
#include "vm-defines.h"
|
||||
|
||||
@@ -60,7 +61,7 @@
|
||||
/**
|
||||
* Generate the binary representation of a "get arguments" opcode.
|
||||
*/
|
||||
#define VM_OC_GET_ARGS_CREATE_INDEX(V) (((V) & VM_OC_GET_ARGS_MASK) << VM_OC_GET_ARGS_SHIFT)
|
||||
#define VM_OC_GET_ARGS_CREATE_INDEX(V) (((V) &VM_OC_GET_ARGS_MASK) << VM_OC_GET_ARGS_SHIFT)
|
||||
|
||||
/**
|
||||
* Extract the "get arguments" opcode.
|
||||
@@ -77,16 +78,16 @@
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_OC_GET_NONE = VM_OC_GET_ARGS_CREATE_INDEX (0), /**< do nothing */
|
||||
VM_OC_GET_BRANCH = VM_OC_GET_ARGS_CREATE_INDEX (1), /**< branch argument */
|
||||
VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2), /**< pop one element from the stack */
|
||||
VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (3), /**< pop two elements from the stack */
|
||||
VM_OC_GET_NONE = VM_OC_GET_ARGS_CREATE_INDEX (0), /**< do nothing */
|
||||
VM_OC_GET_BRANCH = VM_OC_GET_ARGS_CREATE_INDEX (1), /**< branch argument */
|
||||
VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2), /**< pop one element from the stack */
|
||||
VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (3), /**< pop two elements from the stack */
|
||||
|
||||
VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4), /**< resolve literal */
|
||||
VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5), /**< resolve two literals */
|
||||
VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6), /**< pop one element from the stack
|
||||
* and resolve a literal */
|
||||
VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (7), /**< get this and resolve a literal */
|
||||
VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4), /**< resolve literal */
|
||||
VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5), /**< resolve two literals */
|
||||
VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6), /**< pop one element from the stack
|
||||
* and resolve a literal */
|
||||
VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (7), /**< get this and resolve a literal */
|
||||
} vm_oc_get_types;
|
||||
|
||||
/**
|
||||
@@ -97,216 +98,216 @@ typedef enum
|
||||
/**
|
||||
* Extract the "group" opcode.
|
||||
*/
|
||||
#define VM_OC_GROUP_GET_INDEX(O) ((O) & VM_OC_GROUP_MASK)
|
||||
#define VM_OC_GROUP_GET_INDEX(O) ((O) &VM_OC_GROUP_MASK)
|
||||
|
||||
/**
|
||||
* Opcodes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_OC_POP, /**< pop from stack */
|
||||
VM_OC_POP_BLOCK, /**< pop block */
|
||||
VM_OC_PUSH, /**< push one literal */
|
||||
VM_OC_PUSH_TWO, /**< push two literals */
|
||||
VM_OC_PUSH_THREE, /**< push three literals */
|
||||
VM_OC_PUSH_UNDEFINED, /**< push undefined value */
|
||||
VM_OC_PUSH_TRUE, /**< push true value */
|
||||
VM_OC_PUSH_FALSE, /**< push false value */
|
||||
VM_OC_PUSH_NULL, /**< push null value */
|
||||
VM_OC_PUSH_THIS, /**< push this */
|
||||
VM_OC_PUSH_0, /**< push number zero */
|
||||
VM_OC_PUSH_POS_BYTE, /**< push number between 1 and 256 */
|
||||
VM_OC_PUSH_NEG_BYTE, /**< push number between -1 and -256 */
|
||||
VM_OC_PUSH_LIT_0, /**< push literal and number zero */
|
||||
VM_OC_PUSH_LIT_POS_BYTE, /**< push literal and number between 1 and 256 */
|
||||
VM_OC_PUSH_LIT_NEG_BYTE, /**< push literal and number between -1 and -256 */
|
||||
VM_OC_PUSH_OBJECT, /**< push object */
|
||||
VM_OC_PUSH_NAMED_FUNC_EXPR, /**< push named function expression */
|
||||
VM_OC_SET_PROPERTY, /**< set property */
|
||||
VM_OC_POP, /**< pop from stack */
|
||||
VM_OC_POP_BLOCK, /**< pop block */
|
||||
VM_OC_PUSH, /**< push one literal */
|
||||
VM_OC_PUSH_TWO, /**< push two literals */
|
||||
VM_OC_PUSH_THREE, /**< push three literals */
|
||||
VM_OC_PUSH_UNDEFINED, /**< push undefined value */
|
||||
VM_OC_PUSH_TRUE, /**< push true value */
|
||||
VM_OC_PUSH_FALSE, /**< push false value */
|
||||
VM_OC_PUSH_NULL, /**< push null value */
|
||||
VM_OC_PUSH_THIS, /**< push this */
|
||||
VM_OC_PUSH_0, /**< push number zero */
|
||||
VM_OC_PUSH_POS_BYTE, /**< push number between 1 and 256 */
|
||||
VM_OC_PUSH_NEG_BYTE, /**< push number between -1 and -256 */
|
||||
VM_OC_PUSH_LIT_0, /**< push literal and number zero */
|
||||
VM_OC_PUSH_LIT_POS_BYTE, /**< push literal and number between 1 and 256 */
|
||||
VM_OC_PUSH_LIT_NEG_BYTE, /**< push literal and number between -1 and -256 */
|
||||
VM_OC_PUSH_OBJECT, /**< push object */
|
||||
VM_OC_PUSH_NAMED_FUNC_EXPR, /**< push named function expression */
|
||||
VM_OC_SET_PROPERTY, /**< set property */
|
||||
|
||||
VM_OC_SET_GETTER, /**< set getter */
|
||||
VM_OC_SET_SETTER, /**< set setter */
|
||||
VM_OC_PUSH_ARRAY, /**< push array */
|
||||
VM_OC_PUSH_ELISON, /**< push elison */
|
||||
VM_OC_APPEND_ARRAY, /**< append array */
|
||||
VM_OC_IDENT_REFERENCE, /**< ident reference */
|
||||
VM_OC_PROP_REFERENCE, /**< prop reference */
|
||||
VM_OC_PROP_GET, /**< prop get */
|
||||
VM_OC_SET_GETTER, /**< set getter */
|
||||
VM_OC_SET_SETTER, /**< set setter */
|
||||
VM_OC_PUSH_ARRAY, /**< push array */
|
||||
VM_OC_PUSH_ELISON, /**< push elison */
|
||||
VM_OC_APPEND_ARRAY, /**< append array */
|
||||
VM_OC_IDENT_REFERENCE, /**< ident reference */
|
||||
VM_OC_PROP_REFERENCE, /**< prop reference */
|
||||
VM_OC_PROP_GET, /**< prop get */
|
||||
|
||||
/* These eight opcodes must be in this order. */
|
||||
VM_OC_PROP_PRE_INCR, /**< prefix increment of a property */
|
||||
VM_OC_PROP_PRE_DECR, /**< prop prefix decrement of a property */
|
||||
VM_OC_PROP_POST_INCR, /**< prop postfix increment of a property */
|
||||
VM_OC_PROP_POST_DECR, /**< prop postfix decrement of a property */
|
||||
VM_OC_PRE_INCR, /**< prefix increment */
|
||||
VM_OC_PRE_DECR, /**< prefix decrement */
|
||||
VM_OC_POST_INCR, /**< postfix increment */
|
||||
VM_OC_POST_DECR, /**< postfix decrement */
|
||||
VM_OC_PROP_PRE_INCR, /**< prefix increment of a property */
|
||||
VM_OC_PROP_PRE_DECR, /**< prop prefix decrement of a property */
|
||||
VM_OC_PROP_POST_INCR, /**< prop postfix increment of a property */
|
||||
VM_OC_PROP_POST_DECR, /**< prop postfix decrement of a property */
|
||||
VM_OC_PRE_INCR, /**< prefix increment */
|
||||
VM_OC_PRE_DECR, /**< prefix decrement */
|
||||
VM_OC_POST_INCR, /**< postfix increment */
|
||||
VM_OC_POST_DECR, /**< postfix decrement */
|
||||
|
||||
VM_OC_PROP_DELETE, /**< delete property */
|
||||
VM_OC_DELETE, /**< delete */
|
||||
VM_OC_PROP_DELETE, /**< delete property */
|
||||
VM_OC_DELETE, /**< delete */
|
||||
|
||||
VM_OC_MOV_IDENT, /**< move identifier register reference */
|
||||
VM_OC_ASSIGN, /**< assign */
|
||||
VM_OC_ASSIGN_PROP, /**< assign property */
|
||||
VM_OC_ASSIGN_PROP_THIS, /**< assign prop this */
|
||||
VM_OC_MOV_IDENT, /**< move identifier register reference */
|
||||
VM_OC_ASSIGN, /**< assign */
|
||||
VM_OC_ASSIGN_PROP, /**< assign property */
|
||||
VM_OC_ASSIGN_PROP_THIS, /**< assign prop this */
|
||||
|
||||
VM_OC_RETURN, /**< return */
|
||||
VM_OC_RETURN_FUNCTION_END, /**< return at the end of a function/script */
|
||||
VM_OC_THROW, /**< throw */
|
||||
VM_OC_THROW_REFERENCE_ERROR, /**< throw reference error */
|
||||
VM_OC_RETURN, /**< return */
|
||||
VM_OC_RETURN_FUNCTION_END, /**< return at the end of a function/script */
|
||||
VM_OC_THROW, /**< throw */
|
||||
VM_OC_THROW_REFERENCE_ERROR, /**< throw reference error */
|
||||
|
||||
VM_OC_EVAL, /**< eval */
|
||||
VM_OC_CALL, /**< call */
|
||||
VM_OC_NEW, /**< new */
|
||||
VM_OC_RESOLVE_BASE_FOR_CALL, /**< resolve base value before call */
|
||||
VM_OC_ERROR, /**< error while the vm_loop is suspended */
|
||||
VM_OC_EVAL, /**< eval */
|
||||
VM_OC_CALL, /**< call */
|
||||
VM_OC_NEW, /**< new */
|
||||
VM_OC_RESOLVE_BASE_FOR_CALL, /**< resolve base value before call */
|
||||
VM_OC_ERROR, /**< error while the vm_loop is suspended */
|
||||
|
||||
VM_OC_JUMP, /**< jump */
|
||||
VM_OC_JUMP, /**< jump */
|
||||
#if JERRY_ESNEXT
|
||||
VM_OC_BRANCH_IF_NULLISH, /** branch if undefined or null */
|
||||
VM_OC_BRANCH_IF_NULLISH, /** branch if undefined or null */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if strict equal */
|
||||
VM_OC_BRANCH_IF_STRICT_EQUAL, /**< branch if strict equal */
|
||||
|
||||
/* These four opcodes must be in this order. */
|
||||
VM_OC_BRANCH_IF_TRUE, /**< branch if true */
|
||||
VM_OC_BRANCH_IF_FALSE, /**< branch if false */
|
||||
VM_OC_BRANCH_IF_LOGICAL_TRUE, /**< branch if logical true */
|
||||
VM_OC_BRANCH_IF_TRUE, /**< branch if true */
|
||||
VM_OC_BRANCH_IF_FALSE, /**< branch if false */
|
||||
VM_OC_BRANCH_IF_LOGICAL_TRUE, /**< branch if logical true */
|
||||
VM_OC_BRANCH_IF_LOGICAL_FALSE, /**< branch if logical false */
|
||||
|
||||
VM_OC_PLUS, /**< unary plus */
|
||||
VM_OC_MINUS, /**< unary minus */
|
||||
VM_OC_NOT, /**< not */
|
||||
VM_OC_BIT_NOT, /**< bitwise not */
|
||||
VM_OC_VOID, /**< void */
|
||||
VM_OC_TYPEOF_IDENT, /**< typeof identifier */
|
||||
VM_OC_TYPEOF, /**< typeof */
|
||||
VM_OC_PLUS, /**< unary plus */
|
||||
VM_OC_MINUS, /**< unary minus */
|
||||
VM_OC_NOT, /**< not */
|
||||
VM_OC_BIT_NOT, /**< bitwise not */
|
||||
VM_OC_VOID, /**< void */
|
||||
VM_OC_TYPEOF_IDENT, /**< typeof identifier */
|
||||
VM_OC_TYPEOF, /**< typeof */
|
||||
|
||||
VM_OC_ADD, /**< binary add */
|
||||
VM_OC_SUB, /**< binary sub */
|
||||
VM_OC_MUL, /**< mul */
|
||||
VM_OC_DIV, /**< div */
|
||||
VM_OC_MOD, /**< mod */
|
||||
VM_OC_ADD, /**< binary add */
|
||||
VM_OC_SUB, /**< binary sub */
|
||||
VM_OC_MUL, /**< mul */
|
||||
VM_OC_DIV, /**< div */
|
||||
VM_OC_MOD, /**< mod */
|
||||
#if JERRY_ESNEXT
|
||||
VM_OC_EXP, /**< exponentiation */
|
||||
VM_OC_EXP, /**< exponentiation */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
VM_OC_EQUAL, /**< equal */
|
||||
VM_OC_NOT_EQUAL, /**< not equal */
|
||||
VM_OC_STRICT_EQUAL, /**< strict equal */
|
||||
VM_OC_STRICT_NOT_EQUAL, /**< strict not equal */
|
||||
VM_OC_LESS, /**< less */
|
||||
VM_OC_GREATER, /**< greater */
|
||||
VM_OC_LESS_EQUAL, /**< less equal */
|
||||
VM_OC_GREATER_EQUAL, /**< greater equal */
|
||||
VM_OC_IN, /**< in */
|
||||
VM_OC_INSTANCEOF, /**< instanceof */
|
||||
VM_OC_EQUAL, /**< equal */
|
||||
VM_OC_NOT_EQUAL, /**< not equal */
|
||||
VM_OC_STRICT_EQUAL, /**< strict equal */
|
||||
VM_OC_STRICT_NOT_EQUAL, /**< strict not equal */
|
||||
VM_OC_LESS, /**< less */
|
||||
VM_OC_GREATER, /**< greater */
|
||||
VM_OC_LESS_EQUAL, /**< less equal */
|
||||
VM_OC_GREATER_EQUAL, /**< greater equal */
|
||||
VM_OC_IN, /**< in */
|
||||
VM_OC_INSTANCEOF, /**< instanceof */
|
||||
|
||||
VM_OC_BIT_OR, /**< bitwise or */
|
||||
VM_OC_BIT_XOR, /**< bitwise xor */
|
||||
VM_OC_BIT_AND, /**< bitwise and */
|
||||
VM_OC_LEFT_SHIFT, /**< left shift */
|
||||
VM_OC_RIGHT_SHIFT, /**< right shift */
|
||||
VM_OC_UNS_RIGHT_SHIFT, /**< unsigned right shift */
|
||||
VM_OC_BIT_OR, /**< bitwise or */
|
||||
VM_OC_BIT_XOR, /**< bitwise xor */
|
||||
VM_OC_BIT_AND, /**< bitwise and */
|
||||
VM_OC_LEFT_SHIFT, /**< left shift */
|
||||
VM_OC_RIGHT_SHIFT, /**< right shift */
|
||||
VM_OC_UNS_RIGHT_SHIFT, /**< unsigned right shift */
|
||||
|
||||
VM_OC_BLOCK_CREATE_CONTEXT, /**< create lexical environment for blocks enclosed in braces */
|
||||
VM_OC_WITH, /**< with */
|
||||
VM_OC_FOR_IN_INIT, /**< for-in init context */
|
||||
VM_OC_FOR_IN_GET_NEXT, /**< get next */
|
||||
VM_OC_FOR_IN_HAS_NEXT, /**< has next */
|
||||
VM_OC_BLOCK_CREATE_CONTEXT, /**< create lexical environment for blocks enclosed in braces */
|
||||
VM_OC_WITH, /**< with */
|
||||
VM_OC_FOR_IN_INIT, /**< for-in init context */
|
||||
VM_OC_FOR_IN_GET_NEXT, /**< get next */
|
||||
VM_OC_FOR_IN_HAS_NEXT, /**< has next */
|
||||
|
||||
VM_OC_TRY, /**< try */
|
||||
VM_OC_CATCH, /**< catch */
|
||||
VM_OC_FINALLY, /**< finally */
|
||||
VM_OC_CONTEXT_END, /**< context end */
|
||||
VM_OC_JUMP_AND_EXIT_CONTEXT, /**< jump and exit context */
|
||||
VM_OC_TRY, /**< try */
|
||||
VM_OC_CATCH, /**< catch */
|
||||
VM_OC_FINALLY, /**< finally */
|
||||
VM_OC_CONTEXT_END, /**< context end */
|
||||
VM_OC_JUMP_AND_EXIT_CONTEXT, /**< jump and exit context */
|
||||
|
||||
VM_OC_CREATE_BINDING, /**< create variables */
|
||||
VM_OC_CREATE_ARGUMENTS, /**< create arguments object */
|
||||
VM_OC_SET_BYTECODE_PTR, /**< setting bytecode pointer */
|
||||
VM_OC_VAR_EVAL, /**< variable and function evaluation */
|
||||
VM_OC_CREATE_BINDING, /**< create variables */
|
||||
VM_OC_CREATE_ARGUMENTS, /**< create arguments object */
|
||||
VM_OC_SET_BYTECODE_PTR, /**< setting bytecode pointer */
|
||||
VM_OC_VAR_EVAL, /**< variable and function evaluation */
|
||||
#if JERRY_ESNEXT
|
||||
VM_OC_EXT_VAR_EVAL, /**< variable and function evaluation for
|
||||
* functions with separate argument context */
|
||||
VM_OC_EXT_VAR_EVAL, /**< variable and function evaluation for
|
||||
* functions with separate argument context */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
VM_OC_INIT_ARG_OR_FUNC, /**< create and init a function or argument binding */
|
||||
VM_OC_INIT_ARG_OR_FUNC, /**< create and init a function or argument binding */
|
||||
|
||||
#if JERRY_DEBUGGER
|
||||
VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */
|
||||
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
|
||||
VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */
|
||||
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
#if JERRY_ESNEXT
|
||||
VM_OC_CHECK_VAR, /**< check redeclared vars in the global scope */
|
||||
VM_OC_CHECK_LET, /**< check redeclared lets in the global scope */
|
||||
VM_OC_ASSIGN_LET_CONST, /**< assign values to let/const declarations */
|
||||
VM_OC_INIT_BINDING, /**< create and intialize a binding */
|
||||
VM_OC_THROW_CONST_ERROR, /**< throw invalid assignment to const variable error */
|
||||
VM_OC_COPY_TO_GLOBAL, /**< copy value to global lex env */
|
||||
VM_OC_COPY_FROM_ARG, /**< copy value from arg lex env */
|
||||
VM_OC_CLONE_CONTEXT, /**< clone lexical environment with let/const declarations */
|
||||
VM_OC_COPY_DATA_PROPERTIES, /**< copy data properties of an object */
|
||||
VM_OC_SET_COMPUTED_PROPERTY, /**< set computed property */
|
||||
VM_OC_CHECK_VAR, /**< check redeclared vars in the global scope */
|
||||
VM_OC_CHECK_LET, /**< check redeclared lets in the global scope */
|
||||
VM_OC_ASSIGN_LET_CONST, /**< assign values to let/const declarations */
|
||||
VM_OC_INIT_BINDING, /**< create and intialize a binding */
|
||||
VM_OC_THROW_CONST_ERROR, /**< throw invalid assignment to const variable error */
|
||||
VM_OC_COPY_TO_GLOBAL, /**< copy value to global lex env */
|
||||
VM_OC_COPY_FROM_ARG, /**< copy value from arg lex env */
|
||||
VM_OC_CLONE_CONTEXT, /**< clone lexical environment with let/const declarations */
|
||||
VM_OC_COPY_DATA_PROPERTIES, /**< copy data properties of an object */
|
||||
VM_OC_SET_COMPUTED_PROPERTY, /**< set computed property */
|
||||
|
||||
VM_OC_FOR_OF_INIT, /**< for-of init context */
|
||||
VM_OC_FOR_OF_GET_NEXT, /**< for-of get next */
|
||||
VM_OC_FOR_OF_HAS_NEXT, /**< for-of has next */
|
||||
VM_OC_FOR_AWAIT_OF_INIT, /**< for-await-of init context */
|
||||
VM_OC_FOR_AWAIT_OF_HAS_NEXT, /**< for-await-of has next */
|
||||
VM_OC_FOR_OF_INIT, /**< for-of init context */
|
||||
VM_OC_FOR_OF_GET_NEXT, /**< for-of get next */
|
||||
VM_OC_FOR_OF_HAS_NEXT, /**< for-of has next */
|
||||
VM_OC_FOR_AWAIT_OF_INIT, /**< for-await-of init context */
|
||||
VM_OC_FOR_AWAIT_OF_HAS_NEXT, /**< for-await-of has next */
|
||||
|
||||
VM_OC_LOCAL_EVAL, /**< eval in local context */
|
||||
VM_OC_SUPER_CALL, /**< call the 'super' constructor */
|
||||
VM_OC_PUSH_CLASS_ENVIRONMENT, /**< push class environment */
|
||||
VM_OC_PUSH_IMPLICIT_CTOR, /**< create implicit class constructor */
|
||||
VM_OC_INIT_CLASS, /**< initialize class */
|
||||
VM_OC_FINALIZE_CLASS, /**< finalize class */
|
||||
VM_OC_SET_FIELD_INIT, /**< store the class field initializer function */
|
||||
VM_OC_SET_STATIC_FIELD_INIT, /**< store the static class field initializer function */
|
||||
VM_OC_RUN_FIELD_INIT, /**< run the class field initializer function */
|
||||
VM_OC_RUN_STATIC_FIELD_INIT, /**< run the static class field initializer function */
|
||||
VM_OC_LOCAL_EVAL, /**< eval in local context */
|
||||
VM_OC_SUPER_CALL, /**< call the 'super' constructor */
|
||||
VM_OC_PUSH_CLASS_ENVIRONMENT, /**< push class environment */
|
||||
VM_OC_PUSH_IMPLICIT_CTOR, /**< create implicit class constructor */
|
||||
VM_OC_INIT_CLASS, /**< initialize class */
|
||||
VM_OC_FINALIZE_CLASS, /**< finalize class */
|
||||
VM_OC_SET_FIELD_INIT, /**< store the class field initializer function */
|
||||
VM_OC_SET_STATIC_FIELD_INIT, /**< store the static class field initializer function */
|
||||
VM_OC_RUN_FIELD_INIT, /**< run the class field initializer function */
|
||||
VM_OC_RUN_STATIC_FIELD_INIT, /**< run the static class field initializer function */
|
||||
VM_OC_SET_NEXT_COMPUTED_FIELD, /**< set the next computed field of a class */
|
||||
VM_OC_PUSH_SUPER_CONSTRUCTOR, /**< getSuperConstructor operation */
|
||||
VM_OC_RESOLVE_LEXICAL_THIS, /**< resolve this_binding from from the lexical environment */
|
||||
VM_OC_SUPER_REFERENCE, /**< push super reference */
|
||||
VM_OC_SET_HOME_OBJECT, /**< set the [[HomeObject]] environment in an object literal */
|
||||
VM_OC_PUSH_SUPER_CONSTRUCTOR, /**< getSuperConstructor operation */
|
||||
VM_OC_RESOLVE_LEXICAL_THIS, /**< resolve this_binding from from the lexical environment */
|
||||
VM_OC_SUPER_REFERENCE, /**< push super reference */
|
||||
VM_OC_SET_HOME_OBJECT, /**< set the [[HomeObject]] environment in an object literal */
|
||||
VM_OC_OBJECT_LITERAL_HOME_ENV, /**< create/destroy [[HomeObject]] environment of an object literal */
|
||||
VM_OC_SET_FUNCTION_NAME, /**< set function name property */
|
||||
VM_OC_SET_FUNCTION_NAME, /**< set function name property */
|
||||
|
||||
VM_OC_PUSH_SPREAD_ELEMENT, /**< push spread element */
|
||||
VM_OC_PUSH_REST_OBJECT, /**< push rest object */
|
||||
VM_OC_PUSH_SPREAD_ELEMENT, /**< push spread element */
|
||||
VM_OC_PUSH_REST_OBJECT, /**< push rest object */
|
||||
VM_OC_ITERATOR_CONTEXT_CREATE, /**< create iterator conext */
|
||||
VM_OC_ITERATOR_CONTEXT_END, /**< finalize iterator cotnext */
|
||||
VM_OC_ITERATOR_STEP, /**< IteratorStep abstract operation */
|
||||
VM_OC_ITERATOR_CONTEXT_END, /**< finalize iterator cotnext */
|
||||
VM_OC_ITERATOR_STEP, /**< IteratorStep abstract operation */
|
||||
VM_OC_OBJ_INIT_CONTEXT_CREATE, /**< create object initializer context */
|
||||
VM_OC_OBJ_INIT_CONTEXT_END, /**< finalize object initializer context */
|
||||
VM_OC_OBJ_INIT_PUSH_REST, /**< push the object with the rest properties */
|
||||
VM_OC_INITIALIZER_PUSH_NAME, /**< append string to name list array and push the string */
|
||||
VM_OC_DEFAULT_INITIALIZER, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP, /**< push property for object initializer */
|
||||
VM_OC_SPREAD_ARGUMENTS, /**< perform function call/construct with spreaded arguments */
|
||||
VM_OC_CREATE_GENERATOR, /**< create a generator object */
|
||||
VM_OC_YIELD, /**< yield operation */
|
||||
VM_OC_ASYNC_YIELD, /**< async yield operation */
|
||||
VM_OC_ASYNC_YIELD_ITERATOR, /**< async yield iterator operation */
|
||||
VM_OC_AWAIT, /**< await operation */
|
||||
VM_OC_GENERATOR_AWAIT, /**< generator await operation */
|
||||
VM_OC_EXT_RETURN, /**< return which also clears the stack */
|
||||
VM_OC_ASYNC_EXIT, /**< return from async function */
|
||||
VM_OC_STRING_CONCAT, /**< string concatenation */
|
||||
VM_OC_GET_TEMPLATE_OBJECT, /**< GetTemplateObject operation */
|
||||
VM_OC_PUSH_NEW_TARGET, /**< push new.target onto the stack */
|
||||
VM_OC_REQUIRE_OBJECT_COERCIBLE,/**< RequireObjectCoercible opretaion */
|
||||
VM_OC_ASSIGN_SUPER, /**< assign super reference */
|
||||
VM_OC_SET__PROTO__, /**< set prototype when __proto__: form is used */
|
||||
VM_OC_PUSH_STATIC_FIELD_FUNC, /**< push static field initializer function */
|
||||
VM_OC_ADD_COMPUTED_FIELD, /**< add computed field name */
|
||||
VM_OC_OBJ_INIT_CONTEXT_END, /**< finalize object initializer context */
|
||||
VM_OC_OBJ_INIT_PUSH_REST, /**< push the object with the rest properties */
|
||||
VM_OC_INITIALIZER_PUSH_NAME, /**< append string to name list array and push the string */
|
||||
VM_OC_DEFAULT_INITIALIZER, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP, /**< push property for object initializer */
|
||||
VM_OC_SPREAD_ARGUMENTS, /**< perform function call/construct with spreaded arguments */
|
||||
VM_OC_CREATE_GENERATOR, /**< create a generator object */
|
||||
VM_OC_YIELD, /**< yield operation */
|
||||
VM_OC_ASYNC_YIELD, /**< async yield operation */
|
||||
VM_OC_ASYNC_YIELD_ITERATOR, /**< async yield iterator operation */
|
||||
VM_OC_AWAIT, /**< await operation */
|
||||
VM_OC_GENERATOR_AWAIT, /**< generator await operation */
|
||||
VM_OC_EXT_RETURN, /**< return which also clears the stack */
|
||||
VM_OC_ASYNC_EXIT, /**< return from async function */
|
||||
VM_OC_STRING_CONCAT, /**< string concatenation */
|
||||
VM_OC_GET_TEMPLATE_OBJECT, /**< GetTemplateObject operation */
|
||||
VM_OC_PUSH_NEW_TARGET, /**< push new.target onto the stack */
|
||||
VM_OC_REQUIRE_OBJECT_COERCIBLE, /**< RequireObjectCoercible opretaion */
|
||||
VM_OC_ASSIGN_SUPER, /**< assign super reference */
|
||||
VM_OC_SET__PROTO__, /**< set prototype when __proto__: form is used */
|
||||
VM_OC_PUSH_STATIC_FIELD_FUNC, /**< push static field initializer function */
|
||||
VM_OC_ADD_COMPUTED_FIELD, /**< add computed field name */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
#if JERRY_MODULE_SYSTEM
|
||||
VM_OC_MODULE_IMPORT, /**< module dynamic import */
|
||||
VM_OC_MODULE_IMPORT_META, /**< module import.meta */
|
||||
VM_OC_MODULE_IMPORT, /**< module dynamic import */
|
||||
VM_OC_MODULE_IMPORT_META, /**< module import.meta */
|
||||
#endif /* JERRY_MODULE_SYSTEM */
|
||||
|
||||
VM_OC_NONE, /**< a special opcode for unsupported byte codes */
|
||||
VM_OC_NONE, /**< a special opcode for unsupported byte codes */
|
||||
} vm_oc_types;
|
||||
|
||||
/**
|
||||
@@ -315,87 +316,87 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
#if !JERRY_ESNEXT
|
||||
VM_OC_EXP = VM_OC_NONE, /**< exponentiation */
|
||||
VM_OC_BRANCH_IF_NULLISH = VM_OC_NONE, /** branch if undefined or null */
|
||||
VM_OC_EXP = VM_OC_NONE, /**< exponentiation */
|
||||
VM_OC_BRANCH_IF_NULLISH = VM_OC_NONE, /** branch if undefined or null */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
#if !JERRY_DEBUGGER
|
||||
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */
|
||||
VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */
|
||||
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */
|
||||
VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */
|
||||
#endif /* !JERRY_DEBUGGER */
|
||||
#if !JERRY_ESNEXT
|
||||
VM_OC_EXT_VAR_EVAL = VM_OC_NONE, /**< variable and function evaluation for
|
||||
* functions with separate argument context */
|
||||
VM_OC_CHECK_VAR = VM_OC_NONE, /**< check redeclared vars in the global scope */
|
||||
VM_OC_CHECK_LET = VM_OC_NONE, /**< check redeclared lets in the global scope */
|
||||
VM_OC_ASSIGN_LET_CONST = VM_OC_NONE, /**< assign values to let/const declarations */
|
||||
VM_OC_INIT_BINDING = VM_OC_NONE, /**< create and intialize a binding */
|
||||
VM_OC_THROW_CONST_ERROR = VM_OC_NONE, /**< throw invalid assignment to const variable error */
|
||||
VM_OC_COPY_TO_GLOBAL = VM_OC_NONE, /**< copy value to global lex env */
|
||||
VM_OC_COPY_FROM_ARG = VM_OC_NONE, /**< copy value from arg lex env */
|
||||
VM_OC_CLONE_CONTEXT = VM_OC_NONE, /**< clone lexical environment with let/const declarations */
|
||||
VM_OC_COPY_DATA_PROPERTIES = VM_OC_NONE, /**< copy data properties of an object */
|
||||
VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */
|
||||
VM_OC_EXT_VAR_EVAL = VM_OC_NONE, /**< variable and function evaluation for
|
||||
* functions with separate argument context */
|
||||
VM_OC_CHECK_VAR = VM_OC_NONE, /**< check redeclared vars in the global scope */
|
||||
VM_OC_CHECK_LET = VM_OC_NONE, /**< check redeclared lets in the global scope */
|
||||
VM_OC_ASSIGN_LET_CONST = VM_OC_NONE, /**< assign values to let/const declarations */
|
||||
VM_OC_INIT_BINDING = VM_OC_NONE, /**< create and intialize a binding */
|
||||
VM_OC_THROW_CONST_ERROR = VM_OC_NONE, /**< throw invalid assignment to const variable error */
|
||||
VM_OC_COPY_TO_GLOBAL = VM_OC_NONE, /**< copy value to global lex env */
|
||||
VM_OC_COPY_FROM_ARG = VM_OC_NONE, /**< copy value from arg lex env */
|
||||
VM_OC_CLONE_CONTEXT = VM_OC_NONE, /**< clone lexical environment with let/const declarations */
|
||||
VM_OC_COPY_DATA_PROPERTIES = VM_OC_NONE, /**< copy data properties of an object */
|
||||
VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */
|
||||
|
||||
VM_OC_FOR_OF_INIT = VM_OC_NONE, /**< for-of init context */
|
||||
VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< for-of get next */
|
||||
VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< for-of has next */
|
||||
VM_OC_FOR_AWAIT_OF_INIT = VM_OC_NONE, /**< for-await-of init context */
|
||||
VM_OC_FOR_AWAIT_OF_HAS_NEXT = VM_OC_NONE, /**< for-await-of has next */
|
||||
VM_OC_FOR_OF_INIT = VM_OC_NONE, /**< for-of init context */
|
||||
VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< for-of get next */
|
||||
VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< for-of has next */
|
||||
VM_OC_FOR_AWAIT_OF_INIT = VM_OC_NONE, /**< for-await-of init context */
|
||||
VM_OC_FOR_AWAIT_OF_HAS_NEXT = VM_OC_NONE, /**< for-await-of has next */
|
||||
|
||||
VM_OC_LOCAL_EVAL = VM_OC_NONE, /**< eval in local context */
|
||||
VM_OC_SUPER_CALL = VM_OC_NONE, /**< call the 'super' constructor */
|
||||
VM_OC_PUSH_CLASS_ENVIRONMENT = VM_OC_NONE, /**< push class environment */
|
||||
VM_OC_PUSH_IMPLICIT_CTOR = VM_OC_NONE, /**< create implicit class constructor */
|
||||
VM_OC_INIT_CLASS = VM_OC_NONE, /**< initialize class */
|
||||
VM_OC_FINALIZE_CLASS = VM_OC_NONE, /**< finalize class */
|
||||
VM_OC_SET_FIELD_INIT = VM_OC_NONE, /**< store the class field initializer function */
|
||||
VM_OC_SET_STATIC_FIELD_INIT = VM_OC_NONE, /**< store the static class field initializer function */
|
||||
VM_OC_RUN_FIELD_INIT = VM_OC_NONE, /**< run the class field initializer function */
|
||||
VM_OC_RUN_STATIC_FIELD_INIT = VM_OC_NONE, /**< run the static class field initializer function */
|
||||
VM_OC_LOCAL_EVAL = VM_OC_NONE, /**< eval in local context */
|
||||
VM_OC_SUPER_CALL = VM_OC_NONE, /**< call the 'super' constructor */
|
||||
VM_OC_PUSH_CLASS_ENVIRONMENT = VM_OC_NONE, /**< push class environment */
|
||||
VM_OC_PUSH_IMPLICIT_CTOR = VM_OC_NONE, /**< create implicit class constructor */
|
||||
VM_OC_INIT_CLASS = VM_OC_NONE, /**< initialize class */
|
||||
VM_OC_FINALIZE_CLASS = VM_OC_NONE, /**< finalize class */
|
||||
VM_OC_SET_FIELD_INIT = VM_OC_NONE, /**< store the class field initializer function */
|
||||
VM_OC_SET_STATIC_FIELD_INIT = VM_OC_NONE, /**< store the static class field initializer function */
|
||||
VM_OC_RUN_FIELD_INIT = VM_OC_NONE, /**< run the class field initializer function */
|
||||
VM_OC_RUN_STATIC_FIELD_INIT = VM_OC_NONE, /**< run the static class field initializer function */
|
||||
VM_OC_SET_NEXT_COMPUTED_FIELD = VM_OC_NONE, /**< set the next computed field of a class */
|
||||
VM_OC_PUSH_SUPER_CONSTRUCTOR = VM_OC_NONE, /**< getSuperConstructor operation */
|
||||
VM_OC_RESOLVE_LEXICAL_THIS = VM_OC_NONE, /**< resolve this_binding from from the lexical environment */
|
||||
VM_OC_SUPER_REFERENCE = VM_OC_NONE, /**< push super reference */
|
||||
VM_OC_SET_HOME_OBJECT = VM_OC_NONE, /**< set the [[HomeObject]] internal property in an object literal */
|
||||
VM_OC_PUSH_SUPER_CONSTRUCTOR = VM_OC_NONE, /**< getSuperConstructor operation */
|
||||
VM_OC_RESOLVE_LEXICAL_THIS = VM_OC_NONE, /**< resolve this_binding from from the lexical environment */
|
||||
VM_OC_SUPER_REFERENCE = VM_OC_NONE, /**< push super reference */
|
||||
VM_OC_SET_HOME_OBJECT = VM_OC_NONE, /**< set the [[HomeObject]] internal property in an object literal */
|
||||
VM_OC_OBJECT_LITERAL_HOME_ENV = VM_OC_NONE, /**< create/destroy [[HomeObject]] environment of an object literal */
|
||||
VM_OC_SET_FUNCTION_NAME = VM_OC_NONE, /**< set function name property */
|
||||
VM_OC_SET_FUNCTION_NAME = VM_OC_NONE, /**< set function name property */
|
||||
|
||||
VM_OC_PUSH_SPREAD_ELEMENT = VM_OC_NONE, /**< push spread element */
|
||||
VM_OC_PUSH_REST_OBJECT = VM_OC_NONE, /**< push rest object */
|
||||
VM_OC_PUSH_SPREAD_ELEMENT = VM_OC_NONE, /**< push spread element */
|
||||
VM_OC_PUSH_REST_OBJECT = VM_OC_NONE, /**< push rest object */
|
||||
VM_OC_ITERATOR_CONTEXT_CREATE = VM_OC_NONE, /**< create iterator context */
|
||||
VM_OC_ITERATOR_STEP = VM_OC_NONE, /**< IteratorStep abstract operation */
|
||||
VM_OC_ITERATOR_CONTEXT_END = VM_OC_NONE, /**< finalize iterator cotnext */
|
||||
VM_OC_ITERATOR_STEP = VM_OC_NONE, /**< IteratorStep abstract operation */
|
||||
VM_OC_ITERATOR_CONTEXT_END = VM_OC_NONE, /**< finalize iterator cotnext */
|
||||
VM_OC_OBJ_INIT_CONTEXT_CREATE = VM_OC_NONE, /**< create object initializer context */
|
||||
VM_OC_OBJ_INIT_CONTEXT_END = VM_OC_NONE, /**< finalize object initializer context */
|
||||
VM_OC_OBJ_INIT_PUSH_REST = VM_OC_NONE, /**< push the object with the rest properties */
|
||||
VM_OC_INITIALIZER_PUSH_NAME = VM_OC_NONE, /**< append string to name list array and push the string */
|
||||
VM_OC_DEFAULT_INITIALIZER = VM_OC_NONE, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER = VM_OC_NONE, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP = VM_OC_NONE, /**< push property for object initializer */
|
||||
VM_OC_SPREAD_ARGUMENTS = VM_OC_NONE, /**< perform function call/construct with spreaded arguments */
|
||||
VM_OC_CREATE_GENERATOR = VM_OC_NONE, /**< create a generator object */
|
||||
VM_OC_YIELD = VM_OC_NONE, /**< yield operation */
|
||||
VM_OC_ASYNC_YIELD = VM_OC_NONE, /**< async yield operation */
|
||||
VM_OC_ASYNC_YIELD_ITERATOR = VM_OC_NONE, /**< async yield iterator operation */
|
||||
VM_OC_AWAIT = VM_OC_NONE, /**< await operation */
|
||||
VM_OC_GENERATOR_AWAIT = VM_OC_NONE, /**< generator await operation */
|
||||
VM_OC_EXT_RETURN = VM_OC_NONE, /**< return which also clears the stack */
|
||||
VM_OC_ASYNC_EXIT = VM_OC_NONE, /**< return from async function */
|
||||
VM_OC_STRING_CONCAT = VM_OC_NONE, /**< string concatenation */
|
||||
VM_OC_GET_TEMPLATE_OBJECT = VM_OC_NONE, /**< GetTemplateObject operation */
|
||||
VM_OC_PUSH_NEW_TARGET = VM_OC_NONE, /**< push new.target onto the stack */
|
||||
VM_OC_REQUIRE_OBJECT_COERCIBLE = VM_OC_NONE,/**< RequireObjectCoercible opretaion */
|
||||
VM_OC_ASSIGN_SUPER = VM_OC_NONE, /**< assign super reference */
|
||||
VM_OC_SET__PROTO__ = VM_OC_NONE, /**< set prototype when __proto__: form is used */
|
||||
VM_OC_PUSH_STATIC_FIELD_FUNC = VM_OC_NONE, /**< push static field initializer function */
|
||||
VM_OC_ADD_COMPUTED_FIELD = VM_OC_NONE, /**< add computed field name */
|
||||
VM_OC_OBJ_INIT_CONTEXT_END = VM_OC_NONE, /**< finalize object initializer context */
|
||||
VM_OC_OBJ_INIT_PUSH_REST = VM_OC_NONE, /**< push the object with the rest properties */
|
||||
VM_OC_INITIALIZER_PUSH_NAME = VM_OC_NONE, /**< append string to name list array and push the string */
|
||||
VM_OC_DEFAULT_INITIALIZER = VM_OC_NONE, /**< default initializer inside a pattern */
|
||||
VM_OC_REST_INITIALIZER = VM_OC_NONE, /**< create rest object inside an array pattern */
|
||||
VM_OC_INITIALIZER_PUSH_PROP = VM_OC_NONE, /**< push property for object initializer */
|
||||
VM_OC_SPREAD_ARGUMENTS = VM_OC_NONE, /**< perform function call/construct with spreaded arguments */
|
||||
VM_OC_CREATE_GENERATOR = VM_OC_NONE, /**< create a generator object */
|
||||
VM_OC_YIELD = VM_OC_NONE, /**< yield operation */
|
||||
VM_OC_ASYNC_YIELD = VM_OC_NONE, /**< async yield operation */
|
||||
VM_OC_ASYNC_YIELD_ITERATOR = VM_OC_NONE, /**< async yield iterator operation */
|
||||
VM_OC_AWAIT = VM_OC_NONE, /**< await operation */
|
||||
VM_OC_GENERATOR_AWAIT = VM_OC_NONE, /**< generator await operation */
|
||||
VM_OC_EXT_RETURN = VM_OC_NONE, /**< return which also clears the stack */
|
||||
VM_OC_ASYNC_EXIT = VM_OC_NONE, /**< return from async function */
|
||||
VM_OC_STRING_CONCAT = VM_OC_NONE, /**< string concatenation */
|
||||
VM_OC_GET_TEMPLATE_OBJECT = VM_OC_NONE, /**< GetTemplateObject operation */
|
||||
VM_OC_PUSH_NEW_TARGET = VM_OC_NONE, /**< push new.target onto the stack */
|
||||
VM_OC_REQUIRE_OBJECT_COERCIBLE = VM_OC_NONE, /**< RequireObjectCoercible opretaion */
|
||||
VM_OC_ASSIGN_SUPER = VM_OC_NONE, /**< assign super reference */
|
||||
VM_OC_SET__PROTO__ = VM_OC_NONE, /**< set prototype when __proto__: form is used */
|
||||
VM_OC_PUSH_STATIC_FIELD_FUNC = VM_OC_NONE, /**< push static field initializer function */
|
||||
VM_OC_ADD_COMPUTED_FIELD = VM_OC_NONE, /**< add computed field name */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
#if !JERRY_MODULE_SYSTEM
|
||||
VM_OC_MODULE_IMPORT = VM_OC_NONE, /**< module dynamic import */
|
||||
VM_OC_MODULE_IMPORT_META = VM_OC_NONE, /**< module import.meta */
|
||||
VM_OC_MODULE_IMPORT = VM_OC_NONE, /**< module dynamic import */
|
||||
VM_OC_MODULE_IMPORT_META = VM_OC_NONE, /**< module import.meta */
|
||||
#endif /* JERRY_MODULE_SYSTEM */
|
||||
|
||||
VM_OC_UNUSED = VM_OC_NONE /**< placeholder if the list is empty */
|
||||
VM_OC_UNUSED = VM_OC_NONE /**< placeholder if the list is empty */
|
||||
} vm_oc_unused_types;
|
||||
|
||||
/**
|
||||
@@ -446,7 +447,7 @@ typedef enum
|
||||
/**
|
||||
* Generate a "put result" opcode flag bit.
|
||||
*/
|
||||
#define VM_OC_PUT_RESULT_CREATE_FLAG(V) (((V) & VM_OC_PUT_RESULT_MASK) << VM_OC_PUT_RESULT_SHIFT)
|
||||
#define VM_OC_PUT_RESULT_CREATE_FLAG(V) (((V) &VM_OC_PUT_RESULT_MASK) << VM_OC_PUT_RESULT_SHIFT)
|
||||
|
||||
/**
|
||||
* Checks whether the result is stored somewhere.
|
||||
@@ -472,12 +473,12 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
VM_NO_EXEC_OP, /**< do nothing */
|
||||
VM_EXEC_CALL, /**< invoke a function */
|
||||
VM_EXEC_SUPER_CALL, /**< invoke a function through 'super' keyword */
|
||||
VM_EXEC_SPREAD_OP, /**< call/construct operation with spreaded argument list */
|
||||
VM_EXEC_RETURN, /**< return with the completion value without freeing registers */
|
||||
VM_EXEC_CONSTRUCT, /**< construct a new object */
|
||||
VM_NO_EXEC_OP, /**< do nothing */
|
||||
VM_EXEC_CALL, /**< invoke a function */
|
||||
VM_EXEC_SUPER_CALL, /**< invoke a function through 'super' keyword */
|
||||
VM_EXEC_SPREAD_OP, /**< call/construct operation with spreaded argument list */
|
||||
VM_EXEC_RETURN, /**< return with the completion value without freeing registers */
|
||||
VM_EXEC_CONSTRUCT, /**< construct a new object */
|
||||
} vm_call_operation;
|
||||
|
||||
ecma_value_t vm_run_global (const ecma_compiled_code_t *bytecode_p, ecma_object_t *function_object_p);
|
||||
|
||||
Reference in New Issue
Block a user