Skip to content

Commit a969ab6

Browse files
tebbiCommit Bot
authored andcommitted
[turbofan] teach escape analysis about oddly occurring NumberLessThan node
Bug: chromium:733181 Change-Id: If5b0bc8592ba71962237814ad521499afda22edf Reviewed-on: https://chromium-review.googlesource.com/538653 Reviewed-by: Tobias Tebbi <[email protected]> Reviewed-by: Michael Starzinger <[email protected]> Commit-Queue: Tobias Tebbi <[email protected]> Cr-Commit-Position: refs/heads/master@{#45977}
1 parent c4ca06f commit a969ab6

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/compiler/escape-analysis.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,9 @@ bool EscapeStatusAnalysis::CheckUsesForEscape(Node* uses, Node* rep,
846846
case IrOpcode::kObjectIsString:
847847
case IrOpcode::kObjectIsSymbol:
848848
case IrOpcode::kObjectIsUndetectable:
849+
case IrOpcode::kNumberLessThan:
850+
case IrOpcode::kNumberLessThanOrEqual:
851+
case IrOpcode::kNumberEqual:
849852
#define CASE(opcode) case IrOpcode::k##opcode:
850853
SIMPLIFIED_NUMBER_BINOP_LIST(CASE)
851854
SIMPLIFIED_NUMBER_UNOP_LIST(CASE)

test/mjsunit/compiler/escape-analysis-17.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
function foo() {
88
var a = {x:1};
99
var b = {x:1.5, y: 1};
10-
var x;
10+
var x = 0;
1111
for (var i = 0; i < 1; i = {}) {
1212
// The second iteration of this loop is dead code, leading to a
1313
// contradiction between dynamic and static information.
14-
x = a.x + 0.5;
15-
x = a.x % 0.5;
16-
x = Math.abs(a.x);
14+
x += a.x + 0.5;
15+
x += a.x % 0.5;
16+
x += Math.abs(a.x);
17+
x += a.x < 6;
18+
x += a.x === 7;
19+
x += a.x <= 8;
1720
a = b;
1821
}
1922
return x;

0 commit comments

Comments
 (0)