Commit 2593d073 authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

Remove bogus cast in and rename GetReceiverLengthProperty

BUG=chromium:901040

Change-Id: I0c28a2bd9a43d107e8afe8a8c0d53d1d3278121a
Reviewed-on: https://chromium-review.googlesource.com/c/1317506
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57230}
parent d4219df6
......@@ -536,17 +536,17 @@ module array {
return result;
}
transitioning macro CallMergeAt(context: Context, sortState: FixedArray, i: Smi)
transitioning macro CallMergeAt(
context: Context, sortState: FixedArray, i: Smi)
labels Bailout {
MergeAt(context, sortState, i);
EnsureSuccess(sortState) otherwise Bailout;
}
// Used for OOB asserts in Copy* builtins.
transitioning macro GetReceiverLengthProperty(implicit context: Context)(
sortState: FixedArray): Smi {
return Cast<Smi>(GetLengthProperty(GetReceiver(sortState)))
otherwise unreachable;
transitioning macro GetReceiverLengthFromSortState(implicit context: Context)(
sortState: FixedArray): Number {
return GetLengthProperty(GetReceiver(sortState));
}
transitioning macro CopyToTempArray(
......@@ -556,7 +556,7 @@ module array {
labels Bailout {
assert(srcPos >= 0);
assert(dstPos >= 0);
assert(srcPos <= GetReceiverLengthProperty(sortState) - length);
assert(srcPos <= GetReceiverLengthFromSortState(sortState) - length);
assert(dstPos <= tempArray.length - length);
let srcIdx: Smi = srcPos;
......@@ -577,7 +577,7 @@ module array {
assert(srcPos >= 0);
assert(dstPos >= 0);
assert(srcPos <= tempArray.length - length);
assert(dstPos <= GetReceiverLengthProperty(sortState) - length);
assert(dstPos <= GetReceiverLengthFromSortState(sortState) - length);
let store: StoreFn = GetStoreFn(sortState);
......@@ -603,8 +603,8 @@ module array {
srcPos: Smi, dstPos: Smi, length: Smi): Smi {
assert(srcPos >= 0);
assert(dstPos >= 0);
assert(srcPos <= GetReceiverLengthProperty(sortState) - length);
assert(dstPos <= GetReceiverLengthProperty(sortState) - length);
assert(srcPos <= GetReceiverLengthFromSortState(sortState) - length);
assert(dstPos <= GetReceiverLengthFromSortState(sortState) - length);
try {
let load: LoadFn = GetLoadFn(sortState);
......@@ -1586,7 +1586,8 @@ module array {
// Regardless of invariants, merge all runs on the stack until only one
// remains. This is used at the end of the mergesort.
transitioning macro MergeForceCollapse(context: Context, sortState: FixedArray)
transitioning macro MergeForceCollapse(
context: Context, sortState: FixedArray)
labels Bailout {
let pendingRuns: FixedArray =
UnsafeCast<FixedArray>(sortState[kPendingRunsIdx]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment