OPCODE define replaced with opcode_t. T_IDX define replaced with idx_t.

This commit is contained in:
e.gavrin
2014-08-23 00:53:41 +04:00
parent 0eece0be5a
commit a99907670b
30 changed files with 368 additions and 362 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ static uint8_t opcode_sizes[] = {
};
static bool
opcodes_equal (const OPCODE *opcodes1, OPCODE *opcodes2, uint16_t size)
opcodes_equal (const opcode_t *opcodes1, opcode_t *opcodes2, uint16_t size)
{
uint16_t i;
for (i = 0; i < size; i++)
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
getop_reg_var_decl( 255, 255),
getop_var_decl( 0),
getop_var_decl( 1),
+1 -1
View File
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
/* 0: */ getop_reg_var_decl( 255, 255),
/* 1: */ getop_var_decl( 0),
/* 2: */ getop_var_decl( 1),
+1 -1
View File
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
getop_reg_var_decl( 255, 255),
getop_var_decl( 0),
getop_var_decl( 1),
+1 -1
View File
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
getop_reg_var_decl( 255, 255),
getop_var_decl( 0),
getop_var_decl( 1),
+4 -4
View File
@@ -30,7 +30,7 @@ int
main( int __unused argc,
char __unused **argv)
{
OPCODE test_program[] = {
opcode_t test_program[] = {
[0] = getop_assignment( 0, OPCODE_ARG_TYPE_STRING, 1),
[1] = getop_assignment( 1, OPCODE_ARG_TYPE_VARIABLE, 0),
[2] = getop_is_false_jmp (0, 10),
@@ -56,10 +56,10 @@ main( int __unused argc,
for (int i = 0; i < 11; i++)
serializer_dump_opcode (test_program[i]);
OPCODE * opcodes = (OPCODE *) deserialize_bytecode ();
opcode_t * opcodes = (opcode_t *) deserialize_bytecode ();
optimizer_move_opcodes (opcodes + 9, opcodes + 2, 1);
if (!opcodes_equal (opcodes, (OPCODE[]) {
if (!opcodes_equal (opcodes, (opcode_t[]) {
[0] = getop_assignment( 0, OPCODE_ARG_TYPE_STRING, 1),
[1] = getop_assignment( 1, OPCODE_ARG_TYPE_VARIABLE, 0),
[2] = getop_assignment (0, OPCODE_ARG_TYPE_SMALLINT, 253),
@@ -75,7 +75,7 @@ main( int __unused argc,
return 1;
optimizer_adjust_jumps (opcodes + 3, opcodes + 10, 1);
if (!opcodes_equal (opcodes, (OPCODE[]) {
if (!opcodes_equal (opcodes, (opcode_t[]) {
[0] = getop_assignment( 0, OPCODE_ARG_TYPE_STRING, 1),
[1] = getop_assignment( 1, OPCODE_ARG_TYPE_VARIABLE, 0),
[2] = getop_assignment (0, OPCODE_ARG_TYPE_SMALLINT, 253),
+2 -2
View File
@@ -37,7 +37,7 @@ main( int __unused argc,
ecma_number_t nums[MAX_NUMS];
uint8_t strings_num, nums_count;
uint16_t offset;
const OPCODE *opcodes;
const opcode_t *opcodes;
const char *source = "for (var i = 0; i < 10; i++) {\n"
" var j = 10;\n"
"}\n"
@@ -62,7 +62,7 @@ main( int __unused argc,
opcodes = deserialize_bytecode ();
serializer_print_opcodes ();
if (!opcodes_equal (opcodes, (OPCODE[]) {
if (!opcodes_equal (opcodes, (opcode_t[]) {
[0] = getop_reg_var_decl (2, 5), // var tmp2 .. tmp5;
[1] = getop_var_decl (0), // var i;
[2] = getop_var_decl (1), // var j;
+3 -3
View File
@@ -31,7 +31,7 @@ main( int __unused argc,
char __unused **argv)
{
// Honestly, after RETVAL there must be RET
OPCODE test_program[] = {
opcode_t test_program[] = {
[0] = getop_reg_var_decl (5, 5), // tmp6
[1] = getop_assignment (0, OPCODE_ARG_TYPE_STRING, 1), // a = "b"
[2] = getop_var_decl (1), // var b
@@ -54,10 +54,10 @@ main( int __unused argc,
for (int i = 0; i < 9; i++)
serializer_dump_opcode (test_program[i]);
OPCODE * opcodes = (OPCODE *) deserialize_bytecode ();
opcode_t * opcodes = (opcode_t *) deserialize_bytecode ();
optimizer_reorder_scope (1, 8);
if (!opcodes_equal (opcodes, (OPCODE[]) {
if (!opcodes_equal (opcodes, (opcode_t[]) {
[0] = getop_reg_var_decl (5, 5), // tmp6
[1] = getop_assignment (5, OPCODE_ARG_TYPE_STRING, 3), // "use strict"
[2] = getop_func_decl_0 (2), // function c()
+1 -1
View File
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
getop_reg_var_decl( 255, 255),
getop_var_decl( 0),
getop_var_decl( 1),
+1 -1
View File
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
getop_reg_var_decl( 255, 255),
getop_var_decl( 0),
getop_var_decl( 1),
@@ -26,7 +26,7 @@ int
main( int __unused argc,
char __unused **argv)
{
const OPCODE test_program[] = {
const opcode_t test_program[] = {
/* 0: */ getop_reg_var_decl( 255, 255),
/* 1: */ getop_var_decl( 0),
/* 2: */ getop_is_true_jmp( 0, 4),