Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20017,29 +20017,36 @@ typedef struct JSFunctionDef {
struct list_head child_list; /* list of JSFunctionDef.link */
struct list_head link;

bool is_eval; /* true if eval code */
int eval_type; /* only valid if is_eval = true */
bool is_global_var; /* true if variables are not defined locally:

/* Pack all boolean flags together as 1-bit fields to reduce struct size
while avoiding padding and compiler deoptimization. */
bool is_eval : 1; /* true if eval code */
bool is_global_var : 1; /* true if variables are not defined locally:
eval global, eval module or non strict eval */
bool is_func_expr; /* true if function expression */
bool has_home_object; /* true if the home object is available */
bool has_prototype; /* true if a prototype field is necessary */
bool has_simple_parameter_list;
bool has_parameter_expressions; /* if true, an argument scope is created */
bool has_use_strict; /* to reject directive in special cases */
bool has_eval_call; /* true if the function contains a call to eval() */
bool has_arguments_binding; /* true if the 'arguments' binding is
bool is_func_expr : 1; /* true if function expression */
bool has_home_object : 1; /* true if the home object is available */
bool has_prototype : 1; /* true if a prototype field is necessary */
bool has_simple_parameter_list : 1;
bool has_parameter_expressions : 1; /* if true, an argument scope is created */
bool has_use_strict : 1; /* to reject directive in special cases */
bool has_eval_call : 1; /* true if the function contains a call to eval() */
bool has_arguments_binding : 1; /* true if the 'arguments' binding is
available in the function */
bool has_this_binding; /* true if the 'this' and new.target binding are
bool has_this_binding : 1; /* true if the 'this' and new.target binding are
available in the function */
bool new_target_allowed; /* true if the 'new.target' does not
bool new_target_allowed : 1; /* true if the 'new.target' does not
throw a syntax error */
bool super_call_allowed; /* true if super() is allowed */
bool super_allowed; /* true if super. or super[] is allowed */
bool arguments_allowed; /* true if the 'arguments' identifier is allowed */
bool is_derived_class_constructor;
bool in_function_body;
bool backtrace_barrier;
bool super_call_allowed : 1; /* true if super() is allowed */
bool super_allowed : 1; /* true if super. or super[] is allowed */
bool arguments_allowed : 1; /* true if the 'arguments' identifier is allowed */
bool is_derived_class_constructor : 1;
bool in_function_body : 1;
bool backtrace_barrier : 1;
bool need_home_object : 1;
bool use_short_opcodes : 1; /* true if short opcodes are used in byte_code */
bool has_await : 1; /* true if await is used (used in module eval) */

JSFunctionKindEnum func_kind : 8;
JSParseFunctionEnum func_type : 7;
uint8_t is_strict_mode : 1;
Expand All @@ -20065,7 +20072,6 @@ typedef struct JSFunctionDef {
int new_target_var_idx; /* variable containg the 'new.target' value, -1 if none */
int this_active_func_var_idx; /* variable containg the 'this.active_func' value, -1 if none */
int home_object_var_idx;
bool need_home_object;

int scope_level; /* index into fd->scopes if the current lexical scope */
int scope_first; /* index into vd->vars of first lexically scoped variable */
Expand All @@ -20081,7 +20087,6 @@ typedef struct JSFunctionDef {

DynBuf byte_code;
int last_opcode_pos; /* -1 if no last opcode */
bool use_short_opcodes; /* true if short opcodes are used in byte_code */

LabelSlot *label_slots;
int label_size; /* allocated size for label_slots[] */
Expand Down Expand Up @@ -20119,7 +20124,6 @@ typedef struct JSFunctionDef {
int source_len;

JSModuleDef *module; /* != NULL when parsing a module */
bool has_await; /* true if await is used (used in module eval) */
} JSFunctionDef;

typedef struct JSToken {
Expand Down