Skip to content

Commit cb672e9

Browse files
committed
Remove support for per-instruction memory statistics
The new CBC interpreter does not support it anymore. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent 073ab05 commit cb672e9

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed

jerry-core/jerry.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,16 +1619,15 @@ jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */
16191619
#endif /* !JERRY_ENABLE_LOG */
16201620
}
16211621

1622-
if (flags & (JERRY_FLAG_MEM_STATS | JERRY_FLAG_MEM_STATS_PER_OPCODE | JERRY_FLAG_MEM_STATS_SEPARATE))
1622+
if (flags & (JERRY_FLAG_MEM_STATS | JERRY_FLAG_MEM_STATS_SEPARATE))
16231623
{
16241624
#ifndef MEM_STATS
16251625
flags &= ~(JERRY_FLAG_MEM_STATS
1626-
| JERRY_FLAG_MEM_STATS_PER_OPCODE
16271626
| JERRY_FLAG_MEM_STATS_SEPARATE);
16281627

16291628
JERRY_WARNING_MSG ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n");
16301629
#else /* !MEM_STATS */
1631-
if (flags & (JERRY_FLAG_MEM_STATS_PER_OPCODE | JERRY_FLAG_MEM_STATS_SEPARATE))
1630+
if (flags & JERRY_FLAG_MEM_STATS_SEPARATE)
16321631
{
16331632
flags |= JERRY_FLAG_MEM_STATS;
16341633
}
@@ -1735,9 +1734,7 @@ jerry_parse (const jerry_api_char_t *source_p, /**< script source */
17351734
}
17361735
#endif /* MEM_STATS */
17371736

1738-
bool is_show_mem_stats_per_instruction = ((jerry_flags & JERRY_FLAG_MEM_STATS_PER_OPCODE) != 0);
1739-
1740-
vm_init (bytecode_data_p, is_show_mem_stats_per_instruction);
1737+
vm_init (bytecode_data_p);
17411738

17421739
return true;
17431740
} /* jerry_parse */
@@ -2370,7 +2367,7 @@ jerry_exec_snapshot (const void *snapshot_p, /**< snapshot */
23702367

23712368
if (header_p->is_run_global)
23722369
{
2373-
vm_init (bytecode_p, false);
2370+
vm_init (bytecode_p);
23742371

23752372
ecma_object_t *error_obj_p = NULL;
23762373

jerry-core/jerry.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ extern "C"
3636
#define JERRY_FLAG_SHOW_OPCODES (1u << 0) /**< dump byte-code to stdout after parse */
3737
#define JERRY_FLAG_MEM_STATS (1u << 1) /**< dump memory statistics */
3838
#define JERRY_FLAG_MEM_STATS_PER_OPCODE (1u << 2) /**< dump per-instruction memory statistics during execution
39-
* (in the mode full GC is performed after execution of each
40-
* opcode handler) */
39+
* FIXME: Remove. */
4140
#define JERRY_FLAG_MEM_STATS_SEPARATE (1u << 3) /**< dump memory statistics and reset peak values after parse */
4241
#define JERRY_FLAG_PARSE_ONLY (1u << 4) /**< parse only, prevents script execution (only for testing)
4342
* FIXME: Remove. */

jerry-core/vm/vm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,8 @@ vm_op_set_value (ecma_value_t object, /**< base object */
141141
* Initialize interpreter.
142142
*/
143143
void
144-
vm_init (ecma_compiled_code_t *program_p, /**< pointer to byte-code data */
145-
bool dump_mem_stats) /**< dump per-instruction memory usage change statistics */
144+
vm_init (ecma_compiled_code_t *program_p) /**< pointer to byte-code data */
146145
{
147-
JERRY_ASSERT (!dump_mem_stats);
148-
149146
JERRY_ASSERT (__program == NULL);
150147

151148
__program = program_p;

jerry-core/vm/vm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ typedef enum
192192
VM_EXEC_CONSTRUCT, /**< construct a new object */
193193
} vm_call_operation;
194194

195-
extern void vm_init (ecma_compiled_code_t *, bool);
195+
extern void vm_init (ecma_compiled_code_t *);
196196
extern void vm_finalize (void);
197197
extern jerry_completion_code_t vm_run_global (ecma_object_t **);
198198
extern ecma_value_t vm_run_eval (ecma_compiled_code_t *, bool);

main-unix.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
1+
/* Copyright 2014-2016 Samsung Electronics Co., Ltd.
22
*
33
* Licensed under the Apache License, Version 2.0 (the "License");
44
* you may not use this file except in compliance with the License.
@@ -237,10 +237,6 @@ main (int argc,
237237
{
238238
flags |= JERRY_FLAG_MEM_STATS;
239239
}
240-
else if (!strcmp ("--mem-stats-per-opcode", argv[i]))
241-
{
242-
flags |= JERRY_FLAG_MEM_STATS_PER_OPCODE;
243-
}
244240
else if (!strcmp ("--mem-stats-separate", argv[i]))
245241
{
246242
flags |= JERRY_FLAG_MEM_STATS_SEPARATE;

targets/nuttx-stm32f4/main-nuttx.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ int jerryscript_entry (int argc, char *argv[])
185185
{
186186
flags |= JERRY_FLAG_MEM_STATS;
187187
}
188-
else if (!strcmp ("--mem-stats-per-opcode", argv[i]))
189-
{
190-
flags |= JERRY_FLAG_MEM_STATS_PER_OPCODE;
191-
}
192188
else if (!strcmp ("--mem-stats-separate", argv[i]))
193189
{
194190
flags |= JERRY_FLAG_MEM_STATS_SEPARATE;

0 commit comments

Comments
 (0)