Removing try_get_string_by_idx and get_number_by_idx.

This commit is contained in:
Ruben Ayrapetyan
2014-08-28 21:19:44 +04:00
parent b36f997ef2
commit 16cbe0c63b
5 changed files with 17 additions and 65 deletions
-46
View File
@@ -13,7 +13,6 @@
* limitations under the License.
*/
#include "deserializer.h"
#include "ecma-gc.h"
#include "ecma-globals.h"
#include "ecma-global-object.h"
@@ -190,51 +189,6 @@ run_int_from_pos (opcode_counter_t start_pos,
return completion;
}
/**
* Copy zero-terminated string literal value to specified buffer.
*
* @return upon success - number of bytes actually copied,
* otherwise (buffer size is not enough) - negated minimum required buffer size.
*/
ssize_t
try_get_string_by_idx (idx_t idx, /**< literal id */
ecma_char_t *buffer_p, /**< buffer */
ssize_t buffer_size) /**< buffer size */
{
const ecma_char_t *str_p = deserialize_string_by_id (idx);
JERRY_ASSERT (str_p != NULL);
FIXME (ecma_char_t strlen);
ssize_t req_length = (ssize_t)__strlen ((const char*)str_p) + 1;
if (buffer_size < req_length)
{
return -req_length;
}
FIXME (ecma_char_t strncpy);
JERRY_ASSERT (buffer_p != NULL);
__strncpy ((char*)buffer_p, (const char*)str_p, (size_t)req_length);
return req_length;
} /* try_get_string_by_idx */
/**
* Get number literal value.
*
* @return value of number literal, corresponding to specified literal id
*/
ecma_number_t
get_number_by_idx (idx_t idx) /**< literal id */
{
ecma_number_t num = deserialize_num_by_id (idx);
return num;
} /* get_number_by_idx */
/**
* Get specified opcode from the program.
*/
-3
View File
@@ -29,9 +29,6 @@ ecma_completion_value_t run_int_from_pos (opcode_counter_t start_pos,
bool is_strict,
bool is_eval_code);
ssize_t try_get_string_by_idx (idx_t idx, ecma_char_t *buffer_p, ssize_t buffer_size);
ecma_number_t get_number_by_idx (idx_t idx);
opcode_t read_opcode (opcode_counter_t counter);
#endif /* INTERPRETER_H */
+3 -3
View File
@@ -13,11 +13,11 @@
* limitations under the License.
*/
#include "opcodes-ecma-support.h"
#include "deserializer.h"
#include "globals.h"
#include "interpreter.h"
#include "opcodes.h"
#include "opcodes-ecma-support.h"
/**
* Note:
@@ -159,7 +159,7 @@ opfunc_assignment (opcode_t opdata, /**< operation data */
case OPCODE_ARG_TYPE_NUMBER:
{
ecma_number_t *num_p = ecma_alloc_number ();
*num_p = get_number_by_idx (src_val_descr);
*num_p = deserialize_num_by_id (src_val_descr);
get_value_completion = ecma_make_completion_value (ECMA_COMPLETION_TYPE_NORMAL,
ecma_make_number_value (num_p),