[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Native compilation on MPS branch
From: |
Andrea Corallo |
Subject: |
Re: Native compilation on MPS branch |
Date: |
Wed, 24 Apr 2024 14:14:33 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Andrea Corallo <acorallo@gnu.org> writes:
>
>> Cool, keep us updated.
>
> Daily update ;-).
:)
> Haven't got much further, and can use a little break now.
>
> I don't know if it makes sense to attach this, but maybe it does... I'm
> sometimes keeping notes when debugging (which I find useful when
> debugging more than 1 thing at a time).
[...]
>
> The read is in from load_static_obj, which is called from
> load_comp_unit.
>
> #+begin_src c
> if (!loading_dump)
> {
> comp_u->optimize_qualities =
> load_static_obj (comp_u, TEXT_OPTIM_QLY_SYM);
> comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM);
> comp_u->data_impure_vec =
> load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM);
>
> if (!NILP (Vpurify_flag))
> /* Non impure can be copied into pure space. */
> comp_u->data_vec = Fpurecopy (comp_u->data_vec);
>
> if (!NILP (Vpurify_flag))
> /* Non impure can be copied into pure space. */
> comp_u->data_vec = Fpurecopy (comp_u->data_vec);
> #+end_src
>
> The cu is allocated in MPS, purify is nil
>
> #+begin_src sh
> (lldb) p comp_u
> (Lisp_Native_Comp_Unit *) 0x0000000108cc51f0
> (lldb) p is_mps (comp_u)
> (bool) true
> (lldb) p globals.f_Vpurify_flag
> (Lisp_Object) NULL
> #+end_src
>
> Objects are copied
>
> #+begin_src c
> Lisp_Object *data_relocs = dynlib_sym (handle, DATA_RELOC_SYM);
> Lisp_Object *data_imp_relocs = comp_u->data_imp_relocs;
> ...
> EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec));
> for (EMACS_INT i = 0; i < d_vec_len; i++)
> data_relocs[i] = AREF (comp_u->data_vec, i);
> #+end_src
>
> data_relocs points somewhere into the loaded dylib, I'd say
That's correct
> #+begin_src sh
> (lldb) p data_relocs
> (Lisp_Object *) 0x0000000100ebcfd8 (struct Lisp_Symbol *) $26 =
> 0x0000000201af0f48
> (lldb) p is_mps (data_relocs)
> (bool) false
> (lldb) p pdumper_object_p (data_relocs)
> (bool) false
> (lldb) p is_pure (data_relocs)
> (bool) false
> #+end_src
>
> data_imp_relocs too.
Yep
> #+begin_src sh
> (lldb) p *comp_u
> (Lisp_Native_Comp_Unit) {
> header = (size = 4611686018863607815)
> file = 0x0000000108cc50d4 (struct Lisp_String *) $28 = 0x0000000108cc50d0
> optimize_qualities = 0x0000000108cc53bb (struct Lisp_Cons *) $29 =
> 0x0000000108cc53b8
> lambda_gc_guard_h = 0x0000000108cc5255 (struct Lisp_Vector *) $30 =
> 0x0000000108cc5250
> lambda_c_name_idx_h = 0x0000000108cc52ad (struct Lisp_Vector *) $31 =
> 0x0000000108cc52a8
> data_fdoc_v = NULL
> data_vec = 0x0000000108cd000d (struct Lisp_Vector *) $32 =
> 0x0000000108cd0008
> data_impure_vec = NULL
> data_imp_relocs = 0x0000000100ebda00 (struct Lisp_Symbol *) $33 =
> 0x0000000201af1970
> loaded_once = false
> load_ongoing = true
> handle = 0x0000000088eb8210
> }
> #+end_src
>
> That all looks like I would have expected.
To me as well.
> (Note to self: remember register_comp_unit...)
> That all happens in (require macroexp)
>
> Continue. Landing in copy_sequence with invalid string.
:/
Dumb question: are you usnug rr to debug this?
Thanks
Andrea
- Re: STatus of MPS branch, (continued)
- Re: STatus of MPS branch, Andrea Corallo, 2024/04/21
- Re: Native compilation on MPS branch, Eli Zaretskii, 2024/04/21
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/21
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/21
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/22
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/22
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/22
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/23
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/23
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/24
- Re: Native compilation on MPS branch,
Andrea Corallo <=
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/24
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/24
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/25
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/25
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/25
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/25
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/25
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/25
- Re: Native compilation on MPS branch, Andrea Corallo, 2024/04/25
- Re: Native compilation on MPS branch, Gerd Möllmann, 2024/04/25