File tree Expand file tree Collapse file tree 6 files changed +19
-36
lines changed Expand file tree Collapse file tree 6 files changed +19
-36
lines changed Original file line number Diff line number Diff line change @@ -1619,16 +1619,14 @@ jerry_init (jerry_flag_t flags) /**< combination of Jerry flags */
1619
1619
#endif /* !JERRY_ENABLE_LOG */
1620
1620
}
1621
1621
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 ))
1623
1623
{
1624
1624
#ifndef MEM_STATS
1625
- flags &= ~(JERRY_FLAG_MEM_STATS
1626
- | JERRY_FLAG_MEM_STATS_PER_OPCODE
1627
- | JERRY_FLAG_MEM_STATS_SEPARATE );
1625
+ flags &= (jerry_flag_t ) ~(JERRY_FLAG_MEM_STATS | JERRY_FLAG_MEM_STATS_SEPARATE );
1628
1626
1629
1627
JERRY_WARNING_MSG ("Ignoring memory statistics option because of '!MEM_STATS' build configuration.\n" );
1630
1628
#else /* !MEM_STATS */
1631
- if (flags & ( JERRY_FLAG_MEM_STATS_PER_OPCODE | JERRY_FLAG_MEM_STATS_SEPARATE ) )
1629
+ if (flags & JERRY_FLAG_MEM_STATS_SEPARATE )
1632
1630
{
1633
1631
flags |= JERRY_FLAG_MEM_STATS ;
1634
1632
}
@@ -1735,9 +1733,7 @@ jerry_parse (const jerry_api_char_t *source_p, /**< script source */
1735
1733
}
1736
1734
#endif /* MEM_STATS */
1737
1735
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 );
1736
+ vm_init (bytecode_data_p );
1741
1737
1742
1738
return true;
1743
1739
} /* jerry_parse */
@@ -2370,7 +2366,7 @@ jerry_exec_snapshot (const void *snapshot_p, /**< snapshot */
2370
2366
2371
2367
if (header_p -> is_run_global )
2372
2368
{
2373
- vm_init (bytecode_p , false );
2369
+ vm_init (bytecode_p );
2374
2370
2375
2371
ecma_object_t * error_obj_p = NULL ;
2376
2372
Original file line number Diff line number Diff line change @@ -32,22 +32,20 @@ extern "C"
32
32
* @{
33
33
*/
34
34
35
- #define JERRY_FLAG_EMPTY (0u) /**< empty flag set */
36
- #define JERRY_FLAG_SHOW_OPCODES (1u << 0) /**< dump byte-code to stdout after parse */
37
- #define JERRY_FLAG_MEM_STATS (1u << 1) /**< dump memory statistics */
38
- #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) */
41
- #define JERRY_FLAG_MEM_STATS_SEPARATE (1u << 3) /**< dump memory statistics and reset peak values after parse */
42
- #define JERRY_FLAG_PARSE_ONLY (1u << 4) /**< parse only, prevents script execution (only for testing)
43
- * FIXME: Remove. */
44
- #define JERRY_FLAG_ENABLE_LOG (1u << 5) /**< enable logging */
45
- #define JERRY_FLAG_ABORT_ON_FAIL (1u << 6) /**< abort instead of exit in case of failure */
46
-
47
35
/**
48
36
* Jerry flags
49
37
*/
50
- typedef uint32_t jerry_flag_t ;
38
+ typedef enum
39
+ {
40
+ JERRY_FLAG_EMPTY = (0u ), /**< empty flag set */
41
+ JERRY_FLAG_SHOW_OPCODES = (1u << 0 ), /**< dump byte-code to stdout after parse */
42
+ JERRY_FLAG_MEM_STATS = (1u << 1 ), /**< dump memory statistics */
43
+ JERRY_FLAG_MEM_STATS_SEPARATE = (1u << 2 ), /**< dump memory statistics and reset peak values after parse */
44
+ JERRY_FLAG_PARSE_ONLY = (1u << 3 ), /**< parse only, prevents script execution (only for testing)
45
+ * FIXME: Remove. */
46
+ JERRY_FLAG_ENABLE_LOG = (1u << 4 ), /**< enable logging */
47
+ JERRY_FLAG_ABORT_ON_FAIL = (1u << 5 ), /**< abort instead of exit in case of failure */
48
+ } jerry_flag_t ;
51
49
52
50
/**
53
51
* Error codes
Original file line number Diff line number Diff line change @@ -141,11 +141,8 @@ vm_op_set_value (ecma_value_t object, /**< base object */
141
141
* Initialize interpreter.
142
142
*/
143
143
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 */
146
145
{
147
- JERRY_ASSERT (!dump_mem_stats );
148
-
149
146
JERRY_ASSERT (__program == NULL );
150
147
151
148
__program = program_p ;
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ typedef enum
192
192
VM_EXEC_CONSTRUCT , /**< construct a new object */
193
193
} vm_call_operation ;
194
194
195
- extern void vm_init (ecma_compiled_code_t * , bool );
195
+ extern void vm_init (ecma_compiled_code_t * );
196
196
extern void vm_finalize (void );
197
197
extern jerry_completion_code_t vm_run_global (ecma_object_t * * );
198
198
extern ecma_value_t vm_run_eval (ecma_compiled_code_t * , bool );
Original file line number Diff line number Diff line change 1
- /* Copyright 2014-2015 Samsung Electronics Co., Ltd.
1
+ /* Copyright 2014-2016 Samsung Electronics Co., Ltd.
2
2
*
3
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
4
* you may not use this file except in compliance with the License.
@@ -237,10 +237,6 @@ main (int argc,
237
237
{
238
238
flags |= JERRY_FLAG_MEM_STATS ;
239
239
}
240
- else if (!strcmp ("--mem-stats-per-opcode" , argv [i ]))
241
- {
242
- flags |= JERRY_FLAG_MEM_STATS_PER_OPCODE ;
243
- }
244
240
else if (!strcmp ("--mem-stats-separate" , argv [i ]))
245
241
{
246
242
flags |= JERRY_FLAG_MEM_STATS_SEPARATE ;
Original file line number Diff line number Diff line change @@ -185,10 +185,6 @@ int jerryscript_entry (int argc, char *argv[])
185
185
{
186
186
flags |= JERRY_FLAG_MEM_STATS ;
187
187
}
188
- else if (!strcmp ("--mem-stats-per-opcode" , argv [i ]))
189
- {
190
- flags |= JERRY_FLAG_MEM_STATS_PER_OPCODE ;
191
- }
192
188
else if (!strcmp ("--mem-stats-separate" , argv [i ]))
193
189
{
194
190
flags |= JERRY_FLAG_MEM_STATS_SEPARATE ;
You can’t perform that action at this time.
0 commit comments