diff options
Diffstat (limited to 'chromium/v8/src/sandbox/external-pointer-table-inl.h')
-rw-r--r-- | chromium/v8/src/sandbox/external-pointer-table-inl.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/v8/src/sandbox/external-pointer-table-inl.h b/chromium/v8/src/sandbox/external-pointer-table-inl.h index 1e4ff34e614..9295ddd3a3f 100644 --- a/chromium/v8/src/sandbox/external-pointer-table-inl.h +++ b/chromium/v8/src/sandbox/external-pointer-table-inl.h @@ -6,6 +6,7 @@ #define V8_SANDBOX_EXTERNAL_POINTER_TABLE_INL_H_ #include "src/base/atomicops.h" +#include "src/common/assert-scope.h" #include "src/sandbox/external-pointer-table.h" #include "src/sandbox/external-pointer.h" #include "src/utils/allocation.h" @@ -75,6 +76,13 @@ ExternalPointerHandle ExternalPointerTable::AllocateAndInitializeEntry( Isolate* isolate, Address initial_value, ExternalPointerTag tag) { DCHECK(is_initialized()); + // We currently don't want entry allocation to trigger garbage collection as + // this may cause seemingly harmless pointer field assignments to trigger + // garbage collection. This is especially true for lazily-initialized + // external pointer slots which will typically only allocate the external + // pointer table entry when the pointer is first set to a non-null value. + DisallowGarbageCollection no_gc; + Freelist freelist; bool success = false; while (!success) { |