| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e273c20 commit 04d568e
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.27', | ||
| 41 | + 'v8_embedder_string': '-node.28', | ||
| 42 | 42 | ||
| 43 | 43 | ##### V8 defaults for Node.js ##### | |
| 44 | 44 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -464,6 +464,8 @@ MaybeHandle<FixedArray> FastKeyAccumulator::GetKeys( | |||
| 464 | 464 | return keys; | |
| 465 | 465 | } | |
| 466 | 466 | if (isolate_->has_exception()) return MaybeHandle<FixedArray>(); | |
| 467 | + } else if (filter_ == SKIP_STRINGS && !MayHaveSymbols()) { | ||
| 468 | + return isolate_->factory()->empty_fixed_array(); | ||
| 467 | 469 | } | |
| 468 | 470 | ||
| 469 | 471 | if (try_prototype_info_cache_) { | |
@@ -472,6 +474,34 @@ MaybeHandle<FixedArray> FastKeyAccumulator::GetKeys( | |||
| 472 | 474 | return GetKeysSlow(keys_conversion); | |
| 473 | 475 | } | |
| 474 | 476 | ||
| 477 | + bool FastKeyAccumulator::MayHaveSymbols() { | ||
| 478 | + bool own_only = has_empty_prototype_ || mode_ == KeyCollectionMode::kOwnOnly; | ||
| 479 | + Tagged<Map> map = receiver_->map(); | ||
| 480 | + if (!own_only || IsCustomElementsReceiverMap(map)) { | ||
| 481 | + return true; | ||
| 482 | + } | ||
| 483 | + | ||
| 484 | + // From this point on we are certain to only collect own keys. | ||
| 485 | + DCHECK(IsJSObject(*receiver_)); | ||
| 486 | + | ||
| 487 | + if (map->is_dictionary_map()) { | ||
| 488 | + // TODO(olivf): Keep a bit in the dictionary to remember if we have any | ||
| 489 | + // symbols. | ||
| 490 | + return true; | ||
| 491 | + } | ||
| 492 | + int num = map->NumberOfOwnDescriptors(); | ||
| 493 | + if (num == 0) { | ||
| 494 | + return false; | ||
| 495 | + } | ||
| 496 | + int enum_length = receiver_->map()->EnumLength(); | ||
| 497 | + if (enum_length != kInvalidEnumCacheSentinel) { | ||
| 498 | + return enum_length != num; | ||
| 499 | + } | ||
| 500 | + // TODO(olivf): Keep a bit in the descriptor to remember if we have any | ||
| 501 | + // symbols. | ||
| 502 | + return true; | ||
| 503 | + } | ||
| 504 | + | ||
| 475 | 505 | MaybeHandle<FixedArray> FastKeyAccumulator::GetKeysFast( | |
| 476 | 506 | GetKeysConversion keys_conversion) { | |
| 477 | 507 | bool own_only = has_empty_prototype_ || mode_ == KeyCollectionMode::kOwnOnly; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -197,6 +197,7 @@ class FastKeyAccumulator { | |||
| 197 | 197 | bool is_receiver_simple_enum() { return is_receiver_simple_enum_; } | |
| 198 | 198 | bool has_empty_prototype() { return has_empty_prototype_; } | |
| 199 | 199 | bool may_have_elements() { return may_have_elements_; } | |
| 200 | + bool MayHaveSymbols(); | ||
| 200 | 201 | ||
| 201 | 202 | MaybeHandle<FixedArray> GetKeys( | |
| 202 | 203 | GetKeysConversion convert = GetKeysConversion::kKeepNumbers); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments