Source positions for unoptimized JavaScript are computed lazily, by
the Compiler::CollectSourcePositions
function
<https://source.chromium.org/chromium/chromium/src/+/main:v8/src/codegen/compiler.cc;l=2472;drc=0eee57143da37c156b853d91047b6443c7a73f1d>,
which is called by SharedFunctionInfo::EnsureSourcePositionsAvailable
<https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/shared-function-info.cc;l=804;drc=2a5aaed0ff3a0895c8551495c2656ed49baf742c>
as
needed. Maybe somewhere there's a missing call to these?

On Thu, Apr 11, 2024 at 5:24 PM Ashley Chekhov <ashley.chek...@gmail.com>
wrote:

> This is not WebAssembly, it's a JavaScript issue, does the same still hold
> true? The issue shows itself to already exist during or before generation
> of bytecode, due to the fact that this is the SourcePositionTable for the
> bytecode.
>
> I will look the resources you linked, thank you.
>
> On Thu, Apr 11, 2024, 1:14 AM 'Andreas Haas' via v8-dev <
> v8-dev@googlegroups.com> wrote:
>
>> Hi Ashley,
>>
>> The generation of source positions depends on the compiler that generated
>> the code, at least for WebAssembly. In Liftoff, the compiler explicitly
>> emits source positions where needed, see e.g. [1]. In TurboFan and
>> Turboshaft the compiler generates source positions for all nodes, but then
>> filters them in the instruction selector [2] and only emits source
>> positions for some nodes.
>>
>> I guess your code object was generated from a different compiler, but
>> maybe these code pointers help you anyways.
>>
>> Cheers, Andreas
>>
>> [1]
>> https://source.chromium.org/chromium/chromium/src/+/main:v8/src/wasm/baseline/liftoff-compiler.cc;l=7870;drc=3f44955ac74c25c15d3fece126fb4d29f9e82d9b
>> [2]
>> https://source.chromium.org/chromium/chromium/src/+/main:v8/src/compiler/backend/instruction-selector.cc;l=1621;drc=3f44955ac74c25c15d3fece126fb4d29f9e82d9b
>>
>> On Wed, Apr 10, 2024 at 8:35 PM Ashley Chekhov <ashley.chek...@gmail.com>
>> wrote:
>>
>>> So I've learned that the issue is caused by a missing SourcePosition
>>> from the SourcePositionTable. Does anybody know where the
>>> SourcePositionTable is created (where the actual data is specified) for
>>> UnoptimizedFrame? This problem shows up during a call to
>>> UnoptimizedFrame::Summarize, but it's indicative of an issue occurring
>>> earlier on in the compilation process.
>>> On Monday, April 8, 2024 at 6:51:51 PM UTC Ashley Chekhov wrote:
>>>
>>>> It's good to know that this isn't a necessary evil then. Will keep
>>>> looking, thanks =)
>>>>
>>>> On Monday, April 8, 2024 at 8:34:41 AM UTC Jakob Kummerow wrote:
>>>>
>>>>> I think we generally expect reported source locations to be correct,
>>>>> including from optimized code. I don't know where the bug might be when
>>>>> that isn't working.
>>>>>
>>>>>
>>>>> On Mon, Apr 8, 2024 at 10:22 AM Ashley Chekhov <ashley....@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> I've been trying to track down a bug in reported location of source
>>>>>> code that causes errors in node's error reporting (i.e. The wrong part of
>>>>>> the code is shown). I have discovered that it is due to 
>>>>>> optimizations/jit,
>>>>>> as the error does not occur when I preface the test code with 
>>>>>> "eval("");".
>>>>>> Do you think this is even salvageable or is it just an inherent 
>>>>>> limitation
>>>>>> of translation to machine code? If not, do you have any advice on where I
>>>>>> should look for a solution?
>>>>>>
>>>>>> --
>>> --
>>> v8-dev mailing list
>>> v8-dev@googlegroups.com
>>> http://groups.google.com/group/v8-dev
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to v8-dev+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/v8-dev/5f1e3102-cb24-41e1-b9de-b23b779e20b8n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/v8-dev/5f1e3102-cb24-41e1-b9de-b23b779e20b8n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>>
>> Andreas Haas
>>
>> Software Engineer
>>
>> ah...@google.com
>>
>>
>> Google Germany GmbH
>>
>> Erika-Mann-Straße 33
>>
>> 80636 München
>>
>>
>> Geschäftsführer: Paul Manicle, Liana Sebastian
>>
>> Registergericht und -nummer: Hamburg, HRB 86891
>>
>> Sitz der Gesellschaft: Hamburg
>>
>>
>> Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
>> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
>> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
>> dass die E-Mail an die falsche Person gesendet wurde.
>>
>>
>>
>> This e-mail is confidential. If you received this communication by
>> mistake, please don't forward it to anyone else, please erase all copies
>> and attachments, and please let me know that it has gone to the wrong
>> person.
>>
>> --
>> --
>> v8-dev mailing list
>> v8-dev@googlegroups.com
>> http://groups.google.com/group/v8-dev
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "v8-dev" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/v8-dev/O2lbGJJh3ak/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> v8-dev+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/v8-dev/CAELSTvctXK%3D4nKfrr_omH4o4UPsQw174M7QpoP2ebx-Qv2ksOQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/v8-dev/CAELSTvctXK%3D4nKfrr_omH4o4UPsQw174M7QpoP2ebx-Qv2ksOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> --
> v8-dev mailing list
> v8-dev@googlegroups.com
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/CA%2BKc%3D0-86yLD3q4JsohJwpzab95oFm0hy7MrnZZrwbNCXansyg%40mail.gmail.com
> <https://groups.google.com/d/msgid/v8-dev/CA%2BKc%3D0-86yLD3q4JsohJwpzab95oFm0hy7MrnZZrwbNCXansyg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAGRskv83%3DaCaAwq7O9Z77p0WyvmN3R5b%3DZsGqVMsuhBvHiiGxA%40mail.gmail.com.

Reply via email to