Skip to content

Commit d47c36f

Browse files
committed
New Allocator and improved String handling.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
1 parent 3d6339b commit d47c36f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1343
-4248
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ project (Jerry C ASM)
213213

214214
# Compiler / Linker flags
215215
set(COMPILE_FLAGS_JERRY "-fno-builtin")
216+
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
217+
set(COMPILE_FLAGS_JERRY "${COMPILE_FLAGS_JERRY} -DMEM_HEAP_PTR_64")
218+
endif()
216219
if(NOT ("${PLATFORM}" STREQUAL "DARWIN"))
217220
set(LINKER_FLAGS_COMMON "-Wl,-z,noexecstack")
218221
endif()

jerry-core/config.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* Copyright 2014-2015 Samsung Electronics Co., Ltd.
2+
* Copyright 2016 University of Szeged.
23
*
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.
@@ -47,10 +48,15 @@
4748
# error "Currently, maximum 256 kilobytes heap size is supported"
4849
#endif /* !CONFIG_MEM_HEAP_AREA_SIZE */
4950

51+
/**
52+
* Max heap usage limit
53+
*/
54+
#define CONFIG_MEM_HEAP_MAX_LIMIT 8192
55+
5056
/**
5157
* Desired limit of heap usage
5258
*/
53-
#define CONFIG_MEM_HEAP_DESIRED_LIMIT (CONFIG_MEM_HEAP_AREA_SIZE / 32)
59+
#define CONFIG_MEM_HEAP_DESIRED_LIMIT (JERRY_MIN (CONFIG_MEM_HEAP_AREA_SIZE / 32, CONFIG_MEM_HEAP_MAX_LIMIT))
5460

5561
/**
5662
* Log2 of maximum possible offset in the heap
@@ -80,7 +86,7 @@
8086
* Also the option affects size of ECMA Object Model's data types.
8187
* In any case size of any of the types should not exceed CONFIG_MEM_POOL_CHUNK_SIZE.
8288
*/
83-
#define CONFIG_ECMA_REFERENCE_COUNTER_WIDTH (10)
89+
#define CONFIG_ECMA_REFERENCE_COUNTER_WIDTH (12)
8490

8591
#define CONFIG_ECMA_REFERENCE_COUNTER_LIMIT ((1u << CONFIG_ECMA_REFERENCE_COUNTER_WIDTH) - 1u)
8692

jerry-core/ecma/base/ecma-globals.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include "config.h"
2727
#include "jrt.h"
28-
#include "lit-globals.h"
2928
#include "lit-magic-strings.h"
3029
#include "mem-allocator.h"
3130

@@ -384,7 +383,7 @@ typedef struct ecma_object_t
384383
*/
385384
#define ECMA_OBJECT_OBJ_TYPE_POS (ECMA_OBJECT_OBJ_EXTENSIBLE_POS + \
386385
ECMA_OBJECT_OBJ_EXTENSIBLE_WIDTH)
387-
#define ECMA_OBJECT_OBJ_TYPE_WIDTH (4)
386+
#define ECMA_OBJECT_OBJ_TYPE_WIDTH (3)
388387

389388
/**
390389
* Compressed pointer to prototype object (ecma_object_t)
@@ -721,7 +720,7 @@ typedef struct ecma_string_t
721720
union
722721
{
723722
/** Index of string in literal table */
724-
lit_cpointer_t lit_cp;
723+
mem_cpointer_t lit_cp;
725724

726725
/** Compressed pointer to an ecma_collection_header_t */
727726
__extension__ mem_cpointer_t collection_cp : ECMA_POINTER_FIELD_WIDTH;

0 commit comments

Comments
 (0)