@@ -2383,6 +2383,14 @@ dump_variable_declaration (literal_index_t lit_id)
23832383 serializer_dump_op_meta (create_op_meta_100 (opcode, lit_id));
23842384}
23852385
2386+ /* *
2387+ * Dump template of 'meta' instruction for scope's code flags.
2388+ *
2389+ * Note:
2390+ * the instruction's flags field is written later (see also: rewrite_scope_code_flags).
2391+ *
2392+ * @return position of dumped instruction
2393+ */
23862394opcode_counter_t
23872395dump_scope_code_flags_for_rewrite (void )
23882396{
@@ -2392,19 +2400,27 @@ dump_scope_code_flags_for_rewrite (void)
23922400 serializer_dump_op_meta (create_op_meta_000 (opcode));
23932401
23942402 return oc;
2395- }
2403+ } /* dump_scope_code_flags_for_rewrite */
23962404
2405+ /* *
2406+ * Write scope's code flags to specified 'meta' instruction template,
2407+ * dumped earlier (see also: dump_scope_code_flags_for_rewrite).
2408+ */
23972409void
2398- rewrite_scope_code_flags (opcode_counter_t scope_code_flags_oc,
2399- opcode_scope_code_flags_t scope_flags)
2410+ rewrite_scope_code_flags (opcode_counter_t scope_code_flags_oc, /* *< position of instruction to rewrite */
2411+ opcode_scope_code_flags_t scope_flags) /* *< scope's code properties flags set */
24002412{
24012413 JERRY_ASSERT ((idx_t ) scope_flags == scope_flags);
24022414
24032415 op_meta opm = serializer_get_op_meta (scope_code_flags_oc);
24042416 JERRY_ASSERT (opm.op .op_idx == OPCODE (meta));
2417+ JERRY_ASSERT (opm.op .data .meta .type == OPCODE_META_TYPE_SCOPE_CODE_FLAGS);
2418+ JERRY_ASSERT (opm.op .data .meta .data_1 == INVALID_VALUE);
2419+ JERRY_ASSERT (opm.op .data .meta .data_2 == INVALID_VALUE);
2420+
24052421 opm.op .data .meta .data_1 = (idx_t ) scope_flags;
24062422 serializer_rewrite_op_meta (scope_code_flags_oc, opm);
2407- }
2423+ } /* rewrite_scope_code_flags */
24082424
24092425void
24102426dump_ret (void )
0 commit comments