Implement function destructuring argument support. (#3322)
Furthermore create unmapped arguments objects if a function has a non-simple argument. A few destructuring pattern issues were fixed as well. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
359643b5b2
commit
8bdb32cc88
@@ -417,7 +417,7 @@ static_snapshot_add_compiled_code (ecma_compiled_code_t *compiled_code_p, /**< c
|
||||
}
|
||||
}
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (compiled_code_p))
|
||||
if (compiled_code_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
buffer_p += ((size_t) compiled_code_p->size) << JMEM_ALIGNMENT_LOG;
|
||||
literal_start_p = ((ecma_value_t *) buffer_p) - argument_end;
|
||||
@@ -489,7 +489,7 @@ jerry_snapshot_set_offsets (uint32_t *buffer_p, /**< buffer */
|
||||
}
|
||||
}
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (bytecode_p))
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
uint8_t *byte_p = (uint8_t *) bytecode_p;
|
||||
byte_p += ((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
|
||||
@@ -582,7 +582,7 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
|
||||
uint8_t *byte_p = (uint8_t *) bytecode_p;
|
||||
cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) byte_p;
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (bytecode_p))
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
argument_end = args_p->argument_end;
|
||||
}
|
||||
@@ -596,7 +596,7 @@ snapshot_load_compiled_code (const uint8_t *base_addr_p, /**< base address of th
|
||||
uint8_t *byte_p = (uint8_t *) bytecode_p;
|
||||
cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) byte_p;
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (bytecode_p))
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
argument_end = args_p->argument_end;
|
||||
}
|
||||
@@ -1092,7 +1092,7 @@ scan_snapshot_functions (const uint8_t *buffer_p, /**< snapshot buffer start */
|
||||
}
|
||||
}
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (bytecode_p))
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
uint8_t *byte_p = (uint8_t *) bytecode_p;
|
||||
byte_p += ((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
|
||||
@@ -1170,7 +1170,7 @@ update_literal_offsets (uint8_t *buffer_p, /**< [in,out] snapshot buffer start *
|
||||
}
|
||||
}
|
||||
|
||||
if (CBC_NON_STRICT_ARGUMENTS_NEEDED (bytecode_p))
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_MAPPED_ARGUMENTS_NEEDED)
|
||||
{
|
||||
uint8_t *byte_p = (uint8_t *) bytecode_p;
|
||||
byte_p += ((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG;
|
||||
|
||||
Reference in New Issue
Block a user