Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memop fix related to scanning for missing values #5300

Merged
merged 1 commit into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Runtime/Library/JavascriptArray.inl
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ SECOND_PASS:
else if (!HasNoMissingValues())
{
// Have we overwritten all the missing values?
if (!ScanForMissingValues<T>(0, startOffset))
if (!ScanForMissingValues<T>(0, startOffset) && !ScanForMissingValues<T>(startOffset + length, current->length))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ScanForMissingValues(0, current->length)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because indices from startOffset -> startOffset + length - 1 would be overwritten by the memcopy/memset and we would have given up on memop if the source had missing values in the range being copied/set.


In reply to: 194876775 [](ancestors = 194876775)

{
SetHasNoMissingValues();
}
Expand Down
26 changes: 26 additions & 0 deletions test/Array/memop_missingValues.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

function test0()
{
var GiantPrintArray = [];
var IntArr0 = new Array(1, 1);
var FloatArr0 = [];
FloatArr0[1] = 1;
FloatArr0[0] = 1;
FloatArr0[12] = 1;
var v5;
v5 = IntArr0.length;
for (var i = 0; i < v5; i++) {
FloatArr0[i] = IntArr0[i];
}
GiantPrintArray.push(FloatArr0);
for (var v2 = 0; 0 < GiantPrintArray; 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this loop needed ?

}
}
test0();
test0();
test0();
print("passed");
6 changes: 6 additions & 0 deletions test/Array/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@
<compile-flags>-mic:1 -off:simplejit -mmoc:0</compile-flags>
</default>
</test>
<test>
<default>
<files>memop_missingValues.js</files>
<compile-flags>-mmoc:0</compile-flags>
</default>
</test>
<test>
<default>
<files>bug4587739.js</files>
Expand Down