aboutsummaryrefslogtreecommitdiff
path: root/jerry-core
diff options
context:
space:
mode:
authorAkos Kiss <akiss@inf.u-szeged.hu>2016-02-17 02:17:27 +0100
committerAkos Kiss <akiss@inf.u-szeged.hu>2016-02-17 10:55:09 +0100
commitad6107b32be0efd4eacbefb8201adfd3483a2d69 (patch)
tree102f34b11345f23c9daff781029dae8f669ce23a /jerry-core
parentb2f3ec225e931e5b2ddac6a249626ffce8fdf045 (diff)
Turn some global variables `static const`
Generally, it helps the optimizing passes of the compiler if global varibles are `static`, and it is good for RAM usage to have data marked read-only `const`. Found some globals, which could benefit from these qualifiers. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Diffstat (limited to 'jerry-core')
-rw-r--r--jerry-core/parser/js/js-lexer.c4
-rw-r--r--jerry-core/vm/vm.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/jerry-core/parser/js/js-lexer.c b/jerry-core/parser/js/js-lexer.c
index bb947a09..8654608c 100644
--- a/jerry-core/parser/js/js-lexer.c
+++ b/jerry-core/parser/js/js-lexer.c
@@ -1904,12 +1904,12 @@ lexer_expect_identifier (parser_context_t *context_p, /**< context */
parser_raise_error (context_p, PARSER_ERR_IDENTIFIER_EXPECTED);
} /* lexer_expect_identifier */
-static lexer_lit_location_t lexer_get_literal =
+static const lexer_lit_location_t lexer_get_literal =
{
(const uint8_t *) "get", 3, LEXER_IDENT_LITERAL, PARSER_FALSE
};
-static lexer_lit_location_t lexer_set_literal =
+static const lexer_lit_location_t lexer_set_literal =
{
(const uint8_t *) "set", 3, LEXER_IDENT_LITERAL, PARSER_FALSE
};
diff --git a/jerry-core/vm/vm.c b/jerry-core/vm/vm.c
index 104c7c30..281419cd 100644
--- a/jerry-core/vm/vm.c
+++ b/jerry-core/vm/vm.c
@@ -157,7 +157,7 @@ vm_init (ecma_compiled_code_t *program_p, /**< pointer to byte-code data */
/**
* Decode table for opcodes.
*/
-uint32_t vm_decode_table[] =
+static const uint32_t vm_decode_table[] =
{
CBC_OPCODE_LIST
};
@@ -165,7 +165,7 @@ uint32_t vm_decode_table[] =
/**
* Decode table for extended opcodes.
*/
-uint32_t vm_ext_decode_table[] =
+static const uint32_t vm_ext_decode_table[] =
{
CBC_EXT_OPCODE_LIST
};