Commit fbc22bb
committed
[JSC] Create a save point only if actually checking for "use strict"
https://bugs.webkit.org/show_bug.cgi?id=317599
rdar://180322283
Reviewed by Yusuke Suzuki.
In the existing code, Parser::parseSourceElements unconditionally creates a save point.
A save point is only necessary if shouldCheckForUseStrict is true, and in the majority
of cases (parsing statement blocks), that flag is false and the save point is unused.
Creating a save point involves copying almost 100 bytes of parser and lexer state,
so let's only do that when necessary.
Covered by existing tests.
Canonical link: https://commits.webkit.org/315637@main1 parent 1851699 commit fbc22bb
1 file changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
| |||
429 | 431 | | |
430 | 432 | | |
431 | 433 | | |
432 | | - | |
| 434 | + | |
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| |||
4495 | 4497 | | |
4496 | 4498 | | |
4497 | 4499 | | |
4498 | | - | |
| 4500 | + | |
4499 | 4501 | | |
4500 | 4502 | | |
4501 | 4503 | | |
| |||
4562 | 4564 | | |
4563 | 4565 | | |
4564 | 4566 | | |
4565 | | - | |
| 4567 | + | |
4566 | 4568 | | |
4567 | 4569 | | |
4568 | 4570 | | |
| |||
0 commit comments