Skip to content

Commit b66e8e9

Browse files
committed
Fix terminology of snapshot saving in literals
In case of literals, snapshot saving is incorrectly named dumping. Elsewhere in the code, 'dump' functions output debug data (even literals have a `lit_dump_literals` debug function). To help distinction and to align terminologies, snapshot saving functions of literals are also re-named 'save'. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss [email protected]
1 parent 073ab05 commit b66e8e9

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

jerry-core/jerry-snapshot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct
2727
uint32_t last_compiled_code_offset; /**< offset of the last compiled code */
2828
uint32_t lit_table_size; /**< size of literal table */
2929
__extension__ uint32_t is_run_global : 1; /**< flag, indicating whether the snapshot
30-
* was dumped as 'Global scope'-mode code (true)
30+
* was saved as 'Global scope'-mode code (true)
3131
* or as eval-mode code (false) */
3232
} jerry_snapshot_header_t;
3333

jerry-core/jerry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou
20202020
size_t source_size, /**< script source size */
20212021
bool is_for_global, /**< snapshot would be executed as global (true)
20222022
* or eval (false) */
2023-
uint8_t *buffer_p, /**< buffer to dump snapshot to */
2023+
uint8_t *buffer_p, /**< buffer to save snapshot to */
20242024
size_t buffer_size) /**< the buffer's size */
20252025
{
20262026
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
@@ -2095,7 +2095,7 @@ jerry_parse_and_save_snapshot (const jerry_api_char_t *source_p, /**< script sou
20952095
lit_mem_to_snapshot_id_map_entry_t *lit_map_p = NULL;
20962096
uint32_t literals_num;
20972097

2098-
if (!lit_dump_literals_for_snapshot (buffer_p,
2098+
if (!lit_save_literals_for_snapshot (buffer_p,
20992099
buffer_size,
21002100
&snapshot_buffer_write_offset,
21012101
&lit_map_p,

jerry-core/lit/lit-snapshot.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2015 Samsung Electronics Co., Ltd.
1+
/* Copyright 2015-2016 Samsung Electronics Co., Ltd.
22
* Copyright 2015-2016 University of Szeged
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,14 +22,14 @@
2222
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
2323

2424
/**
25-
* Dump a record to specified snapshot buffer.
25+
* Save a record to specified snapshot buffer.
2626
*
27-
* @return number of bytes dumped,
28-
* or 0 - upon dump failure
27+
* @return number of bytes saved,
28+
* or 0 - upon save failure
2929
*/
3030
static uint32_t
31-
lit_snapshot_dump (lit_literal_t lit, /**< literal to dump */
32-
uint8_t *buffer_p, /**< buffer to dump to */
31+
lit_snapshot_save (lit_literal_t lit, /**< literal to save */
32+
uint8_t *buffer_p, /**< buffer to save to */
3333
size_t buffer_size, /**< buffer size */
3434
size_t *in_out_buffer_offset_p) /**< [in,out] buffer write offset */
3535
{
@@ -118,23 +118,23 @@ lit_snapshot_dump (lit_literal_t lit, /**< literal to dump */
118118

119119
JERRY_UNREACHABLE ();
120120
return 0;
121-
} /* lit_snapshot_dump */
121+
} /* lit_snapshot_save */
122122

123123
/**
124-
* Dump literals to specified snapshot buffer.
124+
* Save literals to specified snapshot buffer.
125125
*
126-
* @return true, if dump was performed successfully (i.e. buffer size is sufficient),
126+
* @return true, if save was performed successfully (i.e. buffer size is sufficient),
127127
* false - otherwise.
128128
*/
129129
bool
130-
lit_dump_literals_for_snapshot (uint8_t *buffer_p, /**< [out] output snapshot buffer */
130+
lit_save_literals_for_snapshot (uint8_t *buffer_p, /**< [out] output snapshot buffer */
131131
size_t buffer_size, /**< size of the buffer */
132132
size_t *in_out_buffer_offset_p, /**< [in,out] write position in the buffer */
133133
lit_mem_to_snapshot_id_map_entry_t **out_map_p, /**< [out] map from literal identifiers
134134
* to the literal offsets
135135
* in snapshot */
136136
uint32_t *out_map_num_p, /**< [out] number of literals */
137-
uint32_t *out_lit_table_size_p) /**< [out] number of bytes, dumped to snapshot buffer */
137+
uint32_t *out_lit_table_size_p) /**< [out] number of bytes, saved to snapshot buffer */
138138
{
139139
uint32_t literals_num = lit_count_literals ();
140140
uint32_t lit_table_size = 0;
@@ -186,7 +186,7 @@ lit_dump_literals_for_snapshot (uint8_t *buffer_p, /**< [out] output snapshot bu
186186
break;
187187
}
188188

189-
uint32_t bytes = lit_snapshot_dump (lit, buffer_p, buffer_size, in_out_buffer_offset_p);
189+
uint32_t bytes = lit_snapshot_save (lit, buffer_p, buffer_size, in_out_buffer_offset_p);
190190

191191
if (bytes == 0)
192192
{
@@ -241,7 +241,7 @@ lit_dump_literals_for_snapshot (uint8_t *buffer_p, /**< [out] output snapshot bu
241241
*out_map_num_p = literals_num;
242242
*out_lit_table_size_p = aligned_size;
243243
return true;
244-
} /* lit_dump_literals_for_snapshot */
244+
} /* lit_save_literals_for_snapshot */
245245

246246
#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
247247

@@ -250,7 +250,7 @@ lit_dump_literals_for_snapshot (uint8_t *buffer_p, /**< [out] output snapshot bu
250250
/**
251251
* Load literals from snapshot.
252252
*
253-
* @return true, if load was performed successfully (i.e. literals dump in the snapshot is consistent),
253+
* @return true, if load was performed successfully (i.e. literals saved in the snapshot are consistent),
254254
* false - otherwise (i.e. snapshot is incorrect).
255255
*/
256256
bool

jerry-core/lit/lit-snapshot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ typedef struct
2828

2929
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
3030
extern bool
31-
lit_dump_literals_for_snapshot (uint8_t *,
31+
lit_save_literals_for_snapshot (uint8_t *,
3232
size_t,
3333
size_t *,
3434
lit_mem_to_snapshot_id_map_entry_t **,

0 commit comments

Comments
 (0)