Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r225273 - Strict and sloppy functions shouldn't share structure
- Loading branch information
1 parent
035fd11
commit e1f7d80
Showing
17 changed files
with
320 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
let warm = 1000; | ||
|
||
function foo(f) { | ||
return f.arguments; | ||
} | ||
noInline(foo); | ||
|
||
function bar() { | ||
for (let i = 0; i < warm; ++i) | ||
foo(bar); | ||
} | ||
function baz() { | ||
"use strict"; | ||
foo(baz); | ||
} | ||
|
||
bar(); | ||
|
||
let caught = false; | ||
|
||
try { | ||
baz(); | ||
} catch (e) { | ||
caught = true; | ||
} | ||
|
||
if (!caught) | ||
throw new Error(`bad!`); |
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,24 @@ | ||
let warm = 1000; | ||
|
||
function bar() { | ||
for (let i = 0; i < warm; ++i) | ||
arguments.callee; | ||
} | ||
|
||
function baz() { | ||
"use strict"; | ||
arguments.callee; | ||
} | ||
|
||
bar(); | ||
|
||
let caught = false; | ||
|
||
try { | ||
baz(); | ||
} catch (e) { | ||
caught = true; | ||
} | ||
|
||
if (!caught) | ||
throw new Error(`bad!`); |
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,28 @@ | ||
let warm = 1000; | ||
|
||
function foo(f) { | ||
return f.caller; | ||
} | ||
noInline(foo); | ||
|
||
function bar() { | ||
for (let i = 0; i < warm; ++i) | ||
foo(bar); | ||
} | ||
function baz() { | ||
"use strict"; | ||
foo(baz); | ||
} | ||
|
||
bar(); | ||
|
||
let caught = false; | ||
|
||
try { | ||
baz(); | ||
} catch (e) { | ||
caught = true; | ||
} | ||
|
||
if (!caught) | ||
throw new Error(`bad!`); |
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,42 @@ | ||
let warm = 1000; | ||
|
||
function foo(f) { | ||
return f.arguments; | ||
} | ||
noInline(foo); | ||
|
||
let caught = 0; | ||
|
||
function bar() { | ||
for (let i = 0; i < warm; ++i) | ||
foo(bar); | ||
const x = function baz1() { "use strict"; return 42; }; | ||
const y = function baz2() { "use strict"; return 0xc0defefe; }; | ||
return [x, y]; | ||
} | ||
|
||
bar(); | ||
bar(); | ||
const [baz1, baz2] = bar(); | ||
|
||
|
||
if (baz1() !== 42) | ||
throw new Error(`bad!`); | ||
|
||
if (baz2() !== 0xc0defefe) | ||
throw new Error(`bad!`); | ||
|
||
try { | ||
foo(baz1); | ||
} catch (e) { | ||
++caught; | ||
} | ||
|
||
try { | ||
foo(baz2); | ||
} catch (e) { | ||
++caught; | ||
} | ||
|
||
if (caught !== 2) | ||
throw new Error(`bad!`); |
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,27 @@ | ||
let warm = 1000; | ||
|
||
function foo(f) { | ||
return f.arguments; | ||
} | ||
noInline(foo); | ||
|
||
let caught = false; | ||
|
||
function bar() { | ||
for (let i = 0; i < warm; ++i) | ||
foo(bar); | ||
function baz() { | ||
"use strict"; | ||
try { | ||
foo(baz); | ||
} catch (e) { | ||
caught = true; | ||
} | ||
} | ||
baz(); | ||
} | ||
|
||
bar(); | ||
|
||
if (!caught) | ||
throw new Error(`bad!`); |
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,8 @@ | ||
function foo(f) { f.hasOwnProperty("arguments"); } | ||
noInline(foo); | ||
|
||
function bar() {} | ||
foo(bar); | ||
|
||
function baz() { "use strict"; } | ||
foo(baz); |
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,12 @@ | ||
function foo(f) { f.hasOwnProperty("arguments"); } | ||
noInline(foo); | ||
|
||
function bar() {} | ||
foo(bar); | ||
|
||
function baz() { | ||
"use strict"; | ||
function boo() {} | ||
return boo; | ||
} | ||
foo(baz()); |
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
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
Oops, something went wrong.