Thanks for your reply. I am still confused about the difference between
contexts. How does v8 restrict the JS code to access objects only in its
context? Does it achieved by allocating objects in a given heap range, or
associating each object with a Context property?
在 2018年5月17日星期四 UTC+8下午1:25:30，Ben Noordhuis写道：
> > Hi guys,
> > I am a freshman to learn chromium and v8. I know that the main thread in
> > renderer process is bound to an Isolate in v8, and an Isolate can
> > several contexts. But I am confused about the memory layout of the main
> > thread in the renderer process.
> > I want to know how v8 manages the heap and stack for a given context.
> > all codes(including the v8 code and JS code in different context) have
> > same stack? And if they have different stacks, how v8 maintains these
> > stacks, for example, by changing the esp register? And what about the
> > for different contexts?
> > Any ideas are appreciated. Thank you.
> They all use the same heap and stack.
> The heap is a per-isolate property. It has to be or contexts couldn't
> touch each other's objects.
> The machine code that V8 emits uses the thread's stack (i.e., the C
> stack), no stack swapping takes place.
v8-users mailing list
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.