-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: The user lists for literals can grow extremely large since they are shared across the module, and may occur many times in object and array literals. Updating usage of literals can be very costly, since it needs to iterate the user list to remove the prior use. One example where this is currently very slow is when deleting AllocObjectLiteral when it gets lowered: 1. Iterate over the (potentially large) list of operands of the instruction to remove each one. 2. For each operand, iterate the user list of the corresponding literal to find its use. 3. Once the use is found and removed, the last user gets moved into its position. This requires updating the corresponding `Use`, which means iterating through the operands of the using instruction. Reviewed By: avp Differential Revision: D67290808 fbshipit-source-id: 9344fecc5d56ebdeab25a821c00dc299aed46cda
- Loading branch information
1 parent
f807f90
commit 1d7433b
Showing
5 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hermes %s | (! %hermes - 2>&1 -gc-sanitize-handles=0 ) | %FileCheck --match-full-lines %s | ||
// REQUIRES: !slow_debug | ||
|
||
// Print a huge object literal with 300,000 entries. | ||
|
||
print("globalThis.obj = {"); | ||
|
||
for(let i = 0; i < 300_000; ++i) | ||
print ("a" + i, ": null,"); | ||
|
||
print("};") | ||
|
||
// CHECK: Uncaught RangeError: Object has more than {{.+}} properties |