| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2d07fd7 commit e1f12fb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | #define V8_MAJOR_VERSION 4 | |
| 12 | 12 | #define V8_MINOR_VERSION 5 | |
| 13 | 13 | #define V8_BUILD_NUMBER 103 | |
| 14 | - #define V8_PATCH_LEVEL 39 | ||
| 14 | + #define V8_PATCH_LEVEL 40 | ||
| 15 | 15 | ||
| 16 | 16 | // Use 1 for candidates and 0 otherwise. | |
| 17 | 17 | // (Boolean macro values are not supported by all preprocessors.) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15213,6 +15213,19 @@ Handle<ObjectHashTable> ObjectHashTable::Put(Handle<ObjectHashTable> table, | |||
| 15213 | 15213 | if ((table->NumberOfDeletedElements() << 1) > table->NumberOfElements()) { | |
| 15214 | 15214 | table->Rehash(isolate->factory()->undefined_value()); | |
| 15215 | 15215 | } | |
| 15216 | + // If we're out of luck, we didn't get a GC recently, and so rehashing | ||
| 15217 | + // isn't enough to avoid a crash. | ||
| 15218 | + int nof = table->NumberOfElements() + 1; | ||
| 15219 | + if (!table->HasSufficientCapacity(nof)) { | ||
| 15220 | + int capacity = ObjectHashTable::ComputeCapacity(nof * 2); | ||
| 15221 | + if (capacity > ObjectHashTable::kMaxCapacity) { | ||
| 15222 | + for (size_t i = 0; i < 2; ++i) { | ||
| 15223 | + isolate->heap()->CollectAllGarbage( | ||
| 15224 | + Heap::kFinalizeIncrementalMarkingMask, "full object hash table"); | ||
| 15225 | + } | ||
| 15226 | + table->Rehash(isolate->factory()->undefined_value()); | ||
| 15227 | + } | ||
| 15228 | + } | ||
| 15216 | 15229 | ||
| 15217 | 15230 | // Check whether the hash table should be extended. | |
| 15218 | 15231 | table = EnsureCapacity(table, 1, key); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments