Read function's scope flags only in ecma_op_create_function_object instead of call sites of the routine.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-10-26 15:45:17 +03:00
parent 4d2ad40475
commit f24effa629
5 changed files with 38 additions and 65 deletions
+4 -6
View File
@@ -396,8 +396,7 @@ vm_run_global (void)
bool is_strict = false;
vm_instr_counter_t start_pos = 0;
opcode_scope_code_flags_t scope_flags = vm_get_scope_flags (__program->instrs_p,
start_pos++);
opcode_scope_code_flags_t scope_flags = vm_get_scope_flags (__program, start_pos++);
if (scope_flags & OPCODE_SCOPE_CODE_FLAGS_STRICT)
{
@@ -449,8 +448,7 @@ vm_run_eval (const bytecode_data_header_t *bytecode_data_p, /**< byte-code data
bool is_direct) /**< is eval called in direct mode? */
{
vm_instr_counter_t first_instr_index = 0u;
opcode_scope_code_flags_t scope_flags = vm_get_scope_flags (bytecode_data_p->instrs_p,
first_instr_index++);
opcode_scope_code_flags_t scope_flags = vm_get_scope_flags (bytecode_data_p, first_instr_index++);
bool is_strict = ((scope_flags & OPCODE_SCOPE_CODE_FLAGS_STRICT) != 0);
ecma_value_t this_binding;
@@ -669,10 +667,10 @@ vm_get_instr (const vm_instr_t *instrs_p, /**< byte-code array */
* @return mask of scope code flags
*/
opcode_scope_code_flags_t
vm_get_scope_flags (const vm_instr_t *instrs_p, /**< byte-code array */
vm_get_scope_flags (const bytecode_data_header_t *bytecode_header_p, /**< byte-code data */
vm_instr_counter_t counter) /**< instruction counter */
{
vm_instr_t flags_instr = vm_get_instr (instrs_p, counter);
vm_instr_t flags_instr = vm_get_instr (bytecode_header_p->instrs_p, counter);
JERRY_ASSERT (flags_instr.op_idx == VM_OP_META
&& flags_instr.data.meta.type == OPCODE_META_TYPE_SCOPE_CODE_FLAGS);
return (opcode_scope_code_flags_t) flags_instr.data.meta.data_1;