From 13bd30ff54cc1f5ab152aeb915476abf28ea5c6e Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Fri, 18 May 2018 10:43:52 +0200 Subject: [PATCH] Remove legacy jerry_get_memory_limits API function and unused configuration macros (#2329) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- docs/02.API-REFERENCE.md | 41 ----------------------- jerry-core/api/jerry.c | 12 ------- jerry-core/config.h | 21 ------------ jerry-core/ecma/operations/ecma-lex-env.c | 4 --- jerry-core/include/jerryscript-core.h | 1 - jerry-core/vm/vm-stack.h | 5 --- 6 files changed, 84 deletions(-) diff --git a/docs/02.API-REFERENCE.md b/docs/02.API-REFERENCE.md index bb4574b03..b0224f0de 100644 --- a/docs/02.API-REFERENCE.md +++ b/docs/02.API-REFERENCE.md @@ -665,47 +665,6 @@ main (void) - [jerry_parse_and_save_literals](#jerry_parse_and_save_literals) -## jerry_get_memory_limits - -**Summary** - -Gets configured memory limits of JerryScript. - -**Prototype** - -```c -void -jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, - size_t *out_stack_limit_p); -``` - -- `out_data_bss_brk_limit_p` - out parameter, that gives the maximum size of data + bss + brk sections. -- `out_stack_limit_p` - out parameter, that gives the maximum size of the stack. - -**Example** - -[doctest]: # () - -```c -#include "jerryscript.h" - -int -main (void) -{ - jerry_init (JERRY_INIT_EMPTY); - - size_t stack_limit; - size_t data_bss_brk_limit; - jerry_get_memory_limits (&stack_limit, &data_bss_brk_limit); -} -``` - -**See also** - -- [jerry_init](#jerry_init) -- [jerry_cleanup](#jerry_cleanup) - - ## jerry_get_memory_stats **Summary** diff --git a/jerry-core/api/jerry.c b/jerry-core/api/jerry.c index c3a206a17..2eee92759 100644 --- a/jerry-core/api/jerry.c +++ b/jerry-core/api/jerry.c @@ -292,18 +292,6 @@ jerry_register_magic_strings (const jerry_char_ptr_t *ex_str_items_p, /**< chara lit_magic_strings_ex_set ((const lit_utf8_byte_t **) ex_str_items_p, count, (const lit_utf8_size_t *) str_lengths_p); } /* jerry_register_magic_strings */ -/** - * Get Jerry configured memory limits - */ -void -jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, /**< [out] Jerry's maximum usage of - * data + bss + brk sections */ - size_t *out_stack_limit_p) /**< [out] Jerry's maximum usage of stack */ -{ - *out_data_bss_brk_limit_p = CONFIG_MEM_HEAP_AREA_SIZE + CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE; - *out_stack_limit_p = CONFIG_MEM_STACK_LIMIT; -} /* jerry_get_memory_limits */ - /** * Run garbage collection */ diff --git a/jerry-core/config.h b/jerry-core/config.h index 69feb92d7..6e30129e0 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -43,16 +43,6 @@ # define CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN #endif /* CONFIG_DISABLE_ES2015 */ -/** - * Limit of data (system heap, engine's data except engine's own heap) - */ -#define CONFIG_MEM_DATA_LIMIT_MINUS_HEAP_SIZE (1024) - -/** - * Limit of stack size - */ -#define CONFIG_MEM_STACK_LIMIT (4096) - /** * Size of heap */ @@ -109,15 +99,4 @@ */ #define CONFIG_ECMA_GC_NEW_OBJECTS_SHARE_TO_START_GC (16) -/** - * Link Global Environment to an empty declarative lexical environment - * instead of lexical environment bound to Global Object. - */ -// #define CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE - -/** - * Number of ecma values inlined into VM stack frame - */ -#define CONFIG_VM_STACK_FRAME_INLINED_VALUES_NUMBER (16) - #endif /* !CONFIG_H */ diff --git a/jerry-core/ecma/operations/ecma-lex-env.c b/jerry-core/ecma/operations/ecma-lex-env.c index 2af3ce31a..b94385786 100644 --- a/jerry-core/ecma/operations/ecma-lex-env.c +++ b/jerry-core/ecma/operations/ecma-lex-env.c @@ -39,15 +39,11 @@ void ecma_init_global_lex_env (void) { -#ifdef CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE - JERRY_CONTEXT (ecma_global_lex_env_p) = ecma_create_decl_lex_env (NULL); -#else /* !CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */ ecma_object_t *glob_obj_p = ecma_builtin_get (ECMA_BUILTIN_ID_GLOBAL); JERRY_CONTEXT (ecma_global_lex_env_p) = ecma_create_object_lex_env (NULL, glob_obj_p, false); ecma_deref_object (glob_obj_p); -#endif /* CONFIG_ECMA_GLOBAL_ENVIRONMENT_DECLARATIVE */ } /* ecma_init_global_lex_env */ /** diff --git a/jerry-core/include/jerryscript-core.h b/jerry-core/include/jerryscript-core.h index 0307092a9..19630e853 100644 --- a/jerry-core/include/jerryscript-core.h +++ b/jerry-core/include/jerryscript-core.h @@ -303,7 +303,6 @@ void jerry_init (jerry_init_flag_t flags); void jerry_cleanup (void); void jerry_register_magic_strings (const jerry_char_ptr_t *ex_str_items_p, uint32_t count, const jerry_length_t *str_lengths_p); -void jerry_get_memory_limits (size_t *out_data_bss_brk_limit_p, size_t *out_stack_limit_p); void jerry_gc (void); void *jerry_get_context_data (const jerry_context_data_manager_t *manager_p); diff --git a/jerry-core/vm/vm-stack.h b/jerry-core/vm/vm-stack.h index 0f921162e..f6963f42f 100644 --- a/jerry-core/vm/vm-stack.h +++ b/jerry-core/vm/vm-stack.h @@ -25,11 +25,6 @@ * @{ */ -/** - * Number of ecma values inlined into stack frame - */ -#define VM_STACK_FRAME_INLINED_VALUES_NUMBER CONFIG_VM_STACK_FRAME_INLINED_VALUES_NUMBER - /** * Header of a ECMA stack frame's chunk */