Optimize parser memory consumption. Remove 'prev' and 'block_size' fields form the linked list structure. Remove 'magic' field from structures used in parser.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,7 +22,7 @@
|
||||
#define INVALID_LITERAL UINT32_MAX
|
||||
|
||||
/* Keywords. */
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
/* Not a keyword. */
|
||||
KW_NONE = 0,
|
||||
@@ -81,7 +81,7 @@ keyword;
|
||||
|
||||
|
||||
/* Type of tokens. */
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
TOK_EOF = 0, // End of file
|
||||
TOK_NAME, // Identifier
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "ecma-globals.h"
|
||||
#include "lp-string.h"
|
||||
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
LIT_UNKNOWN,
|
||||
LIT_STR,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2014 Samsung Electronics Co., Ltd.
|
||||
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "ecma-globals.h"
|
||||
#include "lexer.h"
|
||||
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
OPERAND_LITERAL,
|
||||
OPERAND_TMP
|
||||
@@ -39,7 +39,7 @@ typedef struct
|
||||
}
|
||||
operand;
|
||||
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
VARG_FUNC_DECL,
|
||||
VARG_FUNC_EXPR,
|
||||
|
||||
@@ -30,7 +30,6 @@ static void
|
||||
assert_tree (scopes_tree t)
|
||||
{
|
||||
JERRY_ASSERT (t != NULL);
|
||||
JERRY_ASSERT (t->t.magic == TREE_MAGIC);
|
||||
}
|
||||
|
||||
static idx_t
|
||||
@@ -648,7 +647,6 @@ scopes_tree_init (scopes_tree parent)
|
||||
{
|
||||
scopes_tree tree = (scopes_tree) mem_heap_alloc_block (sizeof (scopes_tree_int), MEM_HEAP_ALLOC_SHORT_TERM);
|
||||
memset (tree, 0, sizeof (scopes_tree_int));
|
||||
tree->t.magic = TREE_MAGIC;
|
||||
tree->t.parent = (tree_header *) parent;
|
||||
tree->t.children = null_list;
|
||||
tree->t.children_num = 0;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
} while (0)
|
||||
#endif /* JERRY_NDEBUG */
|
||||
|
||||
typedef enum
|
||||
typedef enum __attr_packed___
|
||||
{
|
||||
PROP_DATA,
|
||||
PROP_SET,
|
||||
|
||||
Reference in New Issue
Block a user