Commit d09bea1b authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

Cleanup labels in torque code

Change-Id: I6bb75c72670043fafaf917c8ed3d146019d542df
Reviewed-on: https://chromium-review.googlesource.com/c/1454727Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59403}
parent b276e30c
......@@ -113,30 +113,26 @@ namespace array_filter {
for (; k < len; k++) {
// Ensure that we haven't walked beyond a possibly updated length.
if (k >= fastO.Get().length) goto Bailout(k, to);
try {
const value: Object = LoadElementNoHole<FixedArrayType>(fastO.Get(), k)
otherwise FoundHole;
const result: Object =
Call(context, callbackfn, thisArg, value, k, fastO.Get());
if (ToBoolean(result)) {
try {
// Since the call to {callbackfn} is observable, we can't
// use the Bailout label until we've successfully stored.
// Hence the {SlowStore} label.
fastA.Recheck() otherwise SlowStore;
if (fastA.Get().length != to) goto SlowStore;
BuildAppendJSArray(kind, fastA.Get(), value)
otherwise SlowStore;
}
label SlowStore {
CreateDataProperty(a, to, value);
}
to = to + 1;
const value: Object = LoadElementNoHole<FixedArrayType>(fastO.Get(), k)
otherwise continue;
const result: Object =
Call(context, callbackfn, thisArg, value, k, fastO.Get());
if (ToBoolean(result)) {
try {
// Since the call to {callbackfn} is observable, we can't
// use the Bailout label until we've successfully stored.
// Hence the {SlowStore} label.
fastA.Recheck() otherwise SlowStore;
if (fastA.Get().length != to) goto SlowStore;
BuildAppendJSArray(kind, fastA.Get(), value)
otherwise SlowStore;
}
label SlowStore {
CreateDataProperty(a, to, value);
}
fastO.Recheck() otherwise goto Bailout(k + 1, to);
to = to + 1;
}
label FoundHole {}
fastO.Recheck() otherwise goto Bailout(k + 1, to);
}
}
......
......@@ -81,14 +81,10 @@ namespace array_foreach {
for (; k < len; k++) {
// Ensure that we haven't walked beyond a possibly updated length.
if (k >= fastO.Get().length) goto Bailout(k);
try {
const value: Object = LoadElementNoHole<FixedArrayType>(fastO.Get(), k)
otherwise FoundHole;
Call(context, callbackfn, thisArg, value, k, fastO.Get());
fastO.Recheck() otherwise goto Bailout(k + 1);
}
label FoundHole {}
const value: Object = LoadElementNoHole<FixedArrayType>(fastO.Get(), k)
otherwise continue;
Call(context, callbackfn, thisArg, value, k, fastO.Get());
fastO.Recheck() otherwise goto Bailout(k + 1);
}
}
......
......@@ -45,14 +45,9 @@ namespace array_join {
const array: JSArray = UnsafeCast<JSArray>(receiver);
const fixedDoubleArray: FixedDoubleArray =
UnsafeCast<FixedDoubleArray>(array.elements);
try {
const element: float64 = LoadDoubleWithHoleCheck(
fixedDoubleArray, UnsafeCast<Smi>(k)) otherwise IfHole;
return AllocateHeapNumberWithValue(element);
}
label IfHole {
return kEmptyString;
}
const element: float64 = LoadDoubleWithHoleCheck(
fixedDoubleArray, UnsafeCast<Smi>(k)) otherwise return kEmptyString;
return AllocateHeapNumberWithValue(element);
}
builtin LoadJoinTypedElement<T: type>(
......
......@@ -21,15 +21,10 @@ namespace array_reverse {
LoadElement<array::FastPackedDoubleElements, float64>(
implicit context: Context)(elements: FixedArrayBase, index: Smi):
float64 {
try {
const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
return LoadDoubleWithHoleCheck(elems, index) otherwise Hole;
}
label Hole {
// This macro is only used for PACKED_DOUBLE, loading the hole should
// be impossible.
unreachable;
}
const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
// This macro is only used for PACKED_DOUBLE, loading the hole should
// be impossible.
return LoadDoubleWithHoleCheck(elems, index) otherwise unreachable;
}
macro StoreElement<ElementsAccessor: type, T: type>(
......
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