Skip to content

Commit 2d82f4f

Browse files
committed
Improve style.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
1 parent 4b98a21 commit 2d82f4f

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

jerry-core/vm/vm.c

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ vm_finalize (void)
554554
*
555555
* @return ecma value
556556
*/
557-
static ecma_value_t __attr_noinline___
557+
static ecma_value_t
558558
vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
559559
{
560560
const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
@@ -694,7 +694,7 @@ vm_init_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
694694
*
695695
* @return ecma value
696696
*/
697-
ecma_value_t __attr_noinline___
697+
static ecma_value_t __attr_noinline___
698698
vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
699699
{
700700
const ecma_compiled_code_t *bytecode_header_p = frame_ctx_p->bytecode_header_p;
@@ -2411,25 +2411,28 @@ vm_execute (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
24112411
prev_context_p = vm_top_context_p;
24122412
vm_top_context_p = frame_ctx_p;
24132413

2414-
vm_init_loop (frame_ctx_p);
2414+
completion_value = vm_init_loop (frame_ctx_p);
24152415

2416-
while (true)
2416+
if (!ecma_is_value_error (completion_value))
24172417
{
2418-
completion_value = vm_loop (frame_ctx_p);
2419-
2420-
if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
2418+
while (true)
24212419
{
2422-
break;
2423-
}
2420+
completion_value = vm_loop (frame_ctx_p);
24242421

2425-
if (frame_ctx_p->call_operation == VM_EXEC_CALL)
2426-
{
2427-
opfunc_call (frame_ctx_p);
2428-
}
2429-
else
2430-
{
2431-
JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_CONSTRUCT);
2432-
opfunc_construct (frame_ctx_p);
2422+
if (frame_ctx_p->call_operation == VM_NO_EXEC_OP)
2423+
{
2424+
break;
2425+
}
2426+
2427+
if (frame_ctx_p->call_operation == VM_EXEC_CALL)
2428+
{
2429+
opfunc_call (frame_ctx_p);
2430+
}
2431+
else
2432+
{
2433+
JERRY_ASSERT (frame_ctx_p->call_operation == VM_EXEC_CONSTRUCT);
2434+
opfunc_construct (frame_ctx_p);
2435+
}
24332436
}
24342437
}
24352438

jerry-core/vm/vm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ extern void vm_finalize (void);
193193
extern jerry_completion_code_t vm_run_global (void);
194194
extern ecma_value_t vm_run_eval (ecma_compiled_code_t *, bool);
195195

196-
extern ecma_value_t vm_loop (vm_frame_ctx_t *);
197-
198196
extern ecma_value_t vm_run (const ecma_compiled_code_t *, ecma_value_t,
199197
ecma_object_t *, bool, const ecma_value_t *,
200198
ecma_length_t);

0 commit comments

Comments
 (0)