diff options
author | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-03-05 08:53:37 +0000 |
---|---|---|
committer | zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-03-05 08:53:37 +0000 |
commit | 3831a81914cf11565bf429dd019c9442b404bc5f (patch) | |
tree | 05af71c076ea012ac558fec95af60c2ec30d5516 /sljit | |
parent | cdd0774e59b4bd58bbabe25c1b3580b66fac44c6 (diff) | |
download | pcre-3831a81914cf11565bf429dd019c9442b404bc5f.tar.gz |
Remove computing the JIT read-only data size in advance and use on-demand memory allocation.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1530 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'sljit')
-rw-r--r-- | sljit/sljitLir.h | 6 | ||||
-rw-r--r-- | sljit/sljitNativeARM_32.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sljit/sljitLir.h b/sljit/sljitLir.h index 229e04f..79f1d10 100644 --- a/sljit/sljitLir.h +++ b/sljit/sljitLir.h @@ -429,6 +429,12 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compile these checks increases the performance of the compiling process. */ static SLJIT_INLINE sljit_si sljit_get_compiler_error(struct sljit_compiler *compiler) { return compiler->error; } +/* Sets the compiler error code to SLJIT_ERR_ALLOC_FAILED. After + the error code is set, the compiler behaves as if itself detected + an allocation failure. This can greatly simplify error management, + since only the compiler needs to be checked after compilation. */ +static SLJIT_INLINE void sljit_set_compiler_memory_error(struct sljit_compiler *compiler) { compiler->error = SLJIT_ERR_ALLOC_FAILED; } + /* Allocate a small amount of memory. The size must be <= 64 bytes on 32 bit, and <= 128 bytes on 64 bit architectures. The memory area is owned by the diff --git a/sljit/sljitNativeARM_32.c b/sljit/sljitNativeARM_32.c index a763b81..aca1d31 100644 --- a/sljit/sljitNativeARM_32.c +++ b/sljit/sljitNativeARM_32.c @@ -315,11 +315,13 @@ struct future_patch { sljit_si value; }; -static SLJIT_INLINE sljit_si resolve_const_pool_index(struct sljit_compiler *compiler, struct future_patch **first_patch, sljit_uw cpool_current_index, sljit_uw *cpool_start_address, sljit_uw *buf_ptr) +static sljit_si resolve_const_pool_index(struct sljit_compiler *compiler, struct future_patch **first_patch, sljit_uw cpool_current_index, sljit_uw *cpool_start_address, sljit_uw *buf_ptr) { sljit_si value; struct future_patch *curr_patch, *prev_patch; + SLJIT_UNUSED_ARG(compiler); + /* Using the values generated by patch_pc_relative_loads. */ if (!*first_patch) value = (sljit_si)cpool_start_address[cpool_current_index]; |