mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Changing return type of opcode handlers to ecma_CompletionValue_t.
This commit is contained in:
parent
a20aa29354
commit
dd5c9dfb39
@ -13,6 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "ecma-helpers.h"
|
||||
#include "ecma-operations.h"
|
||||
#include "interpreter.h"
|
||||
#include "jerry-libc.h"
|
||||
@ -66,13 +67,13 @@
|
||||
op(var_decl)
|
||||
|
||||
#define DEFINE_UNIMPLEMENTED_OP(op) \
|
||||
void opfunc_ ## op(OPCODE opdata, struct __int_data *int_data) { \
|
||||
ecma_CompletionValue_t opfunc_ ## op(OPCODE opdata, struct __int_data *int_data) { \
|
||||
JERRY_UNIMPLEMENTED_REF_UNUSED_VARS( opdata, int_data); \
|
||||
}
|
||||
OP_UNIMPLEMENTED_LIST(DEFINE_UNIMPLEMENTED_OP)
|
||||
#undef DEFINE_UNIMPLEMENTED_OP
|
||||
|
||||
void
|
||||
ecma_CompletionValue_t
|
||||
opfunc_loop_inf (OPCODE opdata, struct __int_data *int_data)
|
||||
{
|
||||
#ifdef __HOST
|
||||
@ -82,9 +83,13 @@ opfunc_loop_inf (OPCODE opdata, struct __int_data *int_data)
|
||||
#endif
|
||||
|
||||
int_data->pos = opdata.data.loop_inf.loop_root;
|
||||
|
||||
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
|
||||
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
|
||||
ECMA_TARGET_ID_RESERVED);
|
||||
}
|
||||
|
||||
void
|
||||
ecma_CompletionValue_t
|
||||
opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
{
|
||||
#ifdef __HOST
|
||||
@ -95,9 +100,14 @@ opfunc_call_1 (OPCODE opdata __unused, struct __int_data *int_data)
|
||||
#endif
|
||||
|
||||
int_data->pos++;
|
||||
|
||||
// FIXME
|
||||
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
|
||||
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
|
||||
ECMA_TARGET_ID_RESERVED);
|
||||
}
|
||||
|
||||
void
|
||||
ecma_CompletionValue_t
|
||||
opfunc_jmp (OPCODE opdata, struct __int_data *int_data)
|
||||
{
|
||||
#ifdef __HOST
|
||||
@ -107,6 +117,10 @@ opfunc_jmp (OPCODE opdata, struct __int_data *int_data)
|
||||
#endif
|
||||
|
||||
int_data->pos = opdata.data.jmp.opcode_idx;
|
||||
|
||||
return ecma_MakeCompletionValue( ECMA_COMPLETION_TYPE_NORMAL,
|
||||
ecma_MakeSimpleValue( ECMA_SIMPLE_VALUE_EMPTY),
|
||||
ECMA_TARGET_ID_RESERVED);
|
||||
}
|
||||
|
||||
/** Opcode generators. */
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#ifndef OPCODES_H
|
||||
#define OPCODES_H
|
||||
|
||||
#include "ecma-globals.h"
|
||||
#include "globals.h"
|
||||
|
||||
#define OPCODE struct __opcode
|
||||
@ -23,7 +24,7 @@ struct __int_data;
|
||||
|
||||
#define OP_STRUCT_FIELD(name) struct __op_##name name;
|
||||
#define OP_ENUM_FIELD(name) __op__idx_##name ,
|
||||
#define OP_FUNC_DECL(name) void opfunc_##name (OPCODE, struct __int_data *);
|
||||
#define OP_FUNC_DECL(name) ecma_CompletionValue_t opfunc_##name (OPCODE, struct __int_data *);
|
||||
|
||||
/** A single bytecode instruction is 32bit wide and has an 8bit opcode field
|
||||
and several operand of 8 of 16 bit.*/
|
||||
@ -32,7 +33,7 @@ struct __int_data;
|
||||
#define T_IDX uint8_t /** index values */
|
||||
|
||||
OPCODE;
|
||||
typedef void (*opfunc)(OPCODE, struct __int_data *);
|
||||
typedef ecma_CompletionValue_t (*opfunc)(OPCODE, struct __int_data *);
|
||||
|
||||
#define OP_LOOPS(op) \
|
||||
op(loop_inf) \
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user