Compile code for lazy ISeq loding always

This commit is contained in:
Nobuyoshi Nakada 2023-06-30 17:52:21 +09:00
parent c1432a4816
commit 0d0841ad4c
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
3 changed files with 8 additions and 16 deletions

View File

@ -170,7 +170,7 @@ jobs:
# - { name: USE_EMBED_CI=0, env: { cppflags: '-DUSE_EMBED_CI=0' } } # - { name: USE_EMBED_CI=0, env: { cppflags: '-DUSE_EMBED_CI=0' } }
- { name: USE_FLONUM=0, env: { cppflags: '-DUSE_FLONUM=0' } } - { name: USE_FLONUM=0, env: { cppflags: '-DUSE_FLONUM=0' } }
# - { name: USE_GC_MALLOC_OBJ_INFO_DETAILS, env: { cppflags: '-DUSE_GC_MALLOC_OBJ_INFO_DETAILS' } } # - { name: USE_GC_MALLOC_OBJ_INFO_DETAILS, env: { cppflags: '-DUSE_GC_MALLOC_OBJ_INFO_DETAILS' } }
- { name: USE_LAZY_LOAD, env: { cppflags: '-DUSE_LAZY_LOAD' } } # - { name: USE_LAZY_LOAD, env: { cppflags: '-DUSE_LAZY_LOAD' } }
# - { name: USE_SYMBOL_GC=0, env: { cppflags: '-DUSE_SYMBOL_GC=0' } } # - { name: USE_SYMBOL_GC=0, env: { cppflags: '-DUSE_SYMBOL_GC=0' } }
# - { name: USE_THREAD_CACHE=0, env: { cppflags: '-DUSE_THREAD_CACHE=0' } } # - { name: USE_THREAD_CACHE=0, env: { cppflags: '-DUSE_THREAD_CACHE=0' } }
# - { name: USE_TRANSIENT_HEAP=0, env: { cppflags: '-DUSE_TRANSIENT_HEAP=0' } } # - { name: USE_TRANSIENT_HEAP=0, env: { cppflags: '-DUSE_TRANSIENT_HEAP=0' } }

View File

@ -13313,16 +13313,12 @@ ibf_load_iseq(const struct ibf_load *load, const rb_iseq_t *index_iseq)
#endif #endif
pinned_list_store(load->iseq_list, iseq_index, (VALUE)iseq); pinned_list_store(load->iseq_list, iseq_index, (VALUE)iseq);
#if !USE_LAZY_LOAD if (!USE_LAZY_LOAD || GET_VM()->builtin_function_table) {
#if IBF_ISEQ_DEBUG #if IBF_ISEQ_DEBUG
fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", (void *)iseq); fprintf(stderr, "ibf_load_iseq: loading iseq=%p\n", (void *)iseq);
#endif #endif
rb_ibf_load_iseq_complete(iseq);
#else
if (GET_VM()->builtin_function_table) {
rb_ibf_load_iseq_complete(iseq); rb_ibf_load_iseq_complete(iseq);
} }
#endif /* !USE_LAZY_LOAD */
#if IBF_ISEQ_DEBUG #if IBF_ISEQ_DEBUG
fprintf(stderr, "ibf_load_iseq: iseq=%p loaded %p\n", fprintf(stderr, "ibf_load_iseq: iseq=%p loaded %p\n",
@ -13379,9 +13375,9 @@ ibf_load_setup(struct ibf_load *load, VALUE loader_obj, VALUE str)
rb_raise(rb_eRuntimeError, "broken binary format"); rb_raise(rb_eRuntimeError, "broken binary format");
} }
#if USE_LAZY_LOAD if (USE_LAZY_LOAD) {
str = rb_str_new(RSTRING_PTR(str), RSTRING_LEN(str)); str = rb_str_new(RSTRING_PTR(str), RSTRING_LEN(str));
#endif }
ibf_load_setup_bytes(load, loader_obj, StringValuePtr(str), RSTRING_LEN(str)); ibf_load_setup_bytes(load, loader_obj, StringValuePtr(str), RSTRING_LEN(str));
RB_OBJ_WRITE(loader_obj, &load->str, str); RB_OBJ_WRITE(loader_obj, &load->str, str);

View File

@ -548,22 +548,18 @@ struct rb_iseq_struct {
#define ISEQ_BODY(iseq) ((iseq)->body) #define ISEQ_BODY(iseq) ((iseq)->body)
#ifndef USE_LAZY_LOAD #if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0)
#define USE_LAZY_LOAD 0 #define USE_LAZY_LOAD 0
#endif #endif
#if USE_LAZY_LOAD
const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq); const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq);
#endif
static inline const rb_iseq_t * static inline const rb_iseq_t *
rb_iseq_check(const rb_iseq_t *iseq) rb_iseq_check(const rb_iseq_t *iseq)
{ {
#if USE_LAZY_LOAD if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) {
if (ISEQ_BODY(iseq) == NULL) {
rb_iseq_complete((rb_iseq_t *)iseq); rb_iseq_complete((rb_iseq_t *)iseq);
} }
#endif
return iseq; return iseq;
} }