Change the return type of 'vm_init_loop' function to void. (#1402)

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This commit is contained in:
Robert Sipka
2016-10-20 14:03:15 +02:00
committed by yichoi
parent 922782109b
commit b9f540fc90
+17 -23
View File
@@ -518,12 +518,11 @@ opfunc_construct (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
* *
* @return ecma value * @return ecma value
*/ */
static ecma_value_t static void
vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */ vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{ {
const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p; const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
uint8_t *byte_code_p = frame_ctx_p->byte_code_p; uint8_t *byte_code_p = frame_ctx_p->byte_code_p;
ecma_value_t result = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
uint16_t encoding_limit; uint16_t encoding_limit;
uint16_t encoding_delta; uint16_t encoding_delta;
uint16_t register_end; uint16_t register_end;
@@ -654,12 +653,10 @@ vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
default: default:
{ {
frame_ctx_p->byte_code_p = byte_code_p; frame_ctx_p->byte_code_p = byte_code_p;
return ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED); return;
} }
} }
} }
return result;
} /* vm_init_loop */ } /* vm_init_loop */
/** /**
@@ -2581,28 +2578,25 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
prev_context_p = JERRY_CONTEXT (vm_top_context_p); prev_context_p = JERRY_CONTEXT (vm_top_context_p);
JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p; JERRY_CONTEXT (vm_top_context_p) = frame_ctx_p;
completion_value = vm_init_loop (frame_ctx_p); vm_init_loop (frame_ctx_p);
if (!ECMA_IS_VALUE_ERROR (completion_value)) while (true)
{ {
while (true) completion_value = vm_loop (frame_ctx_p);
if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
{ {
completion_value = vm_loop (frame_ctx_p); break;
}
if (frame_ctx_p->call_operation == VM_NO_EXEC_OP) if (frame_ctx_p->call_operation == VM_EXEC_CALL)
{ {
break; opfunc_call (frame_ctx_p);
} }
else
if (frame_ctx_p->call_operation == VM_EXEC_CALL) {
{ JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_CONSTRUCT);
opfunc_call (frame_ctx_p); opfunc_construct (frame_ctx_p);
}
else
{
JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_CONSTRUCT);
opfunc_construct (frame_ctx_p);
}
} }
} }