Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 1a2c13c

Browse files
MikeHolmanchakrabot
authored andcommitted
deps: update ChakraCore to chakra-core/ChakraCore@5d123b4b51
[1.8>1.9] [MERGE #4649 @MikeHolman] fix bad register use in asm.js thunk Merge pull request #4649 from MikeHolman:asmthunk OS: 15151031 Reviewed-By: chakrabot <[email protected]>
1 parent 6bdbd08 commit 1a2c13c

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

Diff for: deps/chakrashim/core/lib/Runtime/Library/JavascriptFunction.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -1163,13 +1163,14 @@ namespace Js
11631163
__asm
11641164
{
11651165
mov savedEsp, esp;
1166-
mov eax, argsSize;
1167-
cmp eax, 0x1000;
1166+
mov ecx, argsSize;
1167+
cmp ecx, 0x1000;
11681168
jl allocate_stack;
11691169
// Use _chkstk to probe each page when using more then a page size
1170-
call _chkstk;
1171-
allocate_stack:
1172-
sub esp, eax;
1170+
mov eax, ecx;
1171+
call _chkstk; // _chkstk saves/restores ecx
1172+
allocate_stack:
1173+
sub esp, ecx;
11731174

11741175
mov edi, esp;
11751176
mov esi, argv;

Diff for: deps/chakrashim/core/test/AsmJs/manyargs.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//-------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
//-------------------------------------------------------------------------------------------------------
5+
6+
let str = `(function module() { "use asm";function foo(`;
7+
// 550 double args exceeds 1 page
8+
const totalArgs = 550
9+
for (let i = 0; i < totalArgs; ++i)
10+
{
11+
str += `arg${i},`;
12+
}
13+
str += `arg${totalArgs}){`;
14+
15+
for (let i = 0; i <= totalArgs; ++i)
16+
{
17+
str += `arg${i}=+arg${i};`;
18+
}
19+
str += "return 10;}function bar(){return foo(";
20+
for (let i = 0; i < totalArgs; ++i)
21+
{
22+
str += "0.0,";
23+
}
24+
str += "1.0)|0;}"
25+
str += "return bar})()()";
26+
27+
const result = eval(str);
28+
print(result == 10 ? "Pass" : `Fail: ${result}`);

Diff for: deps/chakrashim/core/test/AsmJs/rlexe.xml

+5
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,11 @@
10431043
<files>argassignbug.js</files>
10441044
</default>
10451045
</test>
1046+
<test>
1047+
<default>
1048+
<files>manyargs.js</files>
1049+
</default>
1050+
</test>
10461051
<test>
10471052
<default>
10481053
<files>maybecallbug.js</files>

0 commit comments

Comments
 (0)