On Tue, Jul 9, 2019 at 5:20 PM Thomson Tan <lilo...@gmail.com> wrote:
> The stack iterator needs to be able to skip over C++ frames on the stack >> > Is this a general requirement for V8 generated code for all platforms? > Yes. > Use x64 for example which walks the stack by following frame pointer (rbp) > chain, does this mean JS entry function should stop this frame pointer > chain, and store the caller's frame pointer in isolate? > The other way round. The caller of JSEntry is a C++ function, and we make no assumptions about the stack layout that the C++ compiler generates for those. The JSEntry stub creates a new chain of rbp pointers (throughout the following invocations of generated code). It stores the last C entry frame position, so when walking the stack in the other direction, the stack walker can jump from the JSEntry frame to the previous CEntry frame (if there is one). > How to usually handle the frame for JS entry function if a full stackwalk > is needed? > See class EntryFrame in frames.h, in particular EntryFrame::GetCallerState, and compare it with what Generate_JSEntryVariant in builtins-x64.cc does. > On Tuesday, July 9, 2019 at 2:09:20 AM UTC-7, Jakob Kummerow wrote: >> >> The stack iterator needs to be able to skip over C++ frames on the stack. >> Information about the topmost C++ section is stored on the isolate (where >> else would you store it?), information about additional sections further >> down needs to be saved elsewhere. Storing it on the stack makes it easy for >> the stack walker to find it. >> >> On Tue, Jul 9, 2019 at 10:21 AM Thomson Tan <lil...@gmail.com> wrote: >> >>> Seems the JSEntry frame (Generate_JSEntryVariant) >>> saves IsolateAddressId::kCEntryFPAddress from isolate. What is this C entry >>> FP field for? I guess it saves frame pointer passed from C caller, but >>> don't understand why it comes from isolate. >>> >>> -- >> >> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/CAKSzg3TtX9RyvFVz3fU4rHtfEoHuOvYM4pFJtJzc8JfN9n7teQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.