| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 56fb29a commit c004cf5
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | 39 | # Reset this number to 0 on major V8 upgrades. | |
| 40 | 40 | # Increment by one for each non-official patch applied to deps/v8. | |
| 41 | - 'v8_embedder_string': '-node.24', | ||
| 41 | + 'v8_embedder_string': '-node.25', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4025,6 +4025,13 @@ Handle<WeakArrayList> PrototypeUsers::Add(Isolate* isolate, | |||
| 4025 | 4025 | ||
| 4026 | 4026 | // If there are empty slots, use one of them. | |
| 4027 | 4027 | int empty_slot = Smi::ToInt(empty_slot_index(*array)); | |
| 4028 | + | ||
| 4029 | + if (empty_slot == kNoEmptySlotsMarker) { | ||
| 4030 | + // GCs might have cleared some references, rescan the array for empty slots. | ||
| 4031 | + PrototypeUsers::ScanForEmptySlots(*array); | ||
| 4032 | + empty_slot = Smi::ToInt(empty_slot_index(*array)); | ||
| 4033 | + } | ||
| 4034 | + | ||
| 4028 | 4035 | if (empty_slot != kNoEmptySlotsMarker) { | |
| 4029 | 4036 | DCHECK_GE(empty_slot, kFirstIndex); | |
| 4030 | 4037 | CHECK_LT(empty_slot, array->length()); | |
@@ -4047,6 +4054,15 @@ Handle<WeakArrayList> PrototypeUsers::Add(Isolate* isolate, | |||
| 4047 | 4054 | return array; | |
| 4048 | 4055 | } | |
| 4049 | 4056 | ||
| 4057 | + // static | ||
| 4058 | + void PrototypeUsers::ScanForEmptySlots(WeakArrayList array) { | ||
| 4059 | + for (int i = kFirstIndex; i < array.length(); i++) { | ||
| 4060 | + if (array.Get(i)->IsCleared()) { | ||
| 4061 | + PrototypeUsers::MarkSlotEmpty(array, i); | ||
| 4062 | + } | ||
| 4063 | + } | ||
| 4064 | + } | ||
| 4065 | + | ||
| 4050 | 4066 | WeakArrayList PrototypeUsers::Compact(Handle<WeakArrayList> array, Heap* heap, | |
| 4051 | 4067 | CompactionCallback callback, | |
| 4052 | 4068 | AllocationType allocation) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,7 +99,7 @@ class V8_EXPORT_PRIVATE PrototypeUsers : public WeakArrayList { | |||
| 99 | 99 | static inline Smi empty_slot_index(WeakArrayList array); | |
| 100 | 100 | static inline void set_empty_slot_index(WeakArrayList array, int index); | |
| 101 | 101 | ||
| 102 | - static void IsSlotEmpty(WeakArrayList array, int index); | ||
| 102 | + static void ScanForEmptySlots(WeakArrayList array); | ||
| 103 | 103 | ||
| 104 | 104 | DISALLOW_IMPLICIT_CONSTRUCTORS(PrototypeUsers); | |
| 105 | 105 | }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments