32
edits
| Line 45: | Line 45: | ||
The common invalidation thunk is generated by <tt>IonCompartment::getOrCreateInvalidationThunk</tt> in ''ion/IonCompartment.h'', which is a singleton-creation wrapper around <tt>IonCompartment::generateInvalidator</tt>, which is different for each architecture. The x86 implementation of this method is located in ''ion/x86/Trampoline-x86.cpp'' (see the other relevant trampoline files for the implementations for those architectures). | The common invalidation thunk is generated by <tt>IonCompartment::getOrCreateInvalidationThunk</tt> in ''ion/IonCompartment.h'', which is a singleton-creation wrapper around <tt>IonCompartment::generateInvalidator</tt>, which is different for each architecture. The x86 implementation of this method is located in ''ion/x86/Trampoline-x86.cpp'' (see the other relevant trampoline files for the implementations for those architectures). | ||
The behaviour of | The behaviour of the common invalidation code is described below (for x86 only, but the other architectures should be similar): | ||
# pop off 1 word from the stack. - This is to eliminate the return pointer to the script-specific invalidation epilogue code, which got pushed on when the common invalidation chunk was called. | # pop off 1 word from the stack. - This is to eliminate the return pointer to the script-specific invalidation epilogue code, which got pushed on when the common invalidation chunk was called. | ||
# push all registers onto the stack, remember stack pointer - This is to construct an <tt> | # push all registers onto the stack, remember stack pointer - This is to construct an <tt>InvalidationBailoutStack</tt> structure on the stack. | ||
# reserve sizeof(size_t) on the stack, remember stack pointer - To reserve space for the size of the frame | # reserve sizeof(size_t) on the stack, remember stack pointer - To reserve space for the size of the frame. | ||
# call the C++ function <tt>InvalidationBailout</tt> in ''ion/Bailouts.cpp''. | # call the C++ function <tt>InvalidationBailout</tt> in ''ion/Bailouts.cpp'', passing the above two pointers. | ||
edits