@ -546,7 +546,7 @@ DUK_LOCAL void duk__init_func_valstack_slots(duk_compiler_ctx *comp_ctx) {
duk_push_dynamic_buffer ( ctx , 0 ) ;
func - > labelinfos_idx = entry_top + 5 ;
func - > h_labelinfos = ( duk_hbuffer_dynamic * ) duk_get _hbuffer ( ctx , entry_top + 5 ) ;
func - > h_labelinfos = ( duk_hbuffer_dynamic * ) duk_known _hbuffer ( ctx , entry_top + 5 ) ;
DUK_ASSERT ( func - > h_labelinfos ! = NULL ) ;
DUK_ASSERT ( DUK_HBUFFER_HAS_DYNAMIC ( func - > h_labelinfos ) & & ! DUK_HBUFFER_HAS_EXTERNAL ( func - > h_labelinfos ) ) ;
@ -743,8 +743,7 @@ DUK_LOCAL void duk__convert_to_func_template(duk_compiler_ctx *comp_ctx, duk_boo
( long ) code_size , ( long ) data_size ) ) ;
duk_push_fixed_buffer_nozero ( ctx , data_size ) ;
h_data = ( duk_hbuffer_fixed * ) duk_get_hbuffer ( ctx , - 1 ) ;
DUK_ASSERT ( h_data ! = NULL ) ;
h_data = ( duk_hbuffer_fixed * ) duk_known_hbuffer ( ctx , - 1 ) ;
DUK_HCOMPFUNC_SET_DATA ( thr - > heap , h_res , ( duk_hbuffer * ) h_data ) ;
DUK_HEAPHDR_INCREF ( thr , h_data ) ;
@ -2395,8 +2394,7 @@ DUK_LOCAL duk_reg_t duk__lookup_active_register_binding(duk_compiler_ctx *comp_c
* Special name handling
*/
h_varname = duk_get_hstring ( ctx , - 1 ) ;
DUK_ASSERT ( h_varname ! = NULL ) ;
h_varname = duk_known_hstring ( ctx , - 1 ) ;
if ( h_varname = = DUK_HTHREAD_STRING_LC_ARGUMENTS ( thr ) ) {
DUK_DDD ( DUK_DDDPRINT ( " flagging function as accessing 'arguments' " ) ) ;
@ -3656,8 +3654,7 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) {
duk_reg_t reg_varbind ;
duk_regconst_t rc_varname ;
h_varname = duk_get_hstring ( ctx , res - > x1 . valstack_idx ) ;
DUK_ASSERT ( h_varname ! = NULL ) ;
h_varname = duk_known_hstring ( ctx , res - > x1 . valstack_idx ) ;
if ( duk__hstring_is_eval_or_arguments_in_strict_mode ( comp_ctx , h_varname ) ) {
goto syntax_error ;
@ -3846,8 +3843,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i
DUK_DDD ( DUK_DDDPRINT ( " function call with identifier base " ) ) ;
h_varname = duk_get_hstring ( ctx , left - > x1 . valstack_idx ) ;
DUK_ASSERT ( h_varname ! = NULL ) ;
h_varname = duk_known_hstring ( ctx , left - > x1 . valstack_idx ) ;
if ( h_varname = = DUK_HTHREAD_STRING_EVAL ( thr ) ) {
/* Potential direct eval call detected, flag the CALL
* so that a run - time " direct eval " check is made and
@ -4332,8 +4328,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i
DUK_ASSERT ( left - > x1 . t = = DUK_ISPEC_VALUE ) ; /* LHS is already side effect free */
h_varname = duk_get_hstring ( ctx , left - > x1 . valstack_idx ) ;
DUK_ASSERT ( h_varname ! = NULL ) ;
h_varname = duk_known_hstring ( ctx , left - > x1 . valstack_idx ) ;
if ( duk__hstring_is_eval_or_arguments_in_strict_mode ( comp_ctx , h_varname ) ) {
/* E5 Section 11.13.1 (and others for other assignments), step 4. */
goto syntax_error_lvalue ;
@ -4627,8 +4622,7 @@ DUK_LOCAL void duk__expr_led(duk_compiler_ctx *comp_ctx, duk_ivalue *left, duk_i
duk_reg_t reg_varbind ;
duk_regconst_t rc_varname ;
h_varname = duk_get_hstring ( ctx , left - > x1 . valstack_idx ) ;
DUK_ASSERT ( h_varname ! = NULL ) ;
h_varname = duk_known_hstring ( ctx , left - > x1 . valstack_idx ) ;
if ( duk__hstring_is_eval_or_arguments_in_strict_mode ( comp_ctx , h_varname ) ) {
goto syntax_error ;
@ -6266,8 +6260,7 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_
duk_get_prop_index ( ctx , comp_ctx - > curr_func . funcs_idx , fnum * 3 ) ;
duk_get_prop_stridx ( ctx , - 1 , DUK_STRIDX_NAME ) ; /* -> [ ... func name ] */
h_funcname = duk_get_hstring ( ctx , - 1 ) ;
DUK_ASSERT ( h_funcname ! = NULL ) ;
h_funcname = duk_known_hstring ( ctx , - 1 ) ;
DUK_DDD ( DUK_DDDPRINT ( " register function declaration %!O in pass 1, fnum %ld " ,
( duk_heaphdr * ) h_funcname , ( long ) fnum ) ) ;
@ -6796,8 +6789,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct
for ( i = 0 ; i < num_args ; i + + ) {
duk_get_prop_index ( ctx , comp_ctx - > curr_func . argnames_idx , i ) ;
h_name = duk_get_hstring ( ctx , - 1 ) ;
DUK_ASSERT ( h_name ! = NULL ) ;
h_name = duk_known_hstring ( ctx , - 1 ) ;
if ( comp_ctx - > curr_func . is_strict ) {
if ( duk__hstring_is_eval_or_arguments ( comp_ctx , h_name ) ) {
@ -6989,8 +6981,7 @@ DUK_LOCAL void duk__init_varmap_and_prologue_for_pass2(duk_compiler_ctx *comp_ct
/* shadowed, ignore */
} else {
duk_get_prop_index ( ctx , comp_ctx - > curr_func . decls_idx , i ) ; /* decl name */
h_name = duk_get_hstring ( ctx , - 1 ) ;
DUK_ASSERT ( h_name ! = NULL ) ;
h_name = duk_known_hstring ( ctx , - 1 ) ;
if ( h_name = = DUK_HTHREAD_STRING_LC_ARGUMENTS ( thr ) & &
! comp_ctx - > curr_func . is_arguments_shadowed ) {
@ -7445,8 +7436,7 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_bool_t i
} else {
DUK_ERROR_SYNTAX ( thr , DUK_STR_INVALID_GETSET_NAME ) ;
}
comp_ctx - > curr_func . h_name = duk_get_hstring ( ctx , - 1 ) ; /* borrowed reference */
DUK_ASSERT ( comp_ctx - > curr_func . h_name ! = NULL ) ;
comp_ctx - > curr_func . h_name = duk_known_hstring ( ctx , - 1 ) ; /* borrowed reference */
duk__advance ( comp_ctx ) ;
} else {
/* Function name is an Identifier (not IdentifierName), but we get
@ -7455,8 +7445,7 @@ DUK_LOCAL void duk__parse_func_like_raw(duk_compiler_ctx *comp_ctx, duk_bool_t i
*/
if ( comp_ctx - > curr_token . t_nores = = DUK_TOK_IDENTIFIER ) {
duk_push_hstring ( ctx , comp_ctx - > curr_token . str1 ) ; /* keep in valstack */
comp_ctx - > curr_func . h_name = duk_get_hstring ( ctx , - 1 ) ; /* borrowed reference */
DUK_ASSERT ( comp_ctx - > curr_func . h_name ! = NULL ) ;
comp_ctx - > curr_func . h_name = duk_known_hstring ( ctx , - 1 ) ; /* borrowed reference */
duk__advance ( comp_ctx ) ;
} else {
/* valstack will be unbalanced, which is OK */
@ -7704,8 +7693,7 @@ DUK_LOCAL duk_ret_t duk__js_compile_raw(duk_context *ctx, void *udata) {
comp_ctx - > lex . slot1_idx = comp_ctx - > tok11_idx ;
comp_ctx - > lex . slot2_idx = comp_ctx - > tok12_idx ;
comp_ctx - > lex . buf_idx = entry_top + 0 ;
comp_ctx - > lex . buf = ( duk_hbuffer_dynamic * ) duk_get_hbuffer ( ctx , entry_top + 0 ) ;
DUK_ASSERT ( comp_ctx - > lex . buf ! = NULL ) ;
comp_ctx - > lex . buf = ( duk_hbuffer_dynamic * ) duk_known_hbuffer ( ctx , entry_top + 0 ) ;
DUK_ASSERT ( DUK_HBUFFER_HAS_DYNAMIC ( comp_ctx - > lex . buf ) & & ! DUK_HBUFFER_HAS_EXTERNAL ( comp_ctx - > lex . buf ) ) ;
comp_ctx - > lex . token_limit = DUK_COMPILER_TOKEN_LIMIT ;