Repository: jerryscript-project/jerryscript
File: jerry-core/vm/vm.c (C)

Code before:

          JERRY_ASSERT (literal_index < register_end);
          JERRY_ASSERT (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)));

          ecma_fast_free_value (VM_GET_REGISTER (frame_ctx_p, literal_index));
          VM_GET_REGISTER (frame_ctx_p, literal_index) = left_value;
          continue;
        }
        case VM_OC_ASSIGN_PROP:
        {
          result = stack_top_p[-1];
          stack_top_p[-1] = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          break;
        }
        case VM_OC_ASSIGN_PROP_THIS:
        {
          result = stack_top_p[-1];
          stack_top_p[-1] = ecma_copy_value (frame_ctx_p->this_binding);
          *stack_top_p++ = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          break;
        }
        case VM_OC_RETURN_FUNCTION_END:
        {
          if (CBC_FUNCTION_GET_TYPE (frame_ctx_p->shared_p->bytecode_header_p->status_flags) == CBC_FUNCTION_SCRIPT)
          {
            result = VM_GET_REGISTER (frame_ctx_p, 0);
            VM_GET_REGISTERS (frame_ctx_p)[0] = ECMA_VALUE_UNDEFINED;
          }
          else
          {
            result = ECMA_VALUE_UNDEFINED;
          }

          goto error;
        }
        case VM_OC_RETURN:
        {
          JERRY_ASSERT (opcode == CBC_RETURN
                        || opcode == CBC_RETURN_WITH_LITERAL);

          result = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          goto error;
        }
        case VM_OC_THROW:
        {
          jcontext_raise_exception (left_value);

          result = ECMA_VALUE_ERROR;

Review comment (suggestion):
`bytecode_header_p` is in a local variable, no need this long read. See
`const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->shared_p->bytecode_header_p;`

Code after:

          JERRY_ASSERT (literal_index < register_end);
          JERRY_ASSERT (!(opcode_data & (VM_OC_PUT_STACK | VM_OC_PUT_BLOCK)));

          ecma_fast_free_value (VM_GET_REGISTER (frame_ctx_p, literal_index));
          VM_GET_REGISTER (frame_ctx_p, literal_index) = left_value;
          continue;
        }
        case VM_OC_ASSIGN_PROP:
        {
          result = stack_top_p[-1];
          stack_top_p[-1] = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          break;
        }
        case VM_OC_ASSIGN_PROP_THIS:
        {
          result = stack_top_p[-1];
          stack_top_p[-1] = ecma_copy_value (frame_ctx_p->this_binding);
          *stack_top_p++ = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          break;
        }
        case VM_OC_RETURN_FUNCTION_END:
        {
          if (CBC_FUNCTION_GET_TYPE (bytecode_header_p->status_flags) == CBC_FUNCTION_SCRIPT)
          {
            result = VM_GET_REGISTER (frame_ctx_p, 0);
            VM_GET_REGISTERS (frame_ctx_p)[0] = ECMA_VALUE_UNDEFINED;
          }
          else
          {
            result = ECMA_VALUE_UNDEFINED;
          }

          goto error;
        }
        case VM_OC_RETURN:
        {
          JERRY_ASSERT (opcode == CBC_RETURN
                        || opcode == CBC_RETURN_WITH_LITERAL);

          result = left_value;
          left_value = ECMA_VALUE_UNDEFINED;
          goto error;
        }
        case VM_OC_THROW:
        {
          jcontext_raise_exception (left_value);

          result = ECMA_VALUE_ERROR;