From 0c9f81dbf94f39e5b322ac34acbb5c899d134e0c Mon Sep 17 00:00:00 2001 From: "e.gavrin" Date: Thu, 17 Jul 2014 15:19:55 +0400 Subject: [PATCH] add var_decl --- src/libcoreint/opcode-structures.h | 2 +- src/libcoreint/opcodes.c | 2 ++ src/libcoreint/opcodes.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libcoreint/opcode-structures.h b/src/libcoreint/opcode-structures.h index 07415491c..1a4c024dc 100644 --- a/src/libcoreint/opcode-structures.h +++ b/src/libcoreint/opcode-structures.h @@ -378,7 +378,7 @@ OP_CODE_DECL (loop_postcond, T_IDX_IDX, //// TODO // Variable declaration -OP_CODE_DECL (decl_var, T_IDX, +OP_CODE_DECL (var_decl, T_IDX, variable) // TODO New constructor diff --git a/src/libcoreint/opcodes.c b/src/libcoreint/opcodes.c index abb07cef1..b7085eb9c 100644 --- a/src/libcoreint/opcodes.c +++ b/src/libcoreint/opcodes.c @@ -69,6 +69,7 @@ void opfunc_jmp_up (OPCODE opdata __unused, struct __int_data *int_data __unused void opfunc_jmp_down (OPCODE opdata __unused, struct __int_data *int_data __unused) { JERRY_UNREACHABLE (); } void opfunc_is_true_jmp (OPCODE opdata __unused, struct __int_data *int_data __unused) { JERRY_UNREACHABLE (); } void opfunc_is_false_jmp (OPCODE opdata __unused, struct __int_data *int_data __unused) { JERRY_UNREACHABLE (); } +void opfunc_var_decl (OPCODE opdata __unused, struct __int_data *int_data __unused) { JERRY_UNREACHABLE (); } void opfunc_loop_inf (OPCODE opdata, struct __int_data *int_data) @@ -155,4 +156,5 @@ GETOP_IMPL_3 (loop_init_num, start, stop, step) GETOP_IMPL_2 (loop_precond_begin_num, condition, after_loop_op) GETOP_IMPL_3 (loop_precond_end_num, iterator, step, precond_begin) GETOP_IMPL_2 (loop_postcond, condition, body_root) +GETOP_IMPL_1 (var_decl, variable) diff --git a/src/libcoreint/opcodes.h b/src/libcoreint/opcodes.h index 9cd396428..777f76c64 100644 --- a/src/libcoreint/opcodes.h +++ b/src/libcoreint/opcodes.h @@ -114,7 +114,8 @@ typedef void (*opfunc)(OPCODE, struct __int_data *); OP_RELATIONAL(op) \ OP_ARITHMETIC(op) \ OP_UNCONDITIONAL_JUMPS(op) \ - OP_UNARY_OPS(op) + OP_UNARY_OPS(op) \ + op(var_decl) #include "opcode-structures.h"