mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Merge branch 'master' of git-server:jerry
This commit is contained in:
commit
c6baf89035
@ -229,10 +229,12 @@ ifeq ($(OPTION_MCU),disable)
|
|||||||
|
|
||||||
ifeq ($(OPTION_MUSL),enable)
|
ifeq ($(OPTION_MUSL),enable)
|
||||||
CC := musl-$(CC)
|
CC := musl-$(CC)
|
||||||
|
DEFINES_JERRY += -DLIBC_MUSL
|
||||||
CFLAGS_COMMON += -static
|
CFLAGS_COMMON += -static
|
||||||
else
|
else
|
||||||
CFLAGS_COMMON += -fsanitize=address
|
CFLAGS_COMMON += -fsanitize=address
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OPTION_COLOR),enable)
|
ifeq ($(OPTION_COLOR),enable)
|
||||||
CFLAGS_COMMON += -fdiagnostics-color=always
|
CFLAGS_COMMON += -fdiagnostics-color=always
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -46,7 +46,7 @@ run_int (void)
|
|||||||
{
|
{
|
||||||
JERRY_ASSERT( __program != NULL );
|
JERRY_ASSERT( __program != NULL );
|
||||||
|
|
||||||
const int start_pos = 0;
|
const interp_bytecode_idx start_pos = 0;
|
||||||
ecma_object_t *this_binding_p = NULL;
|
ecma_object_t *this_binding_p = NULL;
|
||||||
ecma_object_t *lex_env_p = ecma_create_lexical_environment (NULL,
|
ecma_object_t *lex_env_p = ecma_create_lexical_environment (NULL,
|
||||||
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE);
|
||||||
@ -88,7 +88,7 @@ run_int (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
run_int_from_pos (int start_pos,
|
run_int_from_pos (interp_bytecode_idx start_pos,
|
||||||
ecma_object_t *this_binding_p,
|
ecma_object_t *this_binding_p,
|
||||||
ecma_object_t *lex_env_p,
|
ecma_object_t *lex_env_p,
|
||||||
bool is_strict)
|
bool is_strict)
|
||||||
@ -111,7 +111,7 @@ run_int_from_pos (int start_pos,
|
|||||||
JERRY_ASSERT( ecma_is_value_empty( regs[0]) );
|
JERRY_ASSERT( ecma_is_value_empty( regs[0]) );
|
||||||
|
|
||||||
struct __int_data int_data;
|
struct __int_data int_data;
|
||||||
int_data.pos = start_pos + 1;
|
int_data.pos = (interp_bytecode_idx) (start_pos + 1);
|
||||||
int_data.this_binding_p = this_binding_p;
|
int_data.this_binding_p = this_binding_p;
|
||||||
int_data.lex_env_p = lex_env_p;
|
int_data.lex_env_p = lex_env_p;
|
||||||
int_data.is_strict = is_strict;
|
int_data.is_strict = is_strict;
|
||||||
|
|||||||
@ -20,9 +20,11 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "opcodes.h"
|
#include "opcodes.h"
|
||||||
|
|
||||||
|
typedef uint16_t interp_bytecode_idx;
|
||||||
|
|
||||||
struct __int_data
|
struct __int_data
|
||||||
{
|
{
|
||||||
int pos; /**< current opcode to execute */
|
interp_bytecode_idx pos; /**< current opcode to execute */
|
||||||
ecma_object_t *this_binding_p; /**< this binding for current context */
|
ecma_object_t *this_binding_p; /**< this binding for current context */
|
||||||
ecma_object_t *lex_env_p; /**< current lexical environment */
|
ecma_object_t *lex_env_p; /**< current lexical environment */
|
||||||
bool is_strict; /**< is current code execution mode strict? */
|
bool is_strict; /**< is current code execution mode strict? */
|
||||||
@ -33,7 +35,7 @@ struct __int_data
|
|||||||
|
|
||||||
void init_int (const OPCODE* program_p);
|
void init_int (const OPCODE* program_p);
|
||||||
bool run_int (void);
|
bool run_int (void);
|
||||||
ecma_completion_value_t run_int_from_pos (int start_pos,
|
ecma_completion_value_t run_int_from_pos (interp_bytecode_idx start_pos,
|
||||||
ecma_object_t *this_binding_p,
|
ecma_object_t *this_binding_p,
|
||||||
ecma_object_t *lex_env_p,
|
ecma_object_t *lex_env_p,
|
||||||
bool is_strict);
|
bool is_strict);
|
||||||
|
|||||||
@ -564,7 +564,9 @@ ecma_completion_value_t
|
|||||||
opfunc_jmp_down (OPCODE opdata, /**< operation data */
|
opfunc_jmp_down (OPCODE opdata, /**< operation data */
|
||||||
struct __int_data *int_data) /**< interpreter context */
|
struct __int_data *int_data) /**< interpreter context */
|
||||||
{
|
{
|
||||||
int_data->pos += opdata.data.jmp_down.opcode_count;
|
JERRY_ASSERT( int_data->pos <= int_data->pos + opdata.data.jmp_up.opcode_count );
|
||||||
|
|
||||||
|
int_data->pos = (interp_bytecode_idx) ( int_data->pos + opdata.data.jmp_down.opcode_count );
|
||||||
|
|
||||||
return ecma_make_empty_completion_value();
|
return ecma_make_empty_completion_value();
|
||||||
} /* opfunc_jmp_down */
|
} /* opfunc_jmp_down */
|
||||||
@ -579,9 +581,9 @@ ecma_completion_value_t
|
|||||||
opfunc_jmp_up (OPCODE opdata, /**< operation data */
|
opfunc_jmp_up (OPCODE opdata, /**< operation data */
|
||||||
struct __int_data *int_data) /**< interpreter context */
|
struct __int_data *int_data) /**< interpreter context */
|
||||||
{
|
{
|
||||||
int_data->pos -= opdata.data.jmp_up.opcode_count;
|
JERRY_ASSERT( int_data->pos >= opdata.data.jmp_up.opcode_count );
|
||||||
|
|
||||||
JERRY_ASSERT( int_data->pos >= 0 );
|
int_data->pos = (interp_bytecode_idx) ( int_data->pos - opdata.data.jmp_down.opcode_count );
|
||||||
|
|
||||||
return ecma_make_empty_completion_value();
|
return ecma_make_empty_completion_value();
|
||||||
} /* opfunc_jmp_up */
|
} /* opfunc_jmp_up */
|
||||||
|
|||||||
@ -147,6 +147,8 @@ typedef enum {
|
|||||||
ECMA_INTERNAL_PROPERTY_PROTOTYPE, /**< [[Prototype]] */
|
ECMA_INTERNAL_PROPERTY_PROTOTYPE, /**< [[Prototype]] */
|
||||||
ECMA_INTERNAL_PROPERTY_EXTENSIBLE, /**< [[Extensible]] */
|
ECMA_INTERNAL_PROPERTY_EXTENSIBLE, /**< [[Extensible]] */
|
||||||
ECMA_INTERNAL_PROPERTY_SCOPE, /**< [[Scope]] */
|
ECMA_INTERNAL_PROPERTY_SCOPE, /**< [[Scope]] */
|
||||||
|
ECMA_INTERNAL_PROPERTY_CODE, /**< [[Code]] */
|
||||||
|
ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS, /**< [[FormalParameters]] */
|
||||||
|
|
||||||
/** provideThis property of lexical environment */
|
/** provideThis property of lexical environment */
|
||||||
ECMA_INTERNAL_PROPERTY_PROVIDE_THIS,
|
ECMA_INTERNAL_PROPERTY_PROVIDE_THIS,
|
||||||
@ -243,7 +245,7 @@ typedef struct ecma_property_t {
|
|||||||
unsigned int internal_property_type : 4;
|
unsigned int internal_property_type : 4;
|
||||||
|
|
||||||
/** Value (may be a compressed pointer) */
|
/** Value (may be a compressed pointer) */
|
||||||
unsigned int value : ECMA_POINTER_FIELD_WIDTH;
|
uint32_t value;
|
||||||
} internal_property;
|
} internal_property;
|
||||||
} u;
|
} u;
|
||||||
} ecma_property_t;
|
} ecma_property_t;
|
||||||
@ -289,16 +291,34 @@ typedef enum {
|
|||||||
* Internal object types
|
* Internal object types
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ECMA_GENERAL_OBJECT, /**< all objects that are not String (15.5), Function (15.3),
|
ECMA_OBJECT_TYPE_GENERAL, /**< all objects that are not String (15.5), Function (15.3),
|
||||||
Arguments (10.6), Array (15.4) specification-defined objects
|
Arguments (10.6), Array (15.4) specification-defined objects
|
||||||
and not host objects */
|
and not host objects */
|
||||||
ECMA_STRING_OBJECT, /**< String objects (15.5) */
|
ECMA_OBJECT_TYPE_STRING, /**< String objects (15.5) */
|
||||||
ECMA_FUNCTION_OBJECT, /**< Function objects (15.3) */
|
ECMA_OBJECT_TYPE_FUNCTION, /**< Function objects (15.3) */
|
||||||
ECMA_ARGUMENTS_OBJECT, /**< Arguments object (10.6) */
|
ECMA_OBJECT_TYPE_ARGUMENTS, /**< Arguments object (10.6) */
|
||||||
ECMA_ARRAY_OBJECT, /**< Array object (15.4) */
|
ECMA_OBJECT_TYPE_ARRAY, /**< Array object (15.4) */
|
||||||
ECMA_HOST_OBJECT /**< Host object */
|
ECMA_OBJECT_TYPE_HOST /**< Host object */
|
||||||
} ecma_object_type_t;
|
} ecma_object_type_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ECMA-defined object classes
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
ECMA_OBJECT_CLASS_OBJECT, /**< "Object" */
|
||||||
|
ECMA_OBJECT_CLASS_FUNCTION, /**< "Function" */
|
||||||
|
ECMA_OBJECT_CLASS_ARGUMENTS, /**< "Arguments" */
|
||||||
|
ECMA_OBJECT_CLASS_ARRAY, /**< "Array" */
|
||||||
|
ECMA_OBJECT_CLASS_BOOLEAN, /**< "Boolean" */
|
||||||
|
ECMA_OBJECT_CLASS_DATE, /**< "Date" */
|
||||||
|
ECMA_OBJECT_CLASS_ERROR, /**< "Error" */
|
||||||
|
ECMA_OBJECT_CLASS_JSON, /**< "JSON" */
|
||||||
|
ECMA_OBJECT_CLASS_MATH, /**< "Math" */
|
||||||
|
ECMA_OBJECT_CLASS_NUMBER, /**< "Number" */
|
||||||
|
ECMA_OBJECT_CLASS_REGEXP, /**< "RegExp" */
|
||||||
|
ECMA_OBJECT_CLASS_STRING /**< "String" */
|
||||||
|
} ecma_object_class_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of ECMA-object or lexical environment
|
* Description of ECMA-object or lexical environment
|
||||||
* (depending on is_lexical_environment).
|
* (depending on is_lexical_environment).
|
||||||
@ -324,7 +344,7 @@ typedef struct ecma_object_t {
|
|||||||
unsigned int extensible : 1;
|
unsigned int extensible : 1;
|
||||||
|
|
||||||
/** Implementation internal object type (ecma_object_type_t) */
|
/** Implementation internal object type (ecma_object_type_t) */
|
||||||
unsigned int object_type : 3;
|
unsigned int type : 3;
|
||||||
|
|
||||||
/** Compressed pointer to prototype object (ecma_object_t) */
|
/** Compressed pointer to prototype object (ecma_object_t) */
|
||||||
unsigned int prototype_object_p : ECMA_POINTER_FIELD_WIDTH;
|
unsigned int prototype_object_p : ECMA_POINTER_FIELD_WIDTH;
|
||||||
@ -474,7 +494,7 @@ typedef struct
|
|||||||
ecma_value_t base;
|
ecma_value_t base;
|
||||||
|
|
||||||
/** referenced name value pointer */
|
/** referenced name value pointer */
|
||||||
ecma_char_t *referenced_name_p;
|
const ecma_char_t *referenced_name_p;
|
||||||
|
|
||||||
/** strict reference flag */
|
/** strict reference flag */
|
||||||
bool is_strict;
|
bool is_strict;
|
||||||
|
|||||||
@ -79,7 +79,8 @@ ecma_decompress_pointer(uintptr_t compressed_pointer) /**< pointer to decompress
|
|||||||
*/
|
*/
|
||||||
ecma_object_t*
|
ecma_object_t*
|
||||||
ecma_create_object( ecma_object_t *prototype_object_p, /**< pointer to prototybe of the object (or NULL) */
|
ecma_create_object( ecma_object_t *prototype_object_p, /**< pointer to prototybe of the object (or NULL) */
|
||||||
bool is_extensible) /**< value of extensible attribute */
|
bool is_extensible, /**< value of extensible attribute */
|
||||||
|
ecma_object_type_t type) /**< object type */
|
||||||
{
|
{
|
||||||
ecma_object_t *object_p = ecma_alloc_object();
|
ecma_object_t *object_p = ecma_alloc_object();
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ ecma_create_object( ecma_object_t *prototype_object_p, /**< pointer to prototybe
|
|||||||
|
|
||||||
object_p->u.object.extensible = is_extensible;
|
object_p->u.object.extensible = is_extensible;
|
||||||
ecma_set_pointer( object_p->u.object.prototype_object_p, prototype_object_p);
|
ecma_set_pointer( object_p->u.object.prototype_object_p, prototype_object_p);
|
||||||
|
object_p->u.object.type = type;
|
||||||
|
|
||||||
return object_p;
|
return object_p;
|
||||||
} /* ecma_create_object */
|
} /* ecma_create_object */
|
||||||
@ -111,7 +113,7 @@ ecma_create_object( ecma_object_t *prototype_object_p, /**< pointer to prototybe
|
|||||||
*/
|
*/
|
||||||
ecma_object_t*
|
ecma_object_t*
|
||||||
ecma_create_lexical_environment(ecma_object_t *outer_lexical_environment_p, /**< outer lexical environment */
|
ecma_create_lexical_environment(ecma_object_t *outer_lexical_environment_p, /**< outer lexical environment */
|
||||||
ecma_lexical_environment_type_t type) /**< type of lexical environment to create */
|
ecma_lexical_environment_type_t type) /**< type of lexical environment to create */
|
||||||
{
|
{
|
||||||
ecma_object_t *new_lexical_environment_p = ecma_alloc_object();
|
ecma_object_t *new_lexical_environment_p = ecma_alloc_object();
|
||||||
|
|
||||||
@ -123,6 +125,11 @@ ecma_create_lexical_environment(ecma_object_t *outer_lexical_environment_p, /**<
|
|||||||
new_lexical_environment_p->GCInfo.is_object_valid = true;
|
new_lexical_environment_p->GCInfo.is_object_valid = true;
|
||||||
new_lexical_environment_p->GCInfo.u.refs = 1;
|
new_lexical_environment_p->GCInfo.u.refs = 1;
|
||||||
|
|
||||||
|
if ( outer_lexical_environment_p != NULL )
|
||||||
|
{
|
||||||
|
ecma_ref_object( outer_lexical_environment_p);
|
||||||
|
}
|
||||||
|
|
||||||
ecma_set_pointer( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
ecma_set_pointer( new_lexical_environment_p->u.lexical_environment.outer_reference_p, outer_lexical_environment_p);
|
||||||
|
|
||||||
return new_lexical_environment_p;
|
return new_lexical_environment_p;
|
||||||
@ -132,11 +139,11 @@ ecma_create_lexical_environment(ecma_object_t *outer_lexical_environment_p, /**<
|
|||||||
* Create internal property in an object and link it
|
* Create internal property in an object and link it
|
||||||
* into the object's properties' linked-list
|
* into the object's properties' linked-list
|
||||||
*
|
*
|
||||||
* @return pointer to newly created property's des
|
* @return pointer to newly created property
|
||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_create_internal_property(ecma_object_t *object_p, /**< the object */
|
ecma_create_internal_property(ecma_object_t *object_p, /**< the object */
|
||||||
ecma_internal_property_id_t property_id) /**< internal property identifier */
|
ecma_internal_property_id_t property_id) /**< internal property identifier */
|
||||||
{
|
{
|
||||||
ecma_property_t *new_property_p = ecma_alloc_property();
|
ecma_property_t *new_property_p = ecma_alloc_property();
|
||||||
|
|
||||||
@ -209,7 +216,7 @@ ecma_get_internal_property(ecma_object_t *object_p, /**< object descriptor */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_create_named_data_property(ecma_object_t *obj_p, /**< object */
|
ecma_create_named_data_property(ecma_object_t *obj_p, /**< object */
|
||||||
ecma_char_t *name_p, /**< property name */
|
const ecma_char_t *name_p, /**< property name */
|
||||||
ecma_property_writable_value_t writable, /**< 'writable' attribute */
|
ecma_property_writable_value_t writable, /**< 'writable' attribute */
|
||||||
ecma_property_enumerable_value_t enumerable, /**< 'enumerable' attribute */
|
ecma_property_enumerable_value_t enumerable, /**< 'enumerable' attribute */
|
||||||
ecma_property_configurable_value_t configurable) /**< 'configurable' attribute */
|
ecma_property_configurable_value_t configurable) /**< 'configurable' attribute */
|
||||||
@ -241,7 +248,7 @@ ecma_create_named_data_property(ecma_object_t *obj_p, /**< object */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_create_named_accessor_property(ecma_object_t *obj_p, /**< object */
|
ecma_create_named_accessor_property(ecma_object_t *obj_p, /**< object */
|
||||||
ecma_char_t *name_p, /**< property name */
|
const ecma_char_t *name_p, /**< property name */
|
||||||
ecma_object_t *get_p, /**< getter */
|
ecma_object_t *get_p, /**< getter */
|
||||||
ecma_object_t *set_p, /**< setter */
|
ecma_object_t *set_p, /**< setter */
|
||||||
ecma_property_enumerable_value_t enumerable, /**< 'enumerable' attribute */
|
ecma_property_enumerable_value_t enumerable, /**< 'enumerable' attribute */
|
||||||
@ -275,7 +282,7 @@ ecma_create_named_accessor_property(ecma_object_t *obj_p, /**< object */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_find_named_property(ecma_object_t *obj_p, /**< object to find property in */
|
ecma_find_named_property(ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_char_t *name_p) /**< property's name */
|
const ecma_char_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL );
|
JERRY_ASSERT( obj_p != NULL );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -319,7 +326,7 @@ ecma_find_named_property(ecma_object_t *obj_p, /**< object to find property in *
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_get_named_property(ecma_object_t *obj_p, /**< object to find property in */
|
ecma_get_named_property(ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_char_t *name_p) /**< property's name */
|
const ecma_char_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL );
|
JERRY_ASSERT( obj_p != NULL );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -342,7 +349,7 @@ ecma_get_named_property(ecma_object_t *obj_p, /**< object to find property in */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_get_named_data_property(ecma_object_t *obj_p, /**< object to find property in */
|
ecma_get_named_data_property(ecma_object_t *obj_p, /**< object to find property in */
|
||||||
ecma_char_t *name_p) /**< property's name */
|
const ecma_char_t *name_p) /**< property's name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL );
|
JERRY_ASSERT( obj_p != NULL );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -407,9 +414,9 @@ ecma_free_internal_property( ecma_property_t *property_p) /**< the property */
|
|||||||
|
|
||||||
switch ( property_id )
|
switch ( property_id )
|
||||||
{
|
{
|
||||||
case ECMA_INTERNAL_PROPERTY_CLASS: /* a string */
|
|
||||||
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* an array */
|
case ECMA_INTERNAL_PROPERTY_NUMBER_INDEXED_ARRAY_VALUES: /* an array */
|
||||||
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* an array */
|
case ECMA_INTERNAL_PROPERTY_STRING_INDEXED_ARRAY_VALUES: /* an array */
|
||||||
|
case ECMA_INTERNAL_PROPERTY_FORMAL_PARAMETERS: /* an array */
|
||||||
{
|
{
|
||||||
ecma_free_array( ecma_get_pointer( property_value));
|
ecma_free_array( ecma_get_pointer( property_value));
|
||||||
break;
|
break;
|
||||||
@ -425,6 +432,8 @@ ecma_free_internal_property( ecma_property_t *property_p) /**< the property */
|
|||||||
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t */
|
case ECMA_INTERNAL_PROPERTY_PROTOTYPE: /* the property's value is located in ecma_object_t */
|
||||||
case ECMA_INTERNAL_PROPERTY_EXTENSIBLE: /* the property's value is located in ecma_object_t */
|
case ECMA_INTERNAL_PROPERTY_EXTENSIBLE: /* the property's value is located in ecma_object_t */
|
||||||
case ECMA_INTERNAL_PROPERTY_PROVIDE_THIS: /* a boolean flag */
|
case ECMA_INTERNAL_PROPERTY_PROVIDE_THIS: /* a boolean flag */
|
||||||
|
case ECMA_INTERNAL_PROPERTY_CLASS: /* an enum */
|
||||||
|
case ECMA_INTERNAL_PROPERTY_CODE: /* an integer */
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -657,15 +666,15 @@ ecma_compare_ecma_string_to_ecma_string(const ecma_array_first_chunk_t *string1_
|
|||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ecma_compare_zt_string_to_ecma_string(const ecma_char_t *string_p, /**< zero-terminated string */
|
ecma_compare_zt_string_to_ecma_string(const ecma_char_t *string_p, /**< zero-terminated string */
|
||||||
const ecma_array_first_chunk_t *ecma_string_p) /* ecma-string */
|
const ecma_array_first_chunk_t *ecma_string_p) /* ecma-string */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( string_p != NULL );
|
JERRY_ASSERT( string_p != NULL );
|
||||||
JERRY_ASSERT( ecma_string_p != NULL );
|
JERRY_ASSERT( ecma_string_p != NULL );
|
||||||
|
|
||||||
const ecma_char_t *str_iter_p = string_p;
|
const ecma_char_t *str_iter_p = string_p;
|
||||||
ecma_length_t ecma_str_len = ecma_string_p->header.unit_number;
|
ecma_length_t ecma_str_len = ecma_string_p->header.unit_number;
|
||||||
const ecma_char_t *current_chunk_chars_cur = (ecma_char_t*) ecma_string_p->data,
|
const ecma_char_t *current_chunk_chars_cur = (const ecma_char_t*) ecma_string_p->data,
|
||||||
*current_chunk_chars_end = (ecma_char_t*) (ecma_string_p->data
|
*current_chunk_chars_end = (const ecma_char_t*) (ecma_string_p->data
|
||||||
+ sizeof(ecma_string_p->data));
|
+ sizeof(ecma_string_p->data));
|
||||||
|
|
||||||
JERRY_STATIC_ASSERT( ECMA_POINTER_FIELD_WIDTH <= sizeof(uint16_t) * JERRY_BITSINBYTE );
|
JERRY_STATIC_ASSERT( ECMA_POINTER_FIELD_WIDTH <= sizeof(uint16_t) * JERRY_BITSINBYTE );
|
||||||
@ -684,8 +693,8 @@ ecma_compare_zt_string_to_ecma_string(const ecma_char_t *string_p, /**< zero-ter
|
|||||||
|
|
||||||
JERRY_ASSERT( next_chunk_p != NULL );
|
JERRY_ASSERT( next_chunk_p != NULL );
|
||||||
|
|
||||||
current_chunk_chars_cur = (ecma_char_t*) ecma_string_p->data;
|
current_chunk_chars_cur = (const ecma_char_t*) ecma_string_p->data;
|
||||||
current_chunk_chars_end = (ecma_char_t*) (next_chunk_p->data + sizeof(next_chunk_p->data));
|
current_chunk_chars_end = (const ecma_char_t*) (next_chunk_p->data + sizeof(next_chunk_p->data));
|
||||||
|
|
||||||
next_chunk_compressed_pointer_p = &next_chunk_p->next_chunk_p;
|
next_chunk_compressed_pointer_p = &next_chunk_p->next_chunk_p;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,7 @@ extern bool ecma_is_completion_value_normal_true( ecma_completion_value_t value)
|
|||||||
extern bool ecma_is_completion_value_normal_false( ecma_completion_value_t value);
|
extern bool ecma_is_completion_value_normal_false( ecma_completion_value_t value);
|
||||||
extern bool ecma_is_empty_completion_value( ecma_completion_value_t value);
|
extern bool ecma_is_empty_completion_value( ecma_completion_value_t value);
|
||||||
|
|
||||||
extern ecma_object_t* ecma_create_object( ecma_object_t *prototype_object_p, bool is_extensible);
|
extern ecma_object_t* ecma_create_object( ecma_object_t *prototype_object_p, bool is_extensible, ecma_object_type_t type);
|
||||||
extern ecma_object_t* ecma_create_lexical_environment( ecma_object_t *outer_lexical_environment_p, ecma_lexical_environment_type_t type);
|
extern ecma_object_t* ecma_create_lexical_environment( ecma_object_t *outer_lexical_environment_p, ecma_lexical_environment_type_t type);
|
||||||
|
|
||||||
/* ecma-helpers.c */
|
/* ecma-helpers.c */
|
||||||
@ -77,11 +77,11 @@ extern ecma_property_t* ecma_create_internal_property(ecma_object_t *object_p, e
|
|||||||
extern ecma_property_t* ecma_find_internal_property(ecma_object_t *object_p, ecma_internal_property_id_t property_id);
|
extern ecma_property_t* ecma_find_internal_property(ecma_object_t *object_p, ecma_internal_property_id_t property_id);
|
||||||
extern ecma_property_t* ecma_get_internal_property(ecma_object_t *object_p, ecma_internal_property_id_t property_id);
|
extern ecma_property_t* ecma_get_internal_property(ecma_object_t *object_p, ecma_internal_property_id_t property_id);
|
||||||
|
|
||||||
extern ecma_property_t *ecma_create_named_data_property(ecma_object_t *obj_p, ecma_char_t *name_p, ecma_property_writable_value_t writable, ecma_property_enumerable_value_t enumerable, ecma_property_configurable_value_t configurable);
|
extern ecma_property_t *ecma_create_named_data_property(ecma_object_t *obj_p, const ecma_char_t *name_p, ecma_property_writable_value_t writable, ecma_property_enumerable_value_t enumerable, ecma_property_configurable_value_t configurable);
|
||||||
extern ecma_property_t *ecma_create_named_accessor_property(ecma_object_t *obj_p, ecma_char_t *name_p, ecma_object_t *get_p, ecma_object_t *set_p, ecma_property_enumerable_value_t enumerable, ecma_property_configurable_value_t configurable);
|
extern ecma_property_t *ecma_create_named_accessor_property(ecma_object_t *obj_p, const ecma_char_t *name_p, ecma_object_t *get_p, ecma_object_t *set_p, ecma_property_enumerable_value_t enumerable, ecma_property_configurable_value_t configurable);
|
||||||
extern ecma_property_t *ecma_find_named_property(ecma_object_t *obj_p, ecma_char_t *name_p);
|
extern ecma_property_t *ecma_find_named_property(ecma_object_t *obj_p, const ecma_char_t *name_p);
|
||||||
extern ecma_property_t *ecma_get_named_property(ecma_object_t *obj_p, ecma_char_t *name_p);
|
extern ecma_property_t *ecma_get_named_property(ecma_object_t *obj_p, const ecma_char_t *name_p);
|
||||||
extern ecma_property_t *ecma_get_named_data_property(ecma_object_t *obj_p, ecma_char_t *name_p);
|
extern ecma_property_t *ecma_get_named_data_property(ecma_object_t *obj_p, const ecma_char_t *name_p);
|
||||||
|
|
||||||
extern void ecma_free_internal_property(ecma_property_t *prop_p);
|
extern void ecma_free_internal_property(ecma_property_t *prop_p);
|
||||||
extern void ecma_free_named_data_property(ecma_property_t *prop_p);
|
extern void ecma_free_named_data_property(ecma_property_t *prop_p);
|
||||||
|
|||||||
@ -39,7 +39,7 @@
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_has_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_has_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p) /**< argument N */
|
const ecma_char_t *name_p) /**< argument N */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
|
|
||||||
@ -78,8 +78,8 @@ ecma_op_has_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_create_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_create_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p, /**< argument N */
|
const ecma_char_t *name_p, /**< argument N */
|
||||||
bool is_deletable) /**< argument D */
|
bool is_deletable) /**< argument D */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -119,9 +119,9 @@ ecma_op_create_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environmen
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_set_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_set_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p, /**< argument N */
|
const ecma_char_t *name_p, /**< argument N */
|
||||||
ecma_value_t value, /**< argument V */
|
ecma_value_t value, /**< argument V */
|
||||||
bool is_strict) /**< argument S */
|
bool is_strict) /**< argument S */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -164,8 +164,8 @@ ecma_op_set_mutable_binding(ecma_object_t *lex_env_p, /**< lexical environment *
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_get_binding_value(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_get_binding_value(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p, /**< argument N */
|
const ecma_char_t *name_p, /**< argument N */
|
||||||
bool is_strict) /**< argument S */
|
bool is_strict) /**< argument S */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -222,7 +222,7 @@ ecma_op_get_binding_value(ecma_object_t *lex_env_p, /**< lexical environment */
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_delete_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_delete_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p) /**< argument N */
|
const ecma_char_t *name_p) /**< argument N */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( name_p != NULL );
|
JERRY_ASSERT( name_p != NULL );
|
||||||
@ -302,7 +302,7 @@ ecma_op_implicit_this_value( ecma_object_t *lex_env_p) /**< lexical environment
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ecma_op_create_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_create_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p) /**< argument N */
|
const ecma_char_t *name_p) /**< argument N */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
|
|
||||||
@ -343,8 +343,8 @@ ecma_op_create_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environm
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ecma_op_initialize_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_initialize_immutable_binding(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p, /**< argument N */
|
const ecma_char_t *name_p, /**< argument N */
|
||||||
ecma_value_t value) /**< argument V */
|
ecma_value_t value) /**< argument V */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
JERRY_ASSERT( lex_env_p != NULL && lex_env_p->is_lexical_environment );
|
||||||
|
|
||||||
|
|||||||
@ -29,16 +29,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* ECMA-262 v5, Table 17. Abstract methods of Environment Records */
|
/* ECMA-262 v5, Table 17. Abstract methods of Environment Records */
|
||||||
extern ecma_completion_value_t ecma_op_has_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
|
extern ecma_completion_value_t ecma_op_has_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p);
|
||||||
extern ecma_completion_value_t ecma_op_create_mutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_deletable);
|
extern ecma_completion_value_t ecma_op_create_mutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p, bool is_deletable);
|
||||||
extern ecma_completion_value_t ecma_op_set_mutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, ecma_value_t value, bool is_strict);
|
extern ecma_completion_value_t ecma_op_set_mutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p, ecma_value_t value, bool is_strict);
|
||||||
extern ecma_completion_value_t ecma_op_get_binding_value( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
|
extern ecma_completion_value_t ecma_op_get_binding_value( ecma_object_t *lex_env_p, const ecma_char_t *name_p, bool is_strict);
|
||||||
extern ecma_completion_value_t ecma_op_delete_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
|
extern ecma_completion_value_t ecma_op_delete_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p);
|
||||||
extern ecma_completion_value_t ecma_op_implicit_this_value( ecma_object_t *lex_env_p);
|
extern ecma_completion_value_t ecma_op_implicit_this_value( ecma_object_t *lex_env_p);
|
||||||
|
|
||||||
/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
|
/* ECMA-262 v5, Table 18. Additional methods of Declarative Environment Records */
|
||||||
extern void ecma_op_create_immutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p);
|
extern void ecma_op_create_immutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p);
|
||||||
extern void ecma_op_initialize_immutable_binding( ecma_object_t *lex_env_p, ecma_char_t *name_p, ecma_value_t value);
|
extern void ecma_op_initialize_immutable_binding( ecma_object_t *lex_env_p, const ecma_char_t *name_p, ecma_value_t value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_object_get( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_get( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p) /**< property name */
|
const ecma_char_t *property_name_p) /**< property name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( property_name_p != NULL );
|
JERRY_ASSERT( property_name_p != NULL );
|
||||||
@ -96,7 +96,7 @@ ecma_op_object_get( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_op_object_get_own_property( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_get_own_property( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p) /**< property name */
|
const ecma_char_t *property_name_p) /**< property name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( property_name_p != NULL );
|
JERRY_ASSERT( property_name_p != NULL );
|
||||||
@ -121,7 +121,7 @@ ecma_op_object_get_own_property( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
ecma_property_t*
|
ecma_property_t*
|
||||||
ecma_op_object_get_property( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_get_property( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p) /**< property name */
|
const ecma_char_t *property_name_p) /**< property name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( property_name_p != NULL );
|
JERRY_ASSERT( property_name_p != NULL );
|
||||||
@ -166,7 +166,7 @@ ecma_op_object_get_property( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_object_put( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_put( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p, /**< property name */
|
const ecma_char_t *property_name_p, /**< property name */
|
||||||
ecma_value_t value, /**< ecma-value */
|
ecma_value_t value, /**< ecma-value */
|
||||||
bool is_throw) /**< flag that controls failure handling */
|
bool is_throw) /**< flag that controls failure handling */
|
||||||
{
|
{
|
||||||
@ -285,7 +285,7 @@ ecma_op_object_put( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p) /**< property name */
|
const ecma_char_t *property_name_p) /**< property name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( property_name_p != NULL );
|
JERRY_ASSERT( property_name_p != NULL );
|
||||||
@ -389,7 +389,7 @@ ecma_op_object_can_put( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
ecma_op_object_has_property( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_has_property( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p) /**< property name */
|
const ecma_char_t *property_name_p) /**< property name */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
JERRY_ASSERT( property_name_p != NULL );
|
JERRY_ASSERT( property_name_p != NULL );
|
||||||
@ -416,7 +416,7 @@ ecma_op_object_has_property( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_object_delete( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_delete( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p, /**< property name */
|
const ecma_char_t *property_name_p, /**< property name */
|
||||||
bool is_throw) /**< flag that controls failure handling */
|
bool is_throw) /**< flag that controls failure handling */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
JERRY_ASSERT( obj_p != NULL && !obj_p->is_lexical_environment );
|
||||||
@ -501,7 +501,7 @@ ecma_op_object_default_value( ecma_object_t *obj_p, /**< the object */
|
|||||||
*/
|
*/
|
||||||
ecma_completion_value_t
|
ecma_completion_value_t
|
||||||
ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
ecma_op_object_define_own_property( ecma_object_t *obj_p, /**< the object */
|
||||||
ecma_char_t *property_name_p, /**< property name */
|
const ecma_char_t *property_name_p, /**< property name */
|
||||||
ecma_property_descriptor_t property_desc, /**< property descriptor */
|
ecma_property_descriptor_t property_desc, /**< property descriptor */
|
||||||
bool is_throw) /**< flag that controls failure handling */
|
bool is_throw) /**< flag that controls failure handling */
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,21 +26,21 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern ecma_completion_value_t ecma_op_object_get( ecma_object_t *obj_p, ecma_char_t *property_name_p);
|
extern ecma_completion_value_t ecma_op_object_get( ecma_object_t *obj_p, const ecma_char_t *property_name_p);
|
||||||
extern ecma_property_t *ecma_op_object_get_own_property( ecma_object_t *obj_p, ecma_char_t *property_name_p);
|
extern ecma_property_t *ecma_op_object_get_own_property( ecma_object_t *obj_p, const ecma_char_t *property_name_p);
|
||||||
extern ecma_property_t *ecma_op_object_get_property( ecma_object_t *obj_p, ecma_char_t *property_name_p);
|
extern ecma_property_t *ecma_op_object_get_property( ecma_object_t *obj_p, const ecma_char_t *property_name_p);
|
||||||
extern ecma_completion_value_t ecma_op_object_put( ecma_object_t *obj_p,
|
extern ecma_completion_value_t ecma_op_object_put( ecma_object_t *obj_p,
|
||||||
ecma_char_t *property_name_p,
|
const ecma_char_t *property_name_p,
|
||||||
ecma_value_t value,
|
ecma_value_t value,
|
||||||
bool is_throw);
|
bool is_throw);
|
||||||
extern bool ecma_op_object_can_put( ecma_object_t *obj_p, ecma_char_t *property_name_p);
|
extern bool ecma_op_object_can_put( ecma_object_t *obj_p, const ecma_char_t *property_name_p);
|
||||||
extern bool ecma_op_object_has_property( ecma_object_t *obj_p, ecma_char_t *property_name_p);
|
extern bool ecma_op_object_has_property( ecma_object_t *obj_p, const ecma_char_t *property_name_p);
|
||||||
extern ecma_completion_value_t ecma_op_object_delete( ecma_object_t *obj_p,
|
extern ecma_completion_value_t ecma_op_object_delete( ecma_object_t *obj_p,
|
||||||
ecma_char_t *property_name_p,
|
const ecma_char_t *property_name_p,
|
||||||
bool is_throw);
|
bool is_throw);
|
||||||
extern ecma_completion_value_t ecma_op_object_default_value( ecma_object_t *obj_p, ecma_preferred_type_hint_t hint);
|
extern ecma_completion_value_t ecma_op_object_default_value( ecma_object_t *obj_p, ecma_preferred_type_hint_t hint);
|
||||||
extern ecma_completion_value_t ecma_op_object_define_own_property( ecma_object_t *obj_p,
|
extern ecma_completion_value_t ecma_op_object_define_own_property( ecma_object_t *obj_p,
|
||||||
ecma_char_t *property_name_p,
|
const ecma_char_t *property_name_p,
|
||||||
ecma_property_descriptor_t property_desc,
|
ecma_property_descriptor_t property_desc,
|
||||||
bool is_throw);
|
bool is_throw);
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern ecma_reference_t ecma_op_get_identifier_reference( ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
|
extern ecma_reference_t ecma_op_get_identifier_reference( ecma_object_t *lex_env_p, const ecma_char_t *name_p, bool is_strict);
|
||||||
|
|
||||||
extern ecma_completion_value_t ecma_op_get_value( ecma_reference_t ref);
|
extern ecma_completion_value_t ecma_op_get_value( ecma_reference_t ref);
|
||||||
extern ecma_completion_value_t ecma_op_put_value( ecma_reference_t ref, ecma_value_t value);
|
extern ecma_completion_value_t ecma_op_put_value( ecma_reference_t ref, ecma_value_t value);
|
||||||
|
|||||||
@ -41,8 +41,8 @@
|
|||||||
*/
|
*/
|
||||||
ecma_reference_t
|
ecma_reference_t
|
||||||
ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, /**< lexical environment */
|
ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, /**< lexical environment */
|
||||||
ecma_char_t *name_p, /**< identifier's name */
|
const ecma_char_t *name_p, /**< identifier's name */
|
||||||
bool is_strict) /**< strict reference flag */
|
bool is_strict) /**< strict reference flag */
|
||||||
{
|
{
|
||||||
JERRY_ASSERT( lex_env_p != NULL );
|
JERRY_ASSERT( lex_env_p != NULL );
|
||||||
|
|
||||||
@ -83,8 +83,8 @@ ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, /**< lexical environm
|
|||||||
*/
|
*/
|
||||||
ecma_reference_t
|
ecma_reference_t
|
||||||
ecma_make_reference(ecma_value_t base, /**< base value */
|
ecma_make_reference(ecma_value_t base, /**< base value */
|
||||||
ecma_char_t *name_p, /**< referenced name */
|
const ecma_char_t *name_p, /**< referenced name */
|
||||||
bool is_strict) /**< strict reference flag */
|
bool is_strict) /**< strict reference flag */
|
||||||
{
|
{
|
||||||
ecma_reference_t ref = (ecma_reference_t) { .base = ecma_copy_value( base),
|
ecma_reference_t ref = (ecma_reference_t) { .base = ecma_copy_value( base),
|
||||||
.referenced_name_p = name_p,
|
.referenced_name_p = name_p,
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern ecma_reference_t ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, ecma_char_t *name_p, bool is_strict);
|
extern ecma_reference_t ecma_op_get_identifier_reference(ecma_object_t *lex_env_p, const ecma_char_t *name_p, bool is_strict);
|
||||||
extern ecma_reference_t ecma_make_reference( ecma_value_t base, ecma_char_t *name_p, bool is_strict);
|
extern ecma_reference_t ecma_make_reference( ecma_value_t base, const ecma_char_t *name_p, bool is_strict);
|
||||||
extern void ecma_free_reference( const ecma_reference_t ref);
|
extern void ecma_free_reference( const ecma_reference_t ref);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -18,36 +18,40 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "jerry-libc.h"
|
#include "jerry-libc.h"
|
||||||
//
|
|
||||||
///**
|
FIXME( #ifndef LIBC_MUSL should be removed from here when own libc will be implemented )
|
||||||
// * memcpy alias to __memcpy (for compiler usage)
|
|
||||||
// */
|
#ifndef LIBC_MUSL
|
||||||
//extern void *memcpy(void *s1, const void*s2, size_t n);
|
/**
|
||||||
//
|
* memcpy alias to __memcpy (for compiler usage)
|
||||||
///**
|
*/
|
||||||
// * memset alias to __memset (for compiler usage)
|
extern void *memcpy(void *s1, const void*s2, size_t n);
|
||||||
// */
|
|
||||||
//extern void *memset(void *s, int c, size_t n);
|
/**
|
||||||
//
|
* memset alias to __memset (for compiler usage)
|
||||||
///**
|
*/
|
||||||
// * memcpy alias to __memcpy (for compiler usage)
|
extern void *memset(void *s, int c, size_t n);
|
||||||
// */
|
|
||||||
//void* memcpy(void *s1, /**< destination */
|
/**
|
||||||
// const void* s2, /**< source */
|
* memcpy alias to __memcpy (for compiler usage)
|
||||||
// size_t n) /**< bytes number */
|
*/
|
||||||
//{
|
void* memcpy(void *s1, /**< destination */
|
||||||
// return __memcpy(s1, s2, n);
|
const void* s2, /**< source */
|
||||||
//} /* memcpy */
|
size_t n) /**< bytes number */
|
||||||
//
|
{
|
||||||
///**
|
return __memcpy(s1, s2, n);
|
||||||
// * memset alias to __memset (for compiler usage)
|
} /* memcpy */
|
||||||
// */
|
|
||||||
//void* memset(void *s, /**< area to set values in */
|
/**
|
||||||
// int c, /**< value to set */
|
* memset alias to __memset (for compiler usage)
|
||||||
// size_t n) /**< area size */
|
*/
|
||||||
//{
|
void* memset(void *s, /**< area to set values in */
|
||||||
// return __memset(s, c, n);
|
int c, /**< value to set */
|
||||||
//} /* memset */
|
size_t n) /**< area size */
|
||||||
|
{
|
||||||
|
return __memset(s, c, n);
|
||||||
|
} /* memset */
|
||||||
|
#endif /* LIBC_MUSL */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* memset
|
* memset
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user