Commit 45557b1f authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] format namespaces without indentation

Bug: v8:7793
Change-Id: Id2a93f8ac8c512dbc5cdeb43a97e04d8d6684954
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2196130
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67748}
parent 8b2a3221
......@@ -3,14 +3,13 @@
// found in the LICENSE file.
namespace array {
macro ConvertToRelativeIndex(index: Number, length: Number): Number {
macro ConvertToRelativeIndex(index: Number, length: Number): Number {
return index < 0 ? Max(index + length, 0) : Min(index, length);
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.copyWithin
transitioning javascript builtin ArrayPrototypeCopyWithin(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.copyWithin
transitioning javascript builtin ArrayPrototypeCopyWithin(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// 1. Let O be ? ToObject(this value).
const object: JSReceiver = ToObject_Inline(context, receiver);
......@@ -90,5 +89,5 @@ namespace array {
// 13. Return O.
return object;
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayEveryLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayEveryLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized every implementation are
......@@ -22,10 +22,10 @@ namespace array {
return ArrayEveryLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning javascript builtin
ArrayEveryLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayEveryLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny,
result: JSAny): JSAny {
......@@ -49,12 +49,11 @@ namespace array {
return ArrayEveryLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning builtin ArrayEveryLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
_array: JSAny, o: JSReceiver, initialK: Number, length: Number,
_initialTo: JSAny): JSAny {
transitioning builtin ArrayEveryLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny, _array: JSAny,
o: JSReceiver, initialK: Number, length: Number, _initialTo: JSAny): JSAny {
// 5. Let k be 0.
// 6. Repeat, while k < len
for (let k: Number = initialK; k < length; k++) {
......@@ -82,9 +81,9 @@ namespace array {
// 6d. Increase k by 1. (done by the loop).
}
return True;
}
}
transitioning macro FastArrayEvery(implicit context: Context)(
transitioning macro FastArrayEvery(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, thisArg: JSAny): JSAny
labels Bailout(Smi) {
let k: Smi = 0;
......@@ -106,12 +105,12 @@ namespace array {
}
}
return True;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.every
transitioning javascript builtin
ArrayEvery(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.every
transitioning javascript builtin
ArrayEvery(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.every');
......@@ -141,5 +140,5 @@ namespace array {
} label TypeError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayFilterLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayFilterLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny,
length: JSAny, initialTo: JSAny): JSAny {
......@@ -25,10 +25,10 @@ namespace array {
return ArrayFilterLoopContinuation(
jsreceiver, callbackfn, thisArg, outputArray, jsreceiver, numberK,
numberLength, numberTo);
}
}
transitioning javascript builtin
ArrayFilterLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayFilterLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny,
length: JSAny, valueK: JSAny, initialTo: JSAny, result: JSAny): JSAny {
......@@ -56,9 +56,9 @@ namespace array {
return ArrayFilterLoopContinuation(
jsreceiver, callbackfn, thisArg, outputArray, jsreceiver, numberK,
numberLength, numberTo);
}
}
transitioning builtin ArrayFilterLoopContinuation(implicit context: Context)(
transitioning builtin ArrayFilterLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
array: JSReceiver, o: JSReceiver, initialK: Number, length: Number,
initialTo: Number): JSAny {
......@@ -93,11 +93,12 @@ namespace array {
// 6d. Increase k by 1. (done by the loop).
}
return array;
}
}
transitioning macro FastArrayFilter(implicit context: Context)(
transitioning macro FastArrayFilter(implicit context: Context)(
fastO: FastJSArray, len: Smi, callbackfn: Callable, thisArg: JSAny,
output: FastJSArray) labels Bailout(Number, Number) {
output: FastJSArray) labels
Bailout(Number, Number) {
let k: Smi = 0;
let to: Smi = 0;
let fastOW = NewFastJSArrayWitness(fastO);
......@@ -128,25 +129,25 @@ namespace array {
to = to + 1;
}
}
}
}
// This method creates a 0-length array with the ElementsKind of the
// receiver if possible, otherwise, bails out. It makes sense for the
// caller to know that the slow case needs to be invoked.
macro FastFilterSpeciesCreate(implicit context: Context)(
receiver: JSReceiver): JSReceiver labels Slow {
// This method creates a 0-length array with the ElementsKind of the
// receiver if possible, otherwise, bails out. It makes sense for the
// caller to know that the slow case needs to be invoked.
macro FastFilterSpeciesCreate(implicit context: Context)(receiver: JSReceiver):
JSReceiver labels Slow {
const len: Smi = 0;
if (IsArraySpeciesProtectorCellInvalid()) goto Slow;
const o = Cast<FastJSArray>(receiver) otherwise Slow;
const newMap: Map =
LoadJSArrayElementsMap(o.map.elements_kind, LoadNativeContext(context));
return AllocateJSArray(ElementsKind::PACKED_SMI_ELEMENTS, newMap, len, len);
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
transitioning javascript builtin
ArrayFilter(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.filter
transitioning javascript builtin
ArrayFilter(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.filter');
......@@ -194,5 +195,5 @@ namespace array {
} label TypeError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayFindLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayFindLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized find implementation are
......@@ -21,10 +21,10 @@ namespace array {
return ArrayFindLoopContinuation(
jsreceiver, callbackfn, thisArg, jsreceiver, numberK, numberLength);
}
}
transitioning javascript builtin
ArrayFindLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayFindLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
_callback: JSAny, _thisArg: JSAny, _initialK: JSAny, _length: JSAny,
_result: JSAny): JSAny {
......@@ -32,13 +32,13 @@ namespace array {
// exists to make stack traces correct from a ThrowTypeError if the
// callback was found to be non-callable.
unreachable;
}
}
// Continuation that is called after a lazy deoptimization from TF that
// happens right after the callback and it's returned value must be handled
// before iteration continues.
transitioning javascript builtin
ArrayFindLoopAfterCallbackLazyDeoptContinuation(
// Continuation that is called after a lazy deoptimization from TF that
// happens right after the callback and it's returned value must be handled
// before iteration continues.
transitioning javascript builtin
ArrayFindLoopAfterCallbackLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny,
foundValue: JSAny, isFound: JSAny): JSAny {
......@@ -61,11 +61,11 @@ namespace array {
return ArrayFindLoopContinuation(
jsreceiver, callbackfn, thisArg, jsreceiver, numberK, numberLength);
}
}
transitioning builtin ArrayFindLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
o: JSReceiver, initialK: Number, length: Number): JSAny {
transitioning builtin ArrayFindLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny, o: JSReceiver,
initialK: Number, length: Number): JSAny {
// 5. Let k be 0.
// 6. Repeat, while k < len
for (let k: Number = initialK; k < length; k++) {
......@@ -88,9 +88,9 @@ namespace array {
// 6e. Increase k by 1. (done by the loop).
}
return Undefined;
}
}
transitioning macro FastArrayFind(implicit context: Context)(
transitioning macro FastArrayFind(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, thisArg: JSAny): JSAny
labels Bailout(Smi) {
let k: Smi = 0;
......@@ -113,12 +113,12 @@ namespace array {
}
}
return Undefined;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.find
transitioning javascript builtin
ArrayPrototypeFind(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.find
transitioning javascript builtin
ArrayPrototypeFind(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.find');
......@@ -132,8 +132,7 @@ namespace array {
if (arguments.length == 0) {
goto NotCallableError;
}
const callbackfn =
Cast<Callable>(arguments[0]) otherwise NotCallableError;
const callbackfn = Cast<Callable>(arguments[0]) otherwise NotCallableError;
// 4. If thisArg is present, let T be thisArg; else let T be undefined.
const thisArg: JSAny = arguments[1];
......@@ -148,5 +147,5 @@ namespace array {
} label NotCallableError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayFindIndexLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayFindIndexLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized findIndex implementation are
......@@ -21,10 +21,10 @@ namespace array {
return ArrayFindIndexLoopContinuation(
jsreceiver, callbackfn, thisArg, jsreceiver, numberK, numberLength);
}
}
transitioning javascript builtin
ArrayFindIndexLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayFindIndexLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
_callback: JSAny, _thisArg: JSAny, _initialK: JSAny, _length: JSAny,
_result: JSAny): JSAny {
......@@ -32,13 +32,13 @@ namespace array {
// exists to make stack traces correct from a ThrowTypeError if the
// callback was found to be non-callable.
unreachable;
}
}
// Continuation that is called after a lazy deoptimization from TF that
// happens right after the callback and it's returned value must be handled
// before iteration continues.
transitioning javascript builtin
ArrayFindIndexLoopAfterCallbackLazyDeoptContinuation(
// Continuation that is called after a lazy deoptimization from TF that
// happens right after the callback and it's returned value must be handled
// before iteration continues.
transitioning javascript builtin
ArrayFindIndexLoopAfterCallbackLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny,
foundValue: JSAny, isFound: JSAny): JSAny {
......@@ -61,12 +61,11 @@ namespace array {
return ArrayFindIndexLoopContinuation(
jsreceiver, callbackfn, thisArg, jsreceiver, numberK, numberLength);
}
}
transitioning builtin ArrayFindIndexLoopContinuation(implicit context:
Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
o: JSReceiver, initialK: Number, length: Number): Number {
transitioning builtin ArrayFindIndexLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny, o: JSReceiver,
initialK: Number, length: Number): Number {
// 5. Let k be 0.
// 6. Repeat, while k < len
for (let k: Number = initialK; k < length; k++) {
......@@ -89,9 +88,9 @@ namespace array {
// 6e. Increase k by 1. (done by the loop).
}
return Convert<Smi>(-1);
}
}
transitioning macro FastArrayFindIndex(implicit context: Context)(
transitioning macro FastArrayFindIndex(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, thisArg: JSAny): Number
labels Bailout(Smi) {
let k: Smi = 0;
......@@ -114,12 +113,12 @@ namespace array {
}
}
return -1;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
transitioning javascript builtin
ArrayPrototypeFindIndex(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
transitioning javascript builtin
ArrayPrototypeFindIndex(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.findIndex');
......@@ -133,8 +132,7 @@ namespace array {
if (arguments.length == 0) {
goto NotCallableError;
}
const callbackfn =
Cast<Callable>(arguments[0]) otherwise NotCallableError;
const callbackfn = Cast<Callable>(arguments[0]) otherwise NotCallableError;
// 4. If thisArg is present, let T be thisArg; else let T be undefined.
const thisArg: JSAny = arguments[1];
......@@ -144,11 +142,10 @@ namespace array {
return FastArrayFindIndex(o, len, callbackfn, thisArg)
otherwise Bailout;
} label Bailout(k: Smi) deferred {
return ArrayFindIndexLoopContinuation(
o, callbackfn, thisArg, o, k, len);
return ArrayFindIndexLoopContinuation(o, callbackfn, thisArg, o, k, len);
}
} label NotCallableError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayForEachLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayForEachLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized forEach implementation are
......@@ -18,10 +18,10 @@ namespace array {
return ArrayForEachLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning javascript builtin
ArrayForEachLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayForEachLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny,
_result: JSAny): JSAny {
......@@ -36,12 +36,11 @@ namespace array {
return ArrayForEachLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning builtin ArrayForEachLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
_array: JSAny, o: JSReceiver, initialK: Number, len: Number,
_to: JSAny): JSAny {
transitioning builtin ArrayForEachLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny, _array: JSAny,
o: JSReceiver, initialK: Number, len: Number, _to: JSAny): JSAny {
// variables {array} and {to} are ignored.
// 5. Let k be 0.
......@@ -66,9 +65,9 @@ namespace array {
// 6d. Increase k by 1. (done by the loop).
}
return Undefined;
}
}
transitioning macro FastArrayForEach(implicit context: Context)(
transitioning macro FastArrayForEach(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, thisArg: JSAny): JSAny
labels Bailout(Smi) {
let k: Smi = 0;
......@@ -87,12 +86,12 @@ namespace array {
Call(context, callbackfn, thisArg, value, k, fastOW.Get());
}
return Undefined;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
transitioning javascript builtin
ArrayForEach(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach
transitioning javascript builtin
ArrayForEach(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.forEach');
......@@ -125,5 +124,5 @@ namespace array {
} label TypeError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
namespace array {
// Array.from( items [, mapfn [, thisArg ] ] )
// ES #sec-array.from
transitioning javascript builtin
ArrayFrom(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
// Array.from( items [, mapfn [, thisArg ] ] )
// ES #sec-array.from
transitioning javascript builtin
ArrayFrom(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
JSReceiver {
// Use fast path if:
// * |items| is the only argument, and
......@@ -106,8 +106,8 @@ namespace array {
// return ? IteratorClose(iteratorRecord, mappedValue).
// 3. Set mappedValue to mappedValue.[[Value]].
try {
mappedValue = Call(
context, UnsafeCast<Callable>(mapfn), thisArg, nextValue, k);
mappedValue =
Call(context, UnsafeCast<Callable>(mapfn), thisArg, nextValue, k);
} catch (e) {
iterator::IteratorCloseOnException(iteratorRecord);
ReThrow(context, e);
......@@ -179,5 +179,5 @@ namespace array {
} label IteratorNotCallable(_value: JSAny) deferred {
ThrowTypeError(MessageTemplate::kIteratorSymbolNonCallable);
}
}
}
}
......@@ -3,13 +3,13 @@
// found in the LICENSE file.
namespace runtime {
extern runtime ArrayIsArray(implicit context: Context)(JSAny): JSAny;
extern runtime ArrayIsArray(implicit context: Context)(JSAny): JSAny;
} // namespace runtime
namespace array {
// ES #sec-array.isarray
javascript builtin ArrayIsArray(js-implicit context:
NativeContext)(arg: JSAny): JSAny {
// ES #sec-array.isarray
javascript builtin ArrayIsArray(js-implicit context: NativeContext)(arg: JSAny):
JSAny {
// 1. Return ? IsArray(arg).
typeswitch (arg) {
case (JSArray): {
......@@ -23,5 +23,5 @@ namespace array {
return False;
}
}
}
}
} // namespace array
This diff is collapsed.
......@@ -3,28 +3,28 @@
// found in the LICENSE file.
namespace array {
macro LoadWithHoleCheck<Elements : type extends FixedArrayBase>(
macro LoadWithHoleCheck<Elements : type extends FixedArrayBase>(
elements: FixedArrayBase, index: Smi): JSAny
labels IfHole;
LoadWithHoleCheck<FixedArray>(implicit context: Context)(
LoadWithHoleCheck<FixedArray>(implicit context: Context)(
elements: FixedArrayBase, index: Smi): JSAny
labels IfHole {
const elements: FixedArray = UnsafeCast<FixedArray>(elements);
const element: Object = elements.objects[index];
if (element == TheHole) goto IfHole;
return UnsafeCast<JSAny>(element);
}
}
LoadWithHoleCheck<FixedDoubleArray>(implicit context: Context)(
LoadWithHoleCheck<FixedDoubleArray>(implicit context: Context)(
elements: FixedArrayBase, index: Smi): JSAny
labels IfHole {
const elements: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
const element: float64 = elements.floats[index].Value() otherwise IfHole;
return AllocateHeapNumberWithValue(element);
}
}
macro FastArrayLastIndexOf<Elements : type extends FixedArrayBase>(
macro FastArrayLastIndexOf<Elements : type extends FixedArrayBase>(
context: Context, array: JSArray, from: Smi, searchElement: JSAny): Smi {
const elements: FixedArrayBase = array.elements;
let k: Smi = from;
......@@ -54,10 +54,10 @@ namespace array {
assert(Is<FastJSArray>(array));
return -1;
}
}
transitioning macro
GetFromIndex(context: Context, length: Number, arguments: Arguments): Number {
transitioning macro
GetFromIndex(context: Context, length: Number, arguments: Arguments): Number {
// 4. If fromIndex is present, let n be ? ToInteger(fromIndex);
// else let n be len - 1.
const n: Number =
......@@ -74,9 +74,9 @@ namespace array {
k = length + n;
}
return k;
}
}
macro TryFastArrayLastIndexOf(
macro TryFastArrayLastIndexOf(
context: Context, receiver: JSReceiver, searchElement: JSAny,
from: Number): JSAny
labels Slow {
......@@ -93,9 +93,9 @@ namespace array {
assert(IsDoubleElementsKind(kind));
return FastArrayLastIndexOf<FixedDoubleArray>(
context, array, fromSmi, searchElement);
}
}
transitioning macro GenericArrayLastIndexOf(
transitioning macro GenericArrayLastIndexOf(
context: Context, object: JSReceiver, searchElement: JSAny,
from: Number): JSAny {
let k: Number = from;
......@@ -124,12 +124,11 @@ namespace array {
// 8. Return -1.
return SmiConstant(-1);
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.lastIndexOf
transitioning javascript builtin ArrayPrototypeLastIndexOf(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.lastIndexOf
transitioning javascript builtin ArrayPrototypeLastIndexOf(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// 1. Let O be ? ToObject(this value).
const object: JSReceiver = ToObject_Inline(context, receiver);
......@@ -150,5 +149,5 @@ namespace array {
} label Baseline {
return GenericArrayLastIndexOf(context, object, searchElement, from);
}
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayMapLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayMapLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny,
length: JSAny): JSAny {
......@@ -24,10 +24,10 @@ namespace array {
return ArrayMapLoopContinuation(
jsreceiver, callbackfn, thisArg, outputArray, jsreceiver, numberK,
numberLength);
}
}
transitioning javascript builtin
ArrayMapLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayMapLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, array: JSAny, initialK: JSAny,
length: JSAny, result: JSAny): JSAny {
......@@ -54,12 +54,11 @@ namespace array {
return ArrayMapLoopContinuation(
jsreceiver, callbackfn, thisArg, outputArray, jsreceiver, numberK,
numberLength);
}
}
transitioning builtin ArrayMapLoopContinuation(implicit context: Context)(
transitioning builtin ArrayMapLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
array: JSReceiver, o: JSReceiver, initialK: Number,
length: Number): JSAny {
array: JSReceiver, o: JSReceiver, initialK: Number, length: Number): JSAny {
// 6. Let k be 0.
// 7. Repeat, while k < len
for (let k: Number = initialK; k < length; k++) {
......@@ -88,9 +87,9 @@ namespace array {
// 8. Return A.
return array;
}
}
struct Vector {
struct Vector {
macro ReportSkippedElement() {
this.skippedElements = true;
}
......@@ -168,9 +167,9 @@ namespace array {
onlySmis: bool; // initially true.
onlyNumbers: bool; // initially true.
skippedElements: bool; // initially false.
}
}
macro NewVector(implicit context: Context)(length: Smi): Vector {
macro NewVector(implicit context: Context)(length: Smi): Vector {
const fixedArray = length > 0 ?
AllocateFixedArrayWithHoles(
SmiUntag(length), AllocationFlag::kAllowLargeObjectAllocation) :
......@@ -181,9 +180,9 @@ namespace array {
onlyNumbers: true,
skippedElements: false
};
}
}
transitioning macro FastArrayMap(implicit context: Context)(
transitioning macro FastArrayMap(implicit context: Context)(
fastO: FastJSArrayForRead, len: Smi, callbackfn: Callable,
thisArg: JSAny): JSArray
labels Bailout(JSArray, Smi) {
......@@ -218,12 +217,12 @@ namespace array {
}
return vector.CreateJSArray(len);
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.map
transitioning javascript builtin
ArrayMap(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.map
transitioning javascript builtin
ArrayMap(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.map');
......@@ -264,5 +263,5 @@ namespace array {
} label TypeError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
namespace array {
// https://tc39.github.io/ecma262/#sec-array.of
transitioning javascript builtin
ArrayOf(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
JSAny {
// https://tc39.github.io/ecma262/#sec-array.of
transitioning javascript builtin
ArrayOf(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// 1. Let len be the actual number of arguments passed to this function.
const len: Smi = Convert<Smi>(arguments.length);
......@@ -51,5 +51,5 @@ namespace array {
// 9. Return A.
return a;
}
}
}
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayReduceRightPreLoopEagerDeoptContinuation(
js-implicit context: NativeContext,
receiver: JSAny)(callback: JSAny, length: JSAny): JSAny {
transitioning javascript builtin
ArrayReduceRightPreLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized every implementation are
// after the ToObject(O) call that ensures we are dealing with a
// JSReceiver.
......@@ -24,10 +24,10 @@ namespace array {
// last non-hole element, rightly throwing an exception if not found.
return ArrayReduceRightLoopContinuation(
jsreceiver, callbackfn, TheHole, jsreceiver, initialK, numberLength);
}
}
transitioning javascript builtin
ArrayReduceRightLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayReduceRightLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, initialK: JSAny, length: JSAny,
accumulator: JSAny): JSAny {
......@@ -45,10 +45,10 @@ namespace array {
return ArrayReduceRightLoopContinuation(
jsreceiver, callbackfn, accumulator, jsreceiver, numberK, numberLength);
}
}
transitioning javascript builtin
ArrayReduceRightLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayReduceRightLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny {
// All continuation points in the optimized every implementation are
......@@ -63,10 +63,10 @@ namespace array {
const r = ArrayReduceRightLoopContinuation(
jsreceiver, callbackfn, result, jsreceiver, numberK, numberLength);
return r;
}
}
transitioning builtin ArrayReduceRightLoopContinuation(implicit context:
Context)(
transitioning builtin ArrayReduceRightLoopContinuation(
implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable,
initialAccumulator: JSAny|TheHole, o: JSReceiver, initialK: Number,
_length: Number): JSAny {
......@@ -95,8 +95,7 @@ namespace array {
// 9c. ii. Set accumulator to ? Call(callbackfn, undefined,
// <accumulator, kValue, k, O>).
accumulator = Call(
context, callbackfn, Undefined, accumulatorNotHole, value, k,
o);
context, callbackfn, Undefined, accumulatorNotHole, value, k, o);
}
}
}
......@@ -116,12 +115,12 @@ namespace array {
return accumulator;
}
}
}
}
transitioning macro FastArrayReduceRight(implicit context: Context)(
transitioning macro FastArrayReduceRight(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable,
initialAccumulator: JSAny|TheHole): JSAny
labels Bailout(Number, JSAny|TheHole) {
labels Bailout(Number, JSAny | TheHole) {
let accumulator = initialAccumulator;
const smiLen = Cast<Smi>(len) otherwise goto Bailout(len - 1, accumulator);
const fastO = Cast<FastJSArrayForRead>(o)
......@@ -156,12 +155,12 @@ namespace array {
return accumulator;
}
}
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceRight
transitioning javascript builtin
ArrayReduceRight(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.reduceRight
transitioning javascript builtin
ArrayReduceRight(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.reduceRight');
......@@ -194,5 +193,5 @@ namespace array {
} label NoCallableError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArrayReducePreLoopEagerDeoptContinuation(
js-implicit context: NativeContext,
receiver: JSAny)(callback: JSAny, length: JSAny): JSAny {
transitioning javascript builtin
ArrayReducePreLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized every implementation are
// after the ToObject(O) call that ensures we are dealing with a
// JSReceiver.
......@@ -23,10 +23,10 @@ namespace array {
// element, rightly throwing an exception if not found.
return ArrayReduceLoopContinuation(
jsreceiver, callbackfn, TheHole, jsreceiver, 0, numberLength);
}
}
transitioning javascript builtin
ArrayReduceLoopEagerDeoptContinuation(
transitioning javascript builtin
ArrayReduceLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, initialK: JSAny, length: JSAny,
accumulator: JSAny): JSAny {
......@@ -44,10 +44,10 @@ namespace array {
return ArrayReduceLoopContinuation(
jsreceiver, callbackfn, accumulator, jsreceiver, numberK, numberLength);
}
}
transitioning javascript builtin
ArrayReduceLoopLazyDeoptContinuation(
transitioning javascript builtin
ArrayReduceLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, initialK: JSAny, length: JSAny, result: JSAny): JSAny {
// All continuation points in the optimized every implementation are
......@@ -62,9 +62,9 @@ namespace array {
const r = ArrayReduceLoopContinuation(
jsreceiver, callbackfn, result, jsreceiver, numberK, numberLength);
return r;
}
}
transitioning builtin ArrayReduceLoopContinuation(implicit context: Context)(
transitioning builtin ArrayReduceLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable,
initialAccumulator: JSAny|TheHole, o: JSReceiver, initialK: Number,
length: Number): JSAny {
......@@ -93,8 +93,7 @@ namespace array {
// 9c. ii. Set accumulator to ? Call(callbackfn, undefined,
// <accumulator, kValue, k, O>).
accumulator = Call(
context, callbackfn, Undefined, accumulatorNotHole, value, k,
o);
context, callbackfn, Undefined, accumulatorNotHole, value, k, o);
}
}
}
......@@ -114,12 +113,12 @@ namespace array {
return accumulator;
}
}
}
}
transitioning macro FastArrayReduce(implicit context: Context)(
transitioning macro FastArrayReduce(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable,
initialAccumulator: JSAny|TheHole): JSAny
labels Bailout(Number, JSAny|TheHole) {
labels Bailout(Number, JSAny | TheHole) {
const k = 0;
let accumulator = initialAccumulator;
Cast<Smi>(len) otherwise goto Bailout(k, accumulator);
......@@ -155,12 +154,12 @@ namespace array {
return accumulator;
}
}
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
transitioning javascript builtin
ArrayReduce(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
transitioning javascript builtin
ArrayReduce(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.reduce');
......@@ -193,5 +192,5 @@ namespace array {
} label NoCallableError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,58 +3,55 @@
// found in the LICENSE file.
namespace array {
macro LoadElement<ElementsAccessor : type extends ElementsKind, T: type>(
macro LoadElement<ElementsAccessor : type extends ElementsKind, T: type>(
elements: FixedArrayBase, index: Smi): T;
LoadElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
LoadElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
elements: FixedArrayBase, index: Smi): Smi {
const elements: FixedArray = UnsafeCast<FixedArray>(elements);
return UnsafeCast<Smi>(elements.objects[index]);
}
}
LoadElement<array::FastPackedObjectElements, JSAny>(
implicit context: Context)(elements: FixedArrayBase, index: Smi): JSAny {
LoadElement<array::FastPackedObjectElements, JSAny>(implicit context: Context)(
elements: FixedArrayBase, index: Smi): JSAny {
const elements: FixedArray = UnsafeCast<FixedArray>(elements);
return UnsafeCast<JSAny>(elements.objects[index]);
}
}
LoadElement<array::FastPackedDoubleElements, float64>(
implicit context: Context)(elements: FixedArrayBase, index: Smi):
float64 {
LoadElement<array::FastPackedDoubleElements, float64>(
implicit context: Context)(elements: FixedArrayBase, index: Smi): float64 {
const elements: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
// This macro is only used for PACKED_DOUBLE, loading the hole should
// be impossible.
return elements.floats[index].Value() otherwise unreachable;
}
}
macro StoreElement<ElementsAccessor : type extends ElementsKind, T: type>(
implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: T);
macro StoreElement<ElementsAccessor : type extends ElementsKind, T: type>(
implicit context: Context)(elements: FixedArrayBase, index: Smi, value: T);
StoreElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
StoreElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
elements: FixedArrayBase, index: Smi, value: Smi) {
const elems: FixedArray = UnsafeCast<FixedArray>(elements);
StoreFixedArrayElement(elems, index, value, SKIP_WRITE_BARRIER);
}
}
StoreElement<array::FastPackedObjectElements, JSAny>(
implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: JSAny) {
StoreElement<array::FastPackedObjectElements, JSAny>(implicit context: Context)(
elements: FixedArrayBase, index: Smi, value: JSAny) {
const elements: FixedArray = UnsafeCast<FixedArray>(elements);
elements.objects[index] = value;
}
}
StoreElement<array::FastPackedDoubleElements, float64>(
implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: float64) {
StoreElement<array::FastPackedDoubleElements, float64>(
implicit context: Context)(
elements: FixedArrayBase, index: Smi, value: float64) {
const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
StoreFixedDoubleArrayElementSmi(elems, index, value);
}
}
// Fast-path for all PACKED_* elements kinds. These do not need to check
// whether a property is present, so we can simply swap them using fast
// FixedArray loads/stores.
macro FastPackedArrayReverse<Accessor: type, T: type>(
// Fast-path for all PACKED_* elements kinds. These do not need to check
// whether a property is present, so we can simply swap them using fast
// FixedArray loads/stores.
macro FastPackedArrayReverse<Accessor: type, T: type>(
implicit context: Context)(elements: FixedArrayBase, length: Smi) {
let lower: Smi = 0;
let upper: Smi = length - 1;
......@@ -67,10 +64,10 @@ namespace array {
++lower;
--upper;
}
}
}
transitioning macro GenericArrayReverse(context: Context, receiver: JSAny):
JSAny {
transitioning macro GenericArrayReverse(
context: Context, receiver: JSAny): JSAny {
// 1. Let O be ? ToObject(this value).
const object: JSReceiver = ToObject_Inline(context, receiver);
......@@ -139,9 +136,9 @@ namespace array {
// 6. Return O.
return object;
}
}
macro TryFastPackedArrayReverse(implicit context: Context)(receiver: JSAny)
macro TryFastPackedArrayReverse(implicit context: Context)(receiver: JSAny)
labels Slow {
const array: FastJSArray = Cast<FastJSArray>(receiver) otherwise Slow;
......@@ -160,17 +157,16 @@ namespace array {
} else {
goto Slow;
}
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
transitioning javascript builtin ArrayPrototypeReverse(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
transitioning javascript builtin ArrayPrototypeReverse(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
TryFastPackedArrayReverse(receiver) otherwise Baseline;
return receiver;
} label Baseline {
return GenericArrayReverse(context, receiver);
}
}
}
}
......@@ -3,9 +3,9 @@
// found in the LICENSE file.
namespace array {
extern builtin ArrayShift(Context, JSFunction, JSAny, int32): JSAny;
extern builtin ArrayShift(Context, JSFunction, JSAny, int32): JSAny;
macro TryFastArrayShift(implicit context: Context)(receiver: JSAny): JSAny
macro TryFastArrayShift(implicit context: Context)(receiver: JSAny): JSAny
labels Slow, Runtime {
const array: FastJSArray = Cast<FastJSArray>(receiver) otherwise Slow;
let witness = NewFastJSArrayWitness(array);
......@@ -34,10 +34,10 @@ namespace array {
witness.MoveElements(0, 1, Convert<intptr>(newLength));
witness.StoreHole(newLength);
return result;
}
}
transitioning macro GenericArrayShift(implicit context:
Context)(receiver: JSAny): JSAny {
transitioning macro GenericArrayShift(implicit context: Context)(
receiver: JSAny): JSAny {
// 1. Let O be ? ToObject(this value).
const object: JSReceiver = ToObject_Inline(context, receiver);
......@@ -91,12 +91,11 @@ namespace array {
// 9. Return first.
return first;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.shift
transitioning javascript builtin ArrayPrototypeShift(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.shift
transitioning javascript builtin ArrayPrototypeShift(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
return TryFastArrayShift(receiver) otherwise Slow, Runtime;
} label Slow {
......@@ -106,5 +105,5 @@ namespace array {
context, LoadTargetFromFrame(), Undefined,
Convert<int32>(arguments.length));
}
}
}
}
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
namespace array {
macro HandleSimpleArgumentsSlice(
macro HandleSimpleArgumentsSlice(
context: NativeContext, args: JSArgumentsObjectWithLength, start: Smi,
count: Smi): JSArray
labels Bailout {
......@@ -25,9 +25,9 @@ namespace array {
ElementsKind::PACKED_ELEMENTS, newElements, 0, sourceElements,
Convert<intptr>(start), Convert<intptr>(count));
return result;
}
}
macro HandleFastAliasedSloppyArgumentsSlice(
macro HandleFastAliasedSloppyArgumentsSlice(
context: NativeContext, args: JSArgumentsObjectWithLength, start: Smi,
count: Smi): JSArray
labels Bailout {
......@@ -49,8 +49,8 @@ namespace array {
const unmappedElementsLength: Smi = unmappedElements.length;
if (SmiAbove(end, unmappedElementsLength)) goto Bailout;
const argumentsContext: Context = UnsafeCast<Context>(
sloppyElements.objects[kSloppyArgumentsContextIndex]);
const argumentsContext: Context =
UnsafeCast<Context>(sloppyElements.objects[kSloppyArgumentsContextIndex]);
const arrayMap: Map =
LoadJSArrayElementsMap(ElementsKind::HOLEY_ELEMENTS, context);
......@@ -81,13 +81,13 @@ namespace array {
const unmappedFrom: Smi = SmiMin(SmiMax(parameterMapLength, start), end);
const restCount: Smi = end - unmappedFrom;
CopyElements(
ElementsKind::PACKED_ELEMENTS, resultElements,
Convert<intptr>(indexOut), unmappedElements,
Convert<intptr>(unmappedFrom), Convert<intptr>(restCount));
ElementsKind::PACKED_ELEMENTS, resultElements, Convert<intptr>(indexOut),
unmappedElements, Convert<intptr>(unmappedFrom),
Convert<intptr>(restCount));
return result;
}
}
macro HandleFastSlice(
macro HandleFastSlice(
context: NativeContext, o: JSAny, startNumber: Number,
countNumber: Number): JSArray
labels Bailout {
......@@ -113,8 +113,7 @@ namespace array {
case (a: JSSloppyArgumentsObject): {
const map: Map = a.map;
if (IsFastAliasedArgumentsMap(map)) {
return HandleFastAliasedSloppyArgumentsSlice(
context, a, start, count)
return HandleFastAliasedSloppyArgumentsSlice(context, a, start, count)
otherwise Bailout;
} else if (IsSloppyArgumentsMap(map)) {
goto HandleSimpleArgumentsSlice(a);
......@@ -129,12 +128,12 @@ namespace array {
return HandleSimpleArgumentsSlice(context, a, start, count)
otherwise Bailout;
}
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
transitioning javascript builtin
ArrayPrototypeSlice(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
transitioning javascript builtin
ArrayPrototypeSlice(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// Handle array cloning case if the receiver is a fast array.
if (arguments.length == 0) {
typeswitch (receiver) {
......@@ -221,5 +220,5 @@ namespace array {
// 12. Return A.
return a;
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace array {
transitioning javascript builtin
ArraySomeLoopEagerDeoptContinuation(
transitioning javascript builtin
ArraySomeLoopEagerDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny): JSAny {
// All continuation points in the optimized some implementation are
......@@ -22,10 +22,10 @@ namespace array {
return ArraySomeLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning javascript builtin
ArraySomeLoopLazyDeoptContinuation(
transitioning javascript builtin
ArraySomeLoopLazyDeoptContinuation(
js-implicit context: NativeContext, receiver: JSAny)(
callback: JSAny, thisArg: JSAny, initialK: JSAny, length: JSAny,
result: JSAny): JSAny {
......@@ -49,12 +49,11 @@ namespace array {
return ArraySomeLoopContinuation(
jsreceiver, callbackfn, thisArg, Undefined, jsreceiver, numberK,
numberLength, Undefined);
}
}
transitioning builtin ArraySomeLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny,
_array: JSAny, o: JSReceiver, initialK: Number, length: Number,
_initialTo: JSAny): JSAny {
transitioning builtin ArraySomeLoopContinuation(implicit context: Context)(
_receiver: JSReceiver, callbackfn: Callable, thisArg: JSAny, _array: JSAny,
o: JSReceiver, initialK: Number, length: Number, _initialTo: JSAny): JSAny {
// 5. Let k be 0.
// 6. Repeat, while k < len
for (let k: Number = initialK; k < length; k++) {
......@@ -82,9 +81,9 @@ namespace array {
// 6d. Increase k by 1. (done by the loop).
}
return False;
}
}
transitioning macro FastArraySome(implicit context: Context)(
transitioning macro FastArraySome(implicit context: Context)(
o: JSReceiver, len: Number, callbackfn: Callable, thisArg: JSAny): JSAny
labels Bailout(Smi) {
let k: Smi = 0;
......@@ -106,12 +105,12 @@ namespace array {
}
}
return False;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.some
transitioning javascript builtin
ArraySome(js-implicit context: NativeContext, receiver: JSAny)(...arguments):
JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.some
transitioning javascript builtin
ArraySome(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
RequireObjectCoercible(receiver, 'Array.prototype.some');
......@@ -141,5 +140,5 @@ namespace array {
} label TypeError deferred {
ThrowTypeError(MessageTemplate::kCalledNonCallable, arguments[0]);
}
}
}
}
......@@ -3,21 +3,21 @@
// found in the LICENSE file.
namespace array {
// Given {source}, we want to create a non-zero length array of type
// FixedArrayType with the specified {result_capacity}. Starting from
// {startIndex}, {count} number of elements are copied to the newly
// created result array. Most of this behavior is outsourced to
// ExtractFixedArray(). We handle the case where the {source} is
// EmptyFixedArray but result is expected to be a FixedDoubleArray.
macro Extract(implicit context: Context)(
// Given {source}, we want to create a non-zero length array of type
// FixedArrayType with the specified {result_capacity}. Starting from
// {startIndex}, {count} number of elements are copied to the newly
// created result array. Most of this behavior is outsourced to
// ExtractFixedArray(). We handle the case where the {source} is
// EmptyFixedArray but result is expected to be a FixedDoubleArray.
macro Extract(implicit context: Context)(
source: FixedArray, startIndex: Smi, count: Smi,
resultCapacity: Smi): FixedArray {
return ExtractFixedArray(
source, Convert<intptr>(startIndex), Convert<intptr>(count),
Convert<intptr>(resultCapacity));
}
}
macro Extract(implicit context: Context)(
macro Extract(implicit context: Context)(
source: FixedDoubleArray|EmptyFixedArray, startIndex: Smi, count: Smi,
resultCapacity: Smi): FixedDoubleArray|EmptyFixedArray {
typeswitch (source) {
......@@ -34,42 +34,40 @@ namespace array {
Convert<intptr>(resultCapacity));
}
}
}
}
macro DoMoveElements<FixedArrayType : type extends FixedArrayBase>(
elements: FixedArrayType, dstIndex: Smi, srcIndex: Smi,
count: Smi): void {
macro DoMoveElements<FixedArrayType : type extends FixedArrayBase>(
elements: FixedArrayType, dstIndex: Smi, srcIndex: Smi, count: Smi): void {
TorqueMoveElements(
elements, Convert<intptr>(dstIndex), Convert<intptr>(srcIndex),
Convert<intptr>(count));
}
}
macro StoreHoles<FixedArrayType : type extends FixedArrayBase>(
macro StoreHoles<FixedArrayType : type extends FixedArrayBase>(
elements: FixedArrayType, holeStartIndex: Smi, holeEndIndex: Smi): void {
for (let i: Smi = holeStartIndex; i < holeEndIndex; i++) {
array::StoreArrayHole(elements, i);
}
}
}
macro DoCopyElements<FixedArrayType : type extends FixedArrayBase>(
macro DoCopyElements<FixedArrayType : type extends FixedArrayBase>(
dstElements: FixedArrayType, dstIndex: Smi, srcElements: FixedArrayType,
srcIndex: Smi, count: Smi): void {
TorqueCopyElements(
dstElements, Convert<intptr>(dstIndex), srcElements,
Convert<intptr>(srcIndex), Convert<intptr>(count));
}
}
macro
FastSplice<FixedArrayType : type extends FixedArrayBase, ElementType: type>(
macro
FastSplice<FixedArrayType : type extends FixedArrayBase, ElementType: type>(
implicit context: Context)(
args: Arguments, a: JSArray, length: Smi, newLength: Smi,
actualStart: Smi, insertCount: Smi, actualDeleteCount: Smi): void {
args: Arguments, a: JSArray, length: Smi, newLength: Smi, actualStart: Smi,
insertCount: Smi, actualDeleteCount: Smi): void {
// Make sure elements are writable.
array::EnsureWriteableFastElements(a);
if (insertCount != actualDeleteCount) {
const elements =
UnsafeCast<(FixedArrayType | EmptyFixedArray)>(a.elements);
const elements = UnsafeCast<(FixedArrayType | EmptyFixedArray)>(a.elements);
const dstIndex: Smi = actualStart + insertCount;
const srcIndex: Smi = actualStart + actualDeleteCount;
const count: Smi = length - actualDeleteCount - actualStart;
......@@ -113,15 +111,14 @@ namespace array {
// Update the array's length after all the FixedArray shuffling is done.
a.length = newLength;
}
}
transitioning macro FastArraySplice(
transitioning macro FastArraySplice(
context: Context, args: Arguments, o: JSReceiver,
originalLengthNumber: Number, actualStartNumber: Number, insertCount: Smi,
actualDeleteCountNumber: Number): JSAny
labels Bailout {
const originalLength: Smi =
Cast<Smi>(originalLengthNumber) otherwise Bailout;
const originalLength: Smi = Cast<Smi>(originalLengthNumber) otherwise Bailout;
const actualStart: Smi = Cast<Smi>(actualStartNumber) otherwise Bailout;
const actualDeleteCount: Smi =
Cast<Smi>(actualDeleteCountNumber) otherwise Bailout;
......@@ -185,9 +182,9 @@ namespace array {
}
return deletedResult;
}
}
transitioning macro FillDeletedElementsArray(
transitioning macro FillDeletedElementsArray(
context: Context, o: JSReceiver, actualStart: Number,
actualDeleteCount: Number, a: JSReceiver): JSAny {
// 10. Let k be 0.
......@@ -216,11 +213,11 @@ namespace array {
// 12. Perform ? Set(A, "length", actualDeleteCount, true).
SetProperty(a, kLengthString, actualDeleteCount);
return a;
}
}
// HandleForwardCase implements step 15. "If itemCount < actualDeleteCount,
// then...""
transitioning macro HandleForwardCase(
// HandleForwardCase implements step 15. "If itemCount < actualDeleteCount,
// then...""
transitioning macro HandleForwardCase(
context: Context, o: JSReceiver, len: Number, itemCount: Number,
actualStart: Number, actualDeleteCount: Number): void {
// 15. If itemCount < actualDeleteCount, then
......@@ -264,11 +261,11 @@ namespace array {
// ii. Decrease k by 1.
k--;
}
}
}
// HandleBackwardCase implements step 16. "Else if itemCount >
// actualDeleteCount, then..."
transitioning macro HandleBackwardCase(
// HandleBackwardCase implements step 16. "Else if itemCount >
// actualDeleteCount, then..."
transitioning macro HandleBackwardCase(
context: Context, o: JSReceiver, len: Number, itemCount: Number,
actualStart: Number, actualDeleteCount: Number): void {
// 16. Else if itemCount > actualDeleteCount, then
......@@ -303,9 +300,9 @@ namespace array {
// vi. Decrease k by 1.
k--;
}
}
}
transitioning macro SlowSplice(
transitioning macro SlowSplice(
context: Context, arguments: Arguments, o: JSReceiver, len: Number,
actualStart: Number, insertCount: Smi, actualDeleteCount: Number): JSAny {
// 9. Let A be ? ArraySpeciesCreate(O, actualDeleteCount).
......@@ -354,12 +351,12 @@ namespace array {
SetProperty(o, kLengthString, len - actualDeleteCount + itemCount);
return a;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.splice
transitioning javascript builtin
ArrayPrototypeSplice(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.splice
transitioning javascript builtin
ArrayPrototypeSplice(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// 1. Let O be ? ToObject(this value).
const o: JSReceiver = ToObject(context, receiver);
......@@ -411,14 +408,13 @@ namespace array {
try {
return FastArraySplice(
context, arguments, o, len, actualStart, insertCount,
actualDeleteCount) otherwise Bailout;
context, arguments, o, len, actualStart, insertCount, actualDeleteCount)
otherwise Bailout;
} label Bailout {}
// If the fast case fails, just continue with the slow, correct,
// spec-compliant case.
return SlowSplice(
context, arguments, o, len, actualStart, insertCount,
actualDeleteCount);
}
context, arguments, o, len, actualStart, insertCount, actualDeleteCount);
}
}
......@@ -3,9 +3,9 @@
// found in the LICENSE file.
namespace array {
extern builtin ArrayUnshift(Context, JSFunction, JSAny, int32): JSAny;
extern builtin ArrayUnshift(Context, JSFunction, JSAny, int32): JSAny;
transitioning macro GenericArrayUnshift(
transitioning macro GenericArrayUnshift(
context: Context, receiver: JSAny, arguments: Arguments): Number {
// 1. Let O be ? ToObject(this value).
const object: JSReceiver = ToObject_Inline(context, receiver);
......@@ -74,12 +74,11 @@ namespace array {
// 6. Return length + argCount.
return newLength;
}
}
// https://tc39.github.io/ecma262/#sec-array.prototype.unshift
transitioning javascript builtin ArrayPrototypeUnshift(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// https://tc39.github.io/ecma262/#sec-array.prototype.unshift
transitioning javascript builtin ArrayPrototypeUnshift(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
try {
const array: FastJSArray = Cast<FastJSArray>(receiver) otherwise Slow;
array::EnsureWriteableFastElements(array);
......@@ -94,5 +93,5 @@ namespace array {
} label Slow {
return GenericArrayUnshift(context, receiver, arguments);
}
}
}
}
......@@ -5,18 +5,18 @@
#include 'src/builtins/builtins-array-gen.h'
namespace array {
// Naming convention from elements.cc. We have a similar intent but implement
// fastpaths using generics instead of using a class hierarchy for elements
// kinds specific implementations.
type GenericElementsAccessor extends ElementsKind;
type FastPackedSmiElements extends ElementsKind;
type FastPackedObjectElements extends ElementsKind;
type FastPackedDoubleElements extends ElementsKind;
type FastSmiOrObjectElements extends ElementsKind;
type FastDoubleElements extends ElementsKind;
type DictionaryElements extends ElementsKind;
macro EnsureWriteableFastElements(implicit context: Context)(array: JSArray) {
// Naming convention from elements.cc. We have a similar intent but implement
// fastpaths using generics instead of using a class hierarchy for elements
// kinds specific implementations.
type GenericElementsAccessor extends ElementsKind;
type FastPackedSmiElements extends ElementsKind;
type FastPackedObjectElements extends ElementsKind;
type FastPackedDoubleElements extends ElementsKind;
type FastSmiOrObjectElements extends ElementsKind;
type FastDoubleElements extends ElementsKind;
type DictionaryElements extends ElementsKind;
macro EnsureWriteableFastElements(implicit context: Context)(array: JSArray) {
assert(IsFastElementsKind(array.map.elements_kind));
const elements: FixedArrayBase = array.elements;
......@@ -26,41 +26,40 @@ namespace array {
// extract FixedArrays and don't have to worry about FixedDoubleArrays.
assert(IsFastSmiOrTaggedElementsKind(array.map.elements_kind));
const length =
Convert<intptr>(Cast<Smi>(array.length) otherwise unreachable);
const length = Convert<intptr>(Cast<Smi>(array.length) otherwise unreachable);
array.elements =
ExtractFixedArray(UnsafeCast<FixedArray>(elements), 0, length, length);
assert(array.elements.map != kCOWMap);
}
}
macro LoadElementOrUndefined(implicit context:
Context)(a: FixedArray, i: Smi): JSAny {
macro LoadElementOrUndefined(implicit context: Context)(
a: FixedArray, i: Smi): JSAny {
const e = UnsafeCast<(JSAny | TheHole)>(a.objects[i]);
return ReplaceTheHoleWithUndefined(e);
}
}
macro LoadElementOrUndefined(a: FixedDoubleArray, i: Smi): NumberOrUndefined {
macro LoadElementOrUndefined(a: FixedDoubleArray, i: Smi): NumberOrUndefined {
const f: float64 = a.floats[i].Value() otherwise return Undefined;
return AllocateHeapNumberWithValue(f);
}
}
macro StoreArrayHole(elements: FixedDoubleArray, k: Smi): void {
macro StoreArrayHole(elements: FixedDoubleArray, k: Smi): void {
elements.floats[k] = kDoubleHole;
}
}
macro StoreArrayHole(elements: FixedArray, k: Smi): void {
macro StoreArrayHole(elements: FixedArray, k: Smi): void {
elements.objects[k] = TheHole;
}
}
extern macro SetPropertyLength(implicit context: Context)(JSAny, Number);
extern macro SetPropertyLength(implicit context: Context)(JSAny, Number);
const kLengthDescriptorIndex:
const kLengthDescriptorIndex:
constexpr int31 generates 'JSArray::kLengthDescriptorIndex';
const kAttributesReadOnlyMask: constexpr int31
const kAttributesReadOnlyMask: constexpr int31
generates 'PropertyDetails::kAttributesReadOnlyMask';
@export
macro EnsureArrayLengthWritable(implicit context: Context)(map: Map):
@export
macro EnsureArrayLengthWritable(implicit context: Context)(map: Map):
void labels Bailout {
// Don't support arrays in dictionary named property mode.
if (IsDictionaryMap(map)) {
......@@ -78,14 +77,13 @@ namespace array {
if ((details & kAttributesReadOnlyMask) != 0) {
goto Bailout;
}
}
}
macro CreateJSArrayWithElements(implicit context: Context)(array: FixedArray):
macro CreateJSArrayWithElements(implicit context: Context)(array: FixedArray):
JSArray {
const nativeContext: NativeContext = LoadNativeContext(context);
const map: Map =
LoadJSArrayElementsMap(ElementsKind::PACKED_ELEMENTS, nativeContext);
return AllocateJSArray(map, array, array.length);
}
}
}
......@@ -1513,8 +1513,8 @@ extern transitioning runtime
CreateDataProperty(implicit context: Context)(JSReceiver, JSAny, JSAny);
namespace runtime {
extern runtime
GetDerivedMap(Context, JSFunction, JSReceiver): Map;
extern runtime
GetDerivedMap(Context, JSFunction, JSReceiver): Map;
}
transitioning builtin FastCreateDataProperty(implicit context: Context)(
......
......@@ -23,27 +23,27 @@ Convert<BigInt, MutableBigInt>(i: MutableBigInt): BigInt {
namespace bigint {
const kPositiveSign: uint32 = 0;
const kNegativeSign: uint32 = 1;
const kPositiveSign: uint32 = 0;
const kNegativeSign: uint32 = 1;
extern macro BigIntBuiltinsAssembler::CppAbsoluteAddAndCanonicalize(
extern macro BigIntBuiltinsAssembler::CppAbsoluteAddAndCanonicalize(
MutableBigInt, BigIntBase, BigIntBase): void;
extern macro BigIntBuiltinsAssembler::CppAbsoluteSubAndCanonicalize(
extern macro BigIntBuiltinsAssembler::CppAbsoluteSubAndCanonicalize(
MutableBigInt, BigIntBase, BigIntBase): void;
extern macro BigIntBuiltinsAssembler::CppAbsoluteCompare(
extern macro BigIntBuiltinsAssembler::CppAbsoluteCompare(
BigIntBase, BigIntBase): int32;
extern macro BigIntBuiltinsAssembler::ReadBigIntSign(BigIntBase): uint32;
extern macro BigIntBuiltinsAssembler::ReadBigIntLength(BigIntBase): intptr;
extern macro BigIntBuiltinsAssembler::WriteBigIntSignAndLength(
extern macro BigIntBuiltinsAssembler::ReadBigIntSign(BigIntBase): uint32;
extern macro BigIntBuiltinsAssembler::ReadBigIntLength(BigIntBase): intptr;
extern macro BigIntBuiltinsAssembler::WriteBigIntSignAndLength(
MutableBigInt, uint32, intptr): void;
extern macro CodeStubAssembler::AllocateBigInt(intptr): MutableBigInt;
extern macro CodeStubAssembler::StoreBigIntDigit(
extern macro CodeStubAssembler::AllocateBigInt(intptr): MutableBigInt;
extern macro CodeStubAssembler::StoreBigIntDigit(
MutableBigInt, intptr, uintptr): void;
extern macro CodeStubAssembler::LoadBigIntDigit(BigIntBase, intptr): uintptr;
extern macro CodeStubAssembler::LoadBigIntDigit(BigIntBase, intptr): uintptr;
macro IsCanonicalized(bigint: BigIntBase): bool {
macro IsCanonicalized(bigint: BigIntBase): bool {
const length = ReadBigIntLength(bigint);
if (length == 0) {
......@@ -51,13 +51,13 @@ namespace bigint {
}
return LoadBigIntDigit(bigint, length - 1) != 0;
}
}
macro InvertSign(sign: uint32): uint32 {
macro InvertSign(sign: uint32): uint32 {
return sign == kPositiveSign ? kNegativeSign : kPositiveSign;
}
}
macro AllocateEmptyBigIntNoThrow(implicit context: Context)(
macro AllocateEmptyBigIntNoThrow(implicit context: Context)(
sign: uint32, length: intptr): MutableBigInt labels BigIntTooBig {
if (length > kBigIntMaxLength) {
goto BigIntTooBig;
......@@ -66,22 +66,22 @@ namespace bigint {
WriteBigIntSignAndLength(result, sign, length);
return result;
}
}
macro AllocateEmptyBigInt(implicit context: Context)(
macro AllocateEmptyBigInt(implicit context: Context)(
sign: uint32, length: intptr): MutableBigInt {
try {
return AllocateEmptyBigIntNoThrow(sign, length) otherwise BigIntTooBig;
} label BigIntTooBig {
ThrowRangeError(MessageTemplate::kBigIntTooBig);
}
}
}
macro MutableBigIntAbsoluteCompare(x: BigIntBase, y: BigIntBase): int32 {
macro MutableBigIntAbsoluteCompare(x: BigIntBase, y: BigIntBase): int32 {
return CppAbsoluteCompare(x, y);
}
}
macro MutableBigIntAbsoluteSub(implicit context: Context)(
macro MutableBigIntAbsoluteSub(implicit context: Context)(
x: BigInt, y: BigInt, resultSign: uint32): BigInt {
const xlength = ReadBigIntLength(x);
const ylength = ReadBigIntLength(y);
......@@ -100,9 +100,9 @@ namespace bigint {
const result = AllocateEmptyBigInt(resultSign, xlength);
CppAbsoluteSubAndCanonicalize(result, x, y);
return Convert<BigInt>(result);
}
}
macro MutableBigIntAbsoluteAdd(implicit context: Context)(
macro MutableBigIntAbsoluteAdd(implicit context: Context)(
xBigint: BigInt, yBigint: BigInt,
resultSign: uint32): BigInt labels BigIntTooBig {
let xlength = ReadBigIntLength(xBigint);
......@@ -135,9 +135,9 @@ namespace bigint {
otherwise BigIntTooBig;
CppAbsoluteAddAndCanonicalize(result, x, y);
return Convert<BigInt>(result);
}
}
macro BigIntAddImpl(implicit context: Context)(x: BigInt, y: BigInt): BigInt
macro BigIntAddImpl(implicit context: Context)(x: BigInt, y: BigInt): BigInt
labels BigIntTooBig {
const xsign = ReadBigIntSign(x);
const ysign = ReadBigIntSign(y);
......@@ -153,20 +153,20 @@ namespace bigint {
return MutableBigIntAbsoluteSub(x, y, xsign);
}
return MutableBigIntAbsoluteSub(y, x, InvertSign(xsign));
}
}
builtin BigIntAddNoThrow(implicit context: Context)(x: BigInt, y: BigInt):
Numeric {
builtin BigIntAddNoThrow(implicit context: Context)(
x: BigInt, y: BigInt): Numeric {
try {
return BigIntAddImpl(x, y) otherwise BigIntTooBig;
} label BigIntTooBig {
// Smi sentinal is used to signal BigIntTooBig exception.
return Convert<Smi>(0);
}
}
}
builtin BigIntAdd(implicit context: Context)(xNum: Numeric, yNum: Numeric):
BigInt {
builtin BigIntAdd(implicit context: Context)(
xNum: Numeric, yNum: Numeric): BigInt {
try {
const x = Cast<BigInt>(xNum) otherwise MixedTypes;
const y = Cast<BigInt>(yNum) otherwise MixedTypes;
......@@ -177,10 +177,10 @@ namespace bigint {
} label BigIntTooBig {
ThrowRangeError(MessageTemplate::kBigIntTooBig);
}
}
}
macro BigIntSubtractImpl(implicit context: Context)(x: BigInt, y: BigInt):
BigInt labels BigIntTooBig {
macro BigIntSubtractImpl(implicit context: Context)(
x: BigInt, y: BigInt): BigInt labels BigIntTooBig {
const xsign = ReadBigIntSign(x);
const ysign = ReadBigIntSign(y);
if (xsign != ysign) {
......@@ -195,20 +195,20 @@ namespace bigint {
return MutableBigIntAbsoluteSub(x, y, xsign);
}
return MutableBigIntAbsoluteSub(y, x, InvertSign(xsign));
}
}
builtin BigIntSubtractNoThrow(implicit context:
Context)(x: BigInt, y: BigInt): Numeric {
builtin BigIntSubtractNoThrow(implicit context: Context)(
x: BigInt, y: BigInt): Numeric {
try {
return BigIntSubtractImpl(x, y) otherwise BigIntTooBig;
} label BigIntTooBig {
// Smi sentinal is used to signal BigIntTooBig exception.
return Convert<Smi>(0);
}
}
}
builtin BigIntSubtract(implicit context:
Context)(xNum: Numeric, yNum: Numeric): BigInt {
builtin BigIntSubtract(implicit context: Context)(
xNum: Numeric, yNum: Numeric): BigInt {
try {
const x = Cast<BigInt>(xNum) otherwise MixedTypes;
const y = Cast<BigInt>(yNum) otherwise MixedTypes;
......@@ -219,9 +219,9 @@ namespace bigint {
} label BigIntTooBig {
ThrowRangeError(MessageTemplate::kBigIntTooBig);
}
}
}
builtin BigIntUnaryMinus(implicit context: Context)(bigint: BigInt): BigInt {
builtin BigIntUnaryMinus(implicit context: Context)(bigint: BigInt): BigInt {
const length = ReadBigIntLength(bigint);
// There is no -0n.
......@@ -235,6 +235,6 @@ namespace bigint {
StoreBigIntDigit(result, i, LoadBigIntDigit(bigint, i));
}
return Convert<BigInt>(result);
}
}
} // namespace bigint
......@@ -3,14 +3,14 @@
// found in the LICENSE file.
namespace boolean {
transitioning macro ThisBooleanValue(implicit context: Context)(
transitioning macro ThisBooleanValue(implicit context: Context)(
receiver: JSAny, method: constexpr string): Boolean {
return UnsafeCast<Boolean>(
ToThisValue(receiver, PrimitiveType::kBoolean, method));
}
}
javascript builtin
BooleanConstructor(
javascript builtin
BooleanConstructor(
js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny,
target: JSFunction)(...arguments): JSAny {
const value = SelectBooleanConstant(ToBoolean(arguments[0]));
......@@ -25,21 +25,21 @@ namespace boolean {
UnsafeCast<JSPrimitiveWrapper>(AllocateFastOrSlowJSObjectFromMap(map));
obj.value = value;
return obj;
}
}
// ES #sec-boolean.prototype.tostring
transitioning javascript builtin BooleanPrototypeToString(
// ES #sec-boolean.prototype.tostring
transitioning javascript builtin BooleanPrototypeToString(
js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
// 1. Let b be ? thisBooleanValue(this value).
const b = ThisBooleanValue(receiver, 'Boolean.prototype.toString');
// 2. If b is true, return "true"; else return "false".
return b.to_string;
}
}
// ES #sec-boolean.prototype.valueof
transitioning javascript builtin BooleanPrototypeValueOf(
// ES #sec-boolean.prototype.valueof
transitioning javascript builtin BooleanPrototypeValueOf(
js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
// 1. Return ? thisBooleanValue(this value).
return ThisBooleanValue(receiver, 'Boolean.prototype.valueOf');
}
}
}
......@@ -5,32 +5,32 @@
#include 'src/builtins/builtins-string-gen.h'
namespace string {
extern macro StringBuiltinsAssembler::SubString(String, uintptr, uintptr):
String;
extern macro StringBuiltinsAssembler::SubString(
String, uintptr, uintptr): String;
// ES6 #sec-string.prototype.tostring
transitioning javascript builtin
StringPrototypeToString(
// ES6 #sec-string.prototype.tostring
transitioning javascript builtin
StringPrototypeToString(
js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
return ToThisValue(
receiver, PrimitiveType::kString, 'String.prototype.toString');
}
}
// ES6 #sec-string.prototype.valueof
transitioning javascript builtin
StringPrototypeValueOf(js-implicit context: NativeContext, receiver: JSAny)():
JSAny {
// ES6 #sec-string.prototype.valueof
transitioning javascript builtin
StringPrototypeValueOf(
js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
return ToThisValue(
receiver, PrimitiveType::kString, 'String.prototype.valueOf');
}
}
extern macro StringBuiltinsAssembler::LoadSurrogatePairAt(
extern macro StringBuiltinsAssembler::LoadSurrogatePairAt(
String, intptr, intptr, constexpr UnicodeEncoding): int32;
extern macro StringBuiltinsAssembler::StringFromSingleUTF16EncodedCodePoint(
extern macro StringBuiltinsAssembler::StringFromSingleUTF16EncodedCodePoint(
int32): String;
// This function assumes StringPrimitiveWithNoCustomIteration is true.
transitioning builtin StringToList(implicit context: Context)(string: String):
// This function assumes StringPrimitiveWithNoCustomIteration is true.
transitioning builtin StringToList(implicit context: Context)(string: String):
JSArray {
const kind = ElementsKind::PACKED_ELEMENTS;
const stringLength: intptr = string.length_intptr;
......@@ -57,12 +57,12 @@ namespace string {
array.length = arrayLength;
return array;
}
}
transitioning macro GenerateStringAt(implicit context: Context)(
transitioning macro GenerateStringAt(implicit context: Context)(
receiver: JSAny, position: JSAny,
methodName: constexpr string): never labels
IfInBounds(String, uintptr, uintptr), IfOutOfBounds {
IfInBounds(String, uintptr, uintptr), IfOutOfBounds {
// 1. Let O be ? RequireObjectCoercible(this value).
// 2. Let S be ? ToString(O).
const string: String = ToThisString(receiver, methodName);
......@@ -91,10 +91,10 @@ namespace string {
goto IfOutOfBounds;
}
}
}
}
// ES6 #sec-string.prototype.charat
transitioning javascript builtin StringPrototypeCharAt(
// ES6 #sec-string.prototype.charat
transitioning javascript builtin StringPrototypeCharAt(
js-implicit context: NativeContext,
receiver: JSAny)(position: JSAny): JSAny {
try {
......@@ -106,10 +106,10 @@ namespace string {
} label IfOutOfBounds {
return kEmptyString;
}
}
}
// ES6 #sec-string.prototype.charcodeat
transitioning javascript builtin StringPrototypeCharCodeAt(
// ES6 #sec-string.prototype.charcodeat
transitioning javascript builtin StringPrototypeCharCodeAt(
js-implicit context: NativeContext,
receiver: JSAny)(position: JSAny): JSAny {
try {
......@@ -121,10 +121,10 @@ namespace string {
} label IfOutOfBounds {
return kNaN;
}
}
}
// ES6 #sec-string.prototype.codepointat
transitioning javascript builtin StringPrototypeCodePointAt(
// ES6 #sec-string.prototype.codepointat
transitioning javascript builtin StringPrototypeCodePointAt(
js-implicit context: NativeContext,
receiver: JSAny)(position: JSAny): JSAny {
try {
......@@ -139,13 +139,12 @@ namespace string {
} label IfOutOfBounds {
return Undefined;
}
}
}
// ES6 String.prototype.concat(...args)
// ES6 #sec-string.prototype.concat
transitioning javascript builtin StringPrototypeConcat(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
// ES6 String.prototype.concat(...args)
// ES6 #sec-string.prototype.concat
transitioning javascript builtin StringPrototypeConcat(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// Check that {receiver} is coercible to Object and convert it to a String.
let string: String = ToThisString(receiver, 'String.prototype.concat');
......@@ -156,14 +155,14 @@ namespace string {
string = string + temp;
}
return string;
}
}
extern transitioning runtime
SymbolDescriptiveString(implicit context: Context)(Symbol): String;
extern transitioning runtime
SymbolDescriptiveString(implicit context: Context)(Symbol): String;
// ES #sec-string-constructor
// https://tc39.github.io/ecma262/#sec-string-constructor
transitioning javascript builtin StringConstructor(
// ES #sec-string-constructor
// https://tc39.github.io/ecma262/#sec-string-constructor
transitioning javascript builtin StringConstructor(
js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny,
target: JSFunction)(...arguments): JSAny {
const length: intptr = Convert<intptr>(arguments.length);
......@@ -198,23 +197,23 @@ namespace string {
UnsafeCast<JSPrimitiveWrapper>(AllocateFastOrSlowJSObjectFromMap(map));
obj.value = s;
return obj;
}
}
transitioning builtin StringAddConvertLeft(implicit context: Context)(
transitioning builtin StringAddConvertLeft(implicit context: Context)(
left: JSAny, right: String): String {
return ToStringImpl(context, ToPrimitiveDefault(left)) + right;
}
}
transitioning builtin StringAddConvertRight(implicit context: Context)(
transitioning builtin StringAddConvertRight(implicit context: Context)(
left: String, right: JSAny): String {
return left + ToStringImpl(context, ToPrimitiveDefault(right));
}
}
builtin StringCharAt(implicit context: Context)(
builtin StringCharAt(implicit context: Context)(
receiver: String, position: uintptr): String {
// Load the character code at the {position} from the {receiver}.
const code: int32 = StringCharCodeAt(receiver, position);
// And return the single character string with only that {code}
return StringFromSingleCharCode(code);
}
}
}
......@@ -5,8 +5,8 @@
#include 'src/builtins/builtins-collections-gen.h'
namespace collections {
@export
macro LoadKeyValuePairNoSideEffects(implicit context: Context)(o: JSAny):
@export
macro LoadKeyValuePairNoSideEffects(implicit context: Context)(o: JSAny):
KeyValuePair labels MayHaveSideEffects {
typeswitch (o) {
case (a: FastJSArray): {
......@@ -40,10 +40,10 @@ namespace collections {
ThrowTypeError(MessageTemplate::kIteratorValueNotAnObject, o);
}
}
}
}
@export
transitioning macro LoadKeyValuePair(implicit context: Context)(o: JSAny):
@export
transitioning macro LoadKeyValuePair(implicit context: Context)(o: JSAny):
KeyValuePair {
try {
return LoadKeyValuePairNoSideEffects(o) otherwise Generic;
......@@ -53,5 +53,5 @@ namespace collections {
value: GetProperty(o, Convert<Smi>(1))
};
}
}
}
}
......@@ -3,10 +3,10 @@
// found in the LICENSE file.
namespace console {
extern builtin ConsoleAssert(implicit context:
Context)(JSFunction, JSAny, int32): JSAny;
extern builtin ConsoleAssert(implicit context: Context)(
JSFunction, JSAny, int32): JSAny;
javascript builtin FastConsoleAssert(
javascript builtin FastConsoleAssert(
js-implicit context: NativeContext, receiver: JSAny, newTarget: JSAny,
target: JSFunction)(...arguments): JSAny {
if (ToBoolean(arguments[0])) {
......@@ -14,5 +14,5 @@ namespace console {
} else {
tail ConsoleAssert(target, newTarget, Convert<int32>(arguments.length));
}
}
}
}
This diff is collapsed.
......@@ -3,17 +3,17 @@
// found in the LICENSE file.
namespace runtime {
extern runtime
ShrinkFinalizationRegistryUnregisterTokenMap(Context, JSFinalizationRegistry):
void;
extern runtime
ShrinkFinalizationRegistryUnregisterTokenMap(
Context, JSFinalizationRegistry): void;
}
namespace weakref {
extern transitioning macro
RemoveFinalizationRegistryCellFromUnregisterTokenMap(
extern transitioning macro
RemoveFinalizationRegistryCellFromUnregisterTokenMap(
JSFinalizationRegistry, WeakCell): void;
macro SplitOffTail(weakCell: WeakCell): WeakCell|Undefined {
macro SplitOffTail(weakCell: WeakCell): WeakCell|Undefined {
const weakCellTail = weakCell.next;
weakCell.next = Undefined;
typeswitch (weakCellTail) {
......@@ -25,11 +25,11 @@ namespace weakref {
}
}
return weakCellTail;
}
}
transitioning macro
PopClearedCell(finalizationRegistry: JSFinalizationRegistry): WeakCell
|Undefined {
transitioning macro
PopClearedCell(finalizationRegistry: JSFinalizationRegistry): WeakCell|
Undefined {
typeswitch (finalizationRegistry.cleared_cells) {
case (Undefined): {
return Undefined;
......@@ -50,10 +50,10 @@ namespace weakref {
return weakCell;
}
}
}
}
transitioning macro
FinalizationRegistryCleanupLoop(implicit context: Context)(
transitioning macro
FinalizationRegistryCleanupLoop(implicit context: Context)(
finalizationRegistry: JSFinalizationRegistry, callback: Callable) {
while (true) {
const weakCellHead = PopClearedCell(finalizationRegistry);
......@@ -75,12 +75,11 @@ namespace weakref {
runtime::ShrinkFinalizationRegistryUnregisterTokenMap(
context, finalizationRegistry);
}
}
transitioning javascript builtin
FinalizationRegistryPrototypeCleanupSome(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): JSAny {
transitioning javascript builtin
FinalizationRegistryPrototypeCleanupSome(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
// 1. Let finalizationRegistry be the this value.
//
// 2. Perform ? RequireInternalSlot(finalizationRegistry, [[Cells]]).
......@@ -102,5 +101,5 @@ namespace weakref {
FinalizationRegistryCleanupLoop(finalizationRegistry, callback);
return Undefined;
}
}
}
......@@ -3,8 +3,8 @@
// found in the LICENSE file.
namespace growable_fixed_array {
// TODO(pwong): Support FixedTypedArrays.
struct GrowableFixedArray {
// TODO(pwong): Support FixedTypedArrays.
struct GrowableFixedArray {
macro Push(obj: Object) {
this.EnsureCapacity();
this.array.objects[this.length++] = obj;
......@@ -42,9 +42,9 @@ namespace growable_fixed_array {
// TODO(v8:4153): make capacity and length uintptr
capacity: intptr;
length: intptr;
}
}
macro NewGrowableFixedArray(): GrowableFixedArray {
macro NewGrowableFixedArray(): GrowableFixedArray {
return GrowableFixedArray{array: kEmptyFixedArray, capacity: 0, length: 0};
}
}
}
......@@ -4,24 +4,24 @@
namespace ic_callable {
extern macro IncrementCallCount(FeedbackVector, uintptr): void;
extern macro IncrementCallCount(FeedbackVector, uintptr): void;
macro IsMonomorphic(feedback: MaybeObject, target: JSAny): bool {
macro IsMonomorphic(feedback: MaybeObject, target: JSAny): bool {
return IsWeakReferenceToObject(feedback, target);
}
}
macro InSameNativeContext(lhs: Context, rhs: Context): bool {
macro InSameNativeContext(lhs: Context, rhs: Context): bool {
return LoadNativeContext(lhs) == LoadNativeContext(rhs);
}
}
macro MaybeObjectToStrong(maybeObject: MaybeObject):
macro MaybeObjectToStrong(maybeObject: MaybeObject):
HeapObject labels IfCleared {
assert(IsWeakOrCleared(maybeObject));
const weakObject = %RawDownCast<Weak<HeapObject>>(maybeObject);
return WeakToStrong(weakObject) otherwise IfCleared;
}
}
macro TryInitializeAsMonomorphic(implicit context: Context)(
macro TryInitializeAsMonomorphic(implicit context: Context)(
maybeTarget: JSAny, feedbackVector: FeedbackVector,
slotId: uintptr): void labels TransitionToMegamorphic {
const targetHeapObject =
......@@ -42,16 +42,16 @@ namespace ic_callable {
ic::StoreWeakReferenceInFeedbackVector(
feedbackVector, slotId, targetHeapObject);
ic::ReportFeedbackUpdate(feedbackVector, slotId, 'Call:Initialize');
}
}
macro TransitionToMegamorphic(implicit context: Context)(
macro TransitionToMegamorphic(implicit context: Context)(
feedbackVector: FeedbackVector, slotId: uintptr): void {
ic::StoreFeedbackVectorSlot(feedbackVector, slotId, ic::kMegamorphicSymbol);
ic::ReportFeedbackUpdate(
feedbackVector, slotId, 'Call:TransitionMegamorphic');
}
}
macro CollectCallFeedback(
macro CollectCallFeedback(
maybeTarget: JSAny, context: Context,
maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
const feedbackVector =
......@@ -87,17 +87,16 @@ namespace ic_callable {
ic::StoreWeakReferenceInFeedbackVector(
feedbackVector, slotId, feedbackCell);
ic::ReportFeedbackUpdate(
feedbackVector, slotId, 'Call:FeedbackVectorCell');
ic::ReportFeedbackUpdate(feedbackVector, slotId, 'Call:FeedbackVectorCell');
} label TryInitializeAsMonomorphic {
TryInitializeAsMonomorphic(maybeTarget, feedbackVector, slotId)
otherwise TransitionToMegamorphic;
} label TransitionToMegamorphic {
TransitionToMegamorphic(feedbackVector, slotId);
}
}
}
macro CollectInstanceOfFeedback(
macro CollectInstanceOfFeedback(
maybeTarget: JSAny, context: Context,
maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
const feedbackVector =
......@@ -122,6 +121,6 @@ namespace ic_callable {
} label TransitionToMegamorphic {
TransitionToMegamorphic(feedbackVector, slotId);
}
}
}
} // namespace ic_callable
......@@ -4,45 +4,44 @@
namespace ic {
// --- The public interface (forwards to the actual implementation).
// --- The public interface (forwards to the actual implementation).
@export
macro CollectCallFeedback(
@export
macro CollectCallFeedback(
maybeTarget: JSAny, context: Context,
maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
ic_callable::CollectCallFeedback(
maybeTarget, context, maybeFeedbackVector, slotId);
}
}
@export
macro CollectInstanceOfFeedback(
@export
macro CollectInstanceOfFeedback(
maybeTarget: JSAny, context: Context,
maybeFeedbackVector: Undefined|FeedbackVector, slotId: uintptr): void {
ic_callable::CollectInstanceOfFeedback(
maybeTarget, context, maybeFeedbackVector, slotId);
}
}
// --- Common functionality.
// --- Common functionality.
extern macro MegamorphicSymbolConstant(): Symbol;
extern macro UninitializedSymbolConstant(): Symbol;
extern macro MegamorphicSymbolConstant(): Symbol;
extern macro UninitializedSymbolConstant(): Symbol;
const kMegamorphicSymbol: Symbol = MegamorphicSymbolConstant();
const kUninitializedSymbol: Symbol = UninitializedSymbolConstant();
const kMegamorphicSymbol: Symbol = MegamorphicSymbolConstant();
const kUninitializedSymbol: Symbol = UninitializedSymbolConstant();
macro IsMegamorphic(feedback: MaybeObject): bool {
macro IsMegamorphic(feedback: MaybeObject): bool {
return TaggedEqual(feedback, kMegamorphicSymbol);
}
}
macro IsUninitialized(feedback: MaybeObject): bool {
macro IsUninitialized(feedback: MaybeObject): bool {
return TaggedEqual(feedback, kUninitializedSymbol);
}
}
extern macro LoadFeedbackVectorSlot(FeedbackVector, uintptr): MaybeObject;
extern macro StoreFeedbackVectorSlot(FeedbackVector, uintptr, MaybeObject):
void;
extern macro StoreWeakReferenceInFeedbackVector(
extern macro LoadFeedbackVectorSlot(FeedbackVector, uintptr): MaybeObject;
extern macro StoreFeedbackVectorSlot(
FeedbackVector, uintptr, MaybeObject): void;
extern macro StoreWeakReferenceInFeedbackVector(
FeedbackVector, uintptr, HeapObject): MaybeObject;
extern macro ReportFeedbackUpdate(FeedbackVector, uintptr, constexpr string);
extern macro ReportFeedbackUpdate(FeedbackVector, uintptr, constexpr string);
}
......@@ -6,7 +6,7 @@
namespace internal_coverage {
macro GetCoverageInfo(implicit context: Context)(function: JSFunction):
macro GetCoverageInfo(implicit context: Context)(function: JSFunction):
CoverageInfo labels IfNoCoverageInfo {
const shared: SharedFunctionInfo = function.shared_function_info;
const debugInfo = Cast<DebugInfo>(shared.script_or_debug_info)
......@@ -14,16 +14,17 @@ namespace internal_coverage {
if (!debugInfo.flags.has_coverage_info) goto IfNoCoverageInfo;
return UnsafeCast<CoverageInfo>(debugInfo.coverage_info);
}
}
macro IncrementBlockCount(implicit context: Context)(
macro IncrementBlockCount(implicit context: Context)(
coverageInfo: CoverageInfo, slot: Smi) {
assert(Convert<int32>(slot) < coverageInfo.slot_count);
++coverageInfo.slots[slot].block_count;
}
}
builtin IncBlockCounter(implicit context: Context)(
function: JSFunction, coverageArraySlotIndex: Smi): Undefined {
builtin IncBlockCounter(
implicit context:
Context)(function: JSFunction, coverageArraySlotIndex: Smi): Undefined {
// It's quite possible that a function contains IncBlockCounter bytecodes,
// but no coverage info exists. This happens e.g. by selecting the
// best-effort coverage collection mode, which triggers deletion of all
......@@ -33,6 +34,6 @@ namespace internal_coverage {
GetCoverageInfo(function) otherwise return Undefined;
IncrementBlockCount(coverageInfo, coverageArraySlotIndex);
return Undefined;
}
}
} // namespace internal_coverage
......@@ -5,50 +5,50 @@
#include 'src/builtins/builtins-iterator-gen.h'
namespace iterator {
// Returned from IteratorBuiltinsAssembler::GetIterator().
@export
struct IteratorRecord {
// Returned from IteratorBuiltinsAssembler::GetIterator().
@export
struct IteratorRecord {
// iteratorRecord.[[Iterator]]
object: JSReceiver;
// iteratorRecord.[[NextMethod]]
next: JSAny;
}
}
extern macro IteratorBuiltinsAssembler::FastIterableToList(
extern macro IteratorBuiltinsAssembler::FastIterableToList(
implicit context: Context)(JSAny): JSArray labels Slow;
extern macro IteratorBuiltinsAssembler::GetIteratorMethod(
extern macro IteratorBuiltinsAssembler::GetIteratorMethod(
implicit context: Context)(JSAny): JSAny;
extern macro IteratorBuiltinsAssembler::GetIterator(
implicit context: Context)(JSAny): IteratorRecord;
extern macro IteratorBuiltinsAssembler::GetIterator(
implicit context: Context)(JSAny, JSAny): IteratorRecord;
extern macro IteratorBuiltinsAssembler::GetIterator(implicit context: Context)(
JSAny): IteratorRecord;
extern macro IteratorBuiltinsAssembler::GetIterator(implicit context: Context)(
JSAny, JSAny): IteratorRecord;
extern macro IteratorBuiltinsAssembler::IteratorStep(
implicit context: Context)(IteratorRecord): JSReceiver
extern macro IteratorBuiltinsAssembler::IteratorStep(implicit context: Context)(
IteratorRecord): JSReceiver
labels Done;
extern macro IteratorBuiltinsAssembler::IteratorStep(
implicit context: Context)(IteratorRecord, Map): JSReceiver
extern macro IteratorBuiltinsAssembler::IteratorStep(implicit context: Context)(
IteratorRecord, Map): JSReceiver
labels Done;
extern macro IteratorBuiltinsAssembler::IteratorValue(
extern macro IteratorBuiltinsAssembler::IteratorValue(
implicit context: Context)(JSReceiver): JSAny;
extern macro IteratorBuiltinsAssembler::IteratorValue(
extern macro IteratorBuiltinsAssembler::IteratorValue(
implicit context: Context)(JSReceiver, Map): JSAny;
extern macro IteratorBuiltinsAssembler::IterableToList(
extern macro IteratorBuiltinsAssembler::IterableToList(
implicit context: Context)(JSAny, JSAny): JSArray;
extern macro IteratorBuiltinsAssembler::StringListFromIterable(
extern macro IteratorBuiltinsAssembler::StringListFromIterable(
implicit context: Context)(JSAny): JSArray;
extern builtin IterableToListWithSymbolLookup(implicit context:
Context)(JSAny): JSArray;
extern builtin IterableToFixedArrayWithSymbolLookupSlow(
extern builtin IterableToListWithSymbolLookup(implicit context: Context)(JSAny):
JSArray;
extern builtin IterableToFixedArrayWithSymbolLookupSlow(
implicit context: Context)(JSAny): FixedArray;
transitioning builtin GetIteratorWithFeedback(
transitioning builtin GetIteratorWithFeedback(
context: Context, receiver: JSAny, loadSlot: TaggedIndex,
callSlot: TaggedIndex, feedback: Undefined|FeedbackVector): JSAny {
let iteratorMethod: JSAny;
......@@ -65,22 +65,21 @@ namespace iterator {
const callSlotSmi: Smi = TaggedIndexToSmi(callSlot);
return CallIteratorWithFeedback(
context, receiver, iteratorMethod, callSlotSmi, feedback);
}
}
transitioning builtin CallIteratorWithFeedback(
transitioning builtin CallIteratorWithFeedback(
context: Context, receiver: JSAny, iteratorMethod: JSAny, callSlot: Smi,
feedback: Undefined|FeedbackVector): JSAny {
const callSlotUnTagged: uintptr = Unsigned(SmiUntag(callSlot));
ic::CollectCallFeedback(
iteratorMethod, context, feedback, callSlotUnTagged);
ic::CollectCallFeedback(iteratorMethod, context, feedback, callSlotUnTagged);
const iteratorCallable: Callable = Cast<Callable>(iteratorMethod)
otherwise ThrowCalledNonCallable(iteratorMethod);
return Call(context, iteratorCallable, receiver);
}
}
// https://tc39.es/ecma262/#sec-iteratorclose
@export
transitioning macro IteratorCloseOnException(implicit context: Context)(
// https://tc39.es/ecma262/#sec-iteratorclose
@export
transitioning macro IteratorCloseOnException(implicit context: Context)(
iterator: IteratorRecord) {
try {
// 4. Let innerResult be GetMethod(iterator, "return").
......@@ -99,5 +98,5 @@ namespace iterator {
}
// (If completion.[[Type]] is throw) return Completion(completion).
}
}
}
This diff is collapsed.
......@@ -3,29 +3,28 @@
// LICENSE file.
namespace runtime {
extern transitioning runtime
DoubleToStringWithRadix(implicit context: Context)(Number, Number): String;
extern transitioning runtime
DoubleToStringWithRadix(implicit context: Context)(Number, Number): String;
} // namespace runtime
namespace number {
extern macro NaNStringConstant(): String;
extern macro ZeroStringConstant(): String;
extern macro InfinityStringConstant(): String;
extern macro MinusInfinityStringConstant(): String;
extern macro NaNStringConstant(): String;
extern macro ZeroStringConstant(): String;
extern macro InfinityStringConstant(): String;
extern macro MinusInfinityStringConstant(): String;
const kAsciiZero: constexpr int32 = 48; // '0' (ascii)
const kAsciiLowerCaseA: constexpr int32 = 97; // 'a' (ascii)
const kAsciiZero: constexpr int32 = 48; // '0' (ascii)
const kAsciiLowerCaseA: constexpr int32 = 97; // 'a' (ascii)
transitioning macro ThisNumberValue(implicit context: Context)(
transitioning macro ThisNumberValue(implicit context: Context)(
receiver: JSAny, method: constexpr string): Number {
return UnsafeCast<Number>(
ToThisValue(receiver, PrimitiveType::kNumber, method));
}
}
// https://tc39.github.io/ecma262/#sec-number.prototype.tostring
transitioning javascript builtin NumberPrototypeToString(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): String {
// https://tc39.github.io/ecma262/#sec-number.prototype.tostring
transitioning javascript builtin NumberPrototypeToString(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): String {
// 1. Let x be ? thisNumberValue(this value).
const x = ThisNumberValue(receiver, 'Number.prototype.toString');
......@@ -33,8 +32,7 @@ namespace number {
// 3. Else if radix is undefined, let radixNumber be 10.
// 4. Else, let radixNumber be ? ToInteger(radix).
const radix: JSAny = arguments[0];
const radixNumber: Number =
radix == Undefined ? 10 : ToInteger_Inline(radix);
const radixNumber: Number = radix == Undefined ? 10 : ToInteger_Inline(radix);
// 5. If radixNumber < 2 or radixNumber > 36, throw a RangeError exception.
if (radixNumber < 2 || radixNumber > 36) {
......@@ -71,5 +69,5 @@ namespace number {
}
return runtime::DoubleToStringWithRadix(x, radixNumber);
}
}
}
......@@ -4,7 +4,7 @@
namespace object {
transitioning macro ObjectFromEntriesFastCase(implicit context: Context)(
transitioning macro ObjectFromEntriesFastCase(implicit context: Context)(
iterable: JSAny): JSObject labels IfSlow {
typeswitch (iterable) {
case (array: FastJSArrayWithNoCustomIteration): {
......@@ -30,11 +30,11 @@ namespace object {
goto IfSlow;
}
}
}
}
transitioning javascript builtin
ObjectFromEntries(js-implicit context: NativeContext, receiver: JSAny)(
...arguments): JSAny {
transitioning javascript builtin
ObjectFromEntries(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
const iterable: JSAny = arguments[0];
try {
if (IsNullOrUndefined(iterable)) goto Throw;
......@@ -51,8 +51,7 @@ namespace object {
otherwise return result;
const iteratorValue: JSAny =
iterator::IteratorValue(step, fastIteratorResultMap);
const pair: KeyValuePair =
collections::LoadKeyValuePair(iteratorValue);
const pair: KeyValuePair = collections::LoadKeyValuePair(iteratorValue);
FastCreateDataProperty(result, pair.key, pair.value);
}
return result;
......@@ -63,5 +62,5 @@ namespace object {
} label Throw deferred {
ThrowTypeError(MessageTemplate::kNotIterable);
}
}
}
} // namespace object
......@@ -3,78 +3,74 @@
// found in the LICENSE file.
namespace runtime {
extern transitioning runtime
ObjectIsExtensible(implicit context: Context)(JSAny): JSAny;
extern transitioning runtime
ObjectIsExtensible(implicit context: Context)(JSAny): JSAny;
extern transitioning runtime
JSReceiverPreventExtensionsThrow(implicit context: Context)(JSReceiver):
JSAny;
extern transitioning runtime
JSReceiverPreventExtensionsThrow(implicit context: Context)(JSReceiver): JSAny;
extern transitioning runtime
JSReceiverPreventExtensionsDontThrow(implicit context: Context)(JSReceiver):
extern transitioning runtime
JSReceiverPreventExtensionsDontThrow(implicit context: Context)(JSReceiver):
JSAny;
extern transitioning runtime
JSReceiverGetPrototypeOf(implicit context: Context)(JSReceiver): JSAny;
extern transitioning runtime
JSReceiverGetPrototypeOf(implicit context: Context)(JSReceiver): JSAny;
extern transitioning runtime
JSReceiverSetPrototypeOfThrow(implicit context: Context)(JSReceiver, JSAny):
JSAny;
extern transitioning runtime
JSReceiverSetPrototypeOfThrow(implicit context: Context)(
JSReceiver, JSAny): JSAny;
extern transitioning runtime
JSReceiverSetPrototypeOfDontThrow(implicit context:
Context)(JSReceiver, JSAny): JSAny;
extern transitioning runtime
JSReceiverSetPrototypeOfDontThrow(implicit context: Context)(
JSReceiver, JSAny): JSAny;
extern transitioning runtime ObjectCreate(implicit context:
Context)(JSAny, JSAny): JSAny;
extern transitioning runtime ObjectCreate(implicit context: Context)(
JSAny, JSAny): JSAny;
} // namespace runtime
namespace object {
transitioning macro
ObjectIsExtensibleImpl(implicit context: Context)(object: JSAny): JSAny {
transitioning macro
ObjectIsExtensibleImpl(implicit context: Context)(object: JSAny): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return False;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::ObjectIsExtensible(objectJSReceiver);
return proxy::ProxyIsExtensible(objectJSProxy);
}
}
transitioning macro
ObjectPreventExtensionsThrow(implicit context: Context)(object: JSAny):
JSAny {
transitioning macro
ObjectPreventExtensionsThrow(implicit context: Context)(object: JSAny): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return object;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::JSReceiverPreventExtensionsThrow(
objectJSReceiver);
otherwise return runtime::JSReceiverPreventExtensionsThrow(objectJSReceiver);
proxy::ProxyPreventExtensions(objectJSProxy, True);
return objectJSReceiver;
}
}
transitioning macro
ObjectPreventExtensionsDontThrow(implicit context: Context)(object: JSAny):
transitioning macro
ObjectPreventExtensionsDontThrow(implicit context: Context)(object: JSAny):
JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return False;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::JSReceiverPreventExtensionsDontThrow(
objectJSReceiver);
return proxy::ProxyPreventExtensions(objectJSProxy, False);
}
}
transitioning macro
ObjectGetPrototypeOfImpl(implicit context: Context)(object: JSAny): JSAny {
transitioning macro
ObjectGetPrototypeOfImpl(implicit context: Context)(object: JSAny): JSAny {
const objectJSReceiver: JSReceiver = ToObject_Inline(context, object);
return object::JSReceiverGetPrototypeOf(objectJSReceiver);
}
}
transitioning macro
JSReceiverGetPrototypeOf(implicit context: Context)(object: JSReceiver):
JSAny {
transitioning macro
JSReceiverGetPrototypeOf(implicit context: Context)(object: JSReceiver): JSAny {
const objectJSProxy = Cast<JSProxy>(object)
otherwise return runtime::JSReceiverGetPrototypeOf(object);
return proxy::ProxyGetPrototypeOf(objectJSProxy);
}
}
transitioning macro
ObjectSetPrototypeOfThrow(implicit context: Context)(
transitioning macro
ObjectSetPrototypeOfThrow(implicit context: Context)(
object: JSAny, proto: JSReceiver|Null): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return object;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
......@@ -82,20 +78,20 @@ namespace object {
objectJSReceiver, proto);
proxy::ProxySetPrototypeOf(objectJSProxy, proto, True);
return objectJSReceiver;
}
}
transitioning macro
ObjectSetPrototypeOfDontThrow(implicit context: Context)(
transitioning macro
ObjectSetPrototypeOfDontThrow(implicit context: Context)(
object: JSAny, proto: JSReceiver|Null): JSAny {
const objectJSReceiver = Cast<JSReceiver>(object) otherwise return False;
const objectJSProxy = Cast<JSProxy>(objectJSReceiver)
otherwise return runtime::JSReceiverSetPrototypeOfDontThrow(
objectJSReceiver, proto);
return proxy::ProxySetPrototypeOf(objectJSProxy, proto, False);
}
}
transitioning builtin CreateObjectWithoutProperties(
implicit context: Context)(prototype: JSAny): JSAny {
transitioning builtin CreateObjectWithoutProperties(implicit context: Context)(
prototype: JSAny): JSAny {
const nativeContext = LoadNativeContext(context);
try {
......@@ -114,8 +110,7 @@ namespace object {
nativeContext[NativeContextSlot::OBJECT_FUNCTION_INDEX]);
map = UnsafeCast<Map>(objectFunction.prototype_or_initial_map);
if (prototype != map.prototype) {
const prototypeInfo =
prototype.map.PrototypeInfo() otherwise Runtime;
const prototypeInfo = prototype.map.PrototypeInfo() otherwise Runtime;
typeswitch (prototypeInfo.object_create_map) {
case (Undefined): {
goto Runtime;
......@@ -134,30 +129,29 @@ namespace object {
} label Runtime deferred {
return runtime::ObjectCreate(prototype, Undefined);
}
}
}
// ES6 section 19.1.2.11 Object.isExtensible ( O )
transitioning javascript builtin
ObjectIsExtensible(js-implicit context: NativeContext)(object: JSAny): JSAny {
// ES6 section 19.1.2.11 Object.isExtensible ( O )
transitioning javascript builtin
ObjectIsExtensible(js-implicit context: NativeContext)(object: JSAny): JSAny {
return object::ObjectIsExtensibleImpl(object);
}
}
// ES6 section 19.1.2.18 Object.preventExtensions ( O )
transitioning javascript builtin
ObjectPreventExtensions(js-implicit context: NativeContext)(object: JSAny):
// ES6 section 19.1.2.18 Object.preventExtensions ( O )
transitioning javascript builtin
ObjectPreventExtensions(js-implicit context: NativeContext)(object: JSAny):
JSAny {
return object::ObjectPreventExtensionsThrow(object);
}
}
// ES6 section 19.1.2.9 Object.getPrototypeOf ( O )
transitioning javascript builtin
ObjectGetPrototypeOf(js-implicit context: NativeContext)(object: JSAny):
JSAny {
// ES6 section 19.1.2.9 Object.getPrototypeOf ( O )
transitioning javascript builtin
ObjectGetPrototypeOf(js-implicit context: NativeContext)(object: JSAny): JSAny {
return object::ObjectGetPrototypeOfImpl(object);
}
}
// ES6 section 19.1.2.21 Object.setPrototypeOf ( O, proto )
transitioning javascript builtin ObjectSetPrototypeOf(
// ES6 section 19.1.2.21 Object.setPrototypeOf ( O, proto )
transitioning javascript builtin ObjectSetPrototypeOf(
js-implicit context: NativeContext)(object: JSAny, proto: JSAny): JSAny {
// 1. Set O to ? RequireObjectCoercible(O).
RequireObjectCoercible(object, 'Object.setPrototypeOf');
......@@ -176,23 +170,23 @@ namespace object {
ThrowTypeError(MessageTemplate::kProtoObjectOrNull, proto);
}
}
}
}
// ES #sec-object.prototype.tostring
transitioning javascript builtin ObjectPrototypeToString(
// ES #sec-object.prototype.tostring
transitioning javascript builtin ObjectPrototypeToString(
js-implicit context: Context, receiver: JSAny)(): String {
return ObjectToString(context, receiver);
}
}
// ES #sec-object.prototype.valueof
transitioning javascript builtin ObjectPrototypeValueOf(
// ES #sec-object.prototype.valueof
transitioning javascript builtin ObjectPrototypeValueOf(
js-implicit context: Context, receiver: JSAny)(): JSReceiver {
// 1. Return ? ToObject(this value).
return ToObject_Inline(context, receiver);
}
}
// ES #sec-object.prototype.tolocalestring
transitioning javascript builtin ObjectPrototypeToLocaleString(
// ES #sec-object.prototype.tolocalestring
transitioning javascript builtin ObjectPrototypeToLocaleString(
js-implicit context: Context, receiver: JSAny)(): JSAny {
// 1. Let O be the this value.
// 2. Return ? Invoke(O, "toString").
......@@ -203,5 +197,5 @@ namespace object {
}
const method = GetProperty(receiver, 'toString');
return Call(context, method, receiver);
}
}
} // namespace object
This diff is collapsed.
......@@ -8,13 +8,13 @@
namespace promise {
struct PromiseAllWrapResultAsFulfilledFunctor {
struct PromiseAllWrapResultAsFulfilledFunctor {
macro Call(_nativeContext: NativeContext, value: JSAny): JSAny {
return value;
}
}
}
struct PromiseAllSettledWrapResultAsFulfilledFunctor {
struct PromiseAllSettledWrapResultAsFulfilledFunctor {
transitioning
macro Call(implicit context: Context)(
nativeContext: NativeContext, value: JSAny): JSAny {
......@@ -35,9 +35,9 @@ namespace promise {
FastCreateDataProperty(obj, StringConstant('value'), value);
return obj;
}
}
}
struct PromiseAllSettledWrapResultAsRejectedFunctor {
struct PromiseAllSettledWrapResultAsRejectedFunctor {
transitioning
macro Call(implicit context: Context)(
nativeContext: NativeContext, value: JSAny): JSAny {
......@@ -58,32 +58,31 @@ namespace promise {
FastCreateDataProperty(obj, StringConstant('reason'), value);
return obj;
}
}
}
extern macro LoadJSReceiverIdentityHash(Object): intptr labels IfNoHash;
extern macro LoadJSReceiverIdentityHash(Object): intptr labels IfNoHash;
extern enum PromiseAllResolveElementContextSlots extends int31
constexpr 'PromiseBuiltins::PromiseAllResolveElementContextSlots' {
extern enum PromiseAllResolveElementContextSlots extends int31
constexpr 'PromiseBuiltins::PromiseAllResolveElementContextSlots' {
kPromiseAllResolveElementRemainingSlot,
kPromiseAllResolveElementCapabilitySlot,
kPromiseAllResolveElementValuesArraySlot,
kPromiseAllResolveElementLength
}
extern operator '[]=' macro StoreContextElement(
}
extern operator '[]=' macro StoreContextElement(
Context, constexpr PromiseAllResolveElementContextSlots, Object): void;
extern operator '[]' macro LoadContextElement(
extern operator '[]' macro LoadContextElement(
Context, constexpr PromiseAllResolveElementContextSlots): Object;
const kPropertyArrayNoHashSentinel: constexpr int31
const kPropertyArrayNoHashSentinel: constexpr int31
generates 'PropertyArray::kNoHashSentinel';
const kPropertyArrayHashFieldMax: constexpr int31
const kPropertyArrayHashFieldMax: constexpr int31
generates 'PropertyArray::HashField::kMax';
transitioning macro PromiseAllResolveElementClosure<F: type>(
implicit context:
Context)(value: JSAny, function: JSFunction, wrapResultFunctor: F):
JSAny {
transitioning macro PromiseAllResolveElementClosure<F: type>(
implicit context: Context)(
value: JSAny, function: JSFunction, wrapResultFunctor: F): JSAny {
// We use the {function}s context as the marker to remember whether this
// resolve element closure was already called. It points to the resolve
// element context (which is a FunctionContext) until it was called the
......@@ -151,8 +150,7 @@ namespace promise {
kPromiseAllResolveElementRemainingSlot]);
remainingElementsCount = remainingElementsCount - 1;
context[PromiseAllResolveElementContextSlots::
kPromiseAllResolveElementRemainingSlot] =
remainingElementsCount;
kPromiseAllResolveElementRemainingSlot] = remainingElementsCount;
if (remainingElementsCount == 0) {
const capability = UnsafeCast<PromiseCapability>(
context[PromiseAllResolveElementContextSlots::
......@@ -161,29 +159,29 @@ namespace promise {
Call(context, resolve, Undefined, valuesArray);
}
return Undefined;
}
}
transitioning javascript builtin
PromiseAllResolveElementClosure(
transitioning javascript builtin
PromiseAllResolveElementClosure(
js-implicit context: Context, receiver: JSAny,
target: JSFunction)(value: JSAny): JSAny {
return PromiseAllResolveElementClosure(
value, target, PromiseAllWrapResultAsFulfilledFunctor{});
}
}
transitioning javascript builtin
PromiseAllSettledResolveElementClosure(
transitioning javascript builtin
PromiseAllSettledResolveElementClosure(
js-implicit context: Context, receiver: JSAny,
target: JSFunction)(value: JSAny): JSAny {
return PromiseAllResolveElementClosure(
value, target, PromiseAllSettledWrapResultAsFulfilledFunctor{});
}
}
transitioning javascript builtin
PromiseAllSettledRejectElementClosure(
transitioning javascript builtin
PromiseAllSettledRejectElementClosure(
js-implicit context: Context, receiver: JSAny,
target: JSFunction)(value: JSAny): JSAny {
return PromiseAllResolveElementClosure(
value, target, PromiseAllSettledWrapResultAsRejectedFunctor{});
}
}
}
This diff is collapsed.
......@@ -5,28 +5,28 @@
#include 'src/builtins/builtins-promise-gen.h'
namespace promise {
extern enum PromiseAnyRejectElementContextSlots extends int31
constexpr 'PromiseBuiltins::PromiseAnyRejectElementContextSlots' {
extern enum PromiseAnyRejectElementContextSlots extends int31
constexpr 'PromiseBuiltins::PromiseAnyRejectElementContextSlots' {
kPromiseAnyRejectElementRemainingSlot,
kPromiseAnyRejectElementCapabilitySlot,
kPromiseAnyRejectElementErrorsArraySlot,
kPromiseAnyRejectElementLength
}
}
extern operator '[]=' macro StoreContextElement(
extern operator '[]=' macro StoreContextElement(
Context, constexpr PromiseAnyRejectElementContextSlots, Object): void;
extern operator '[]' macro LoadContextElement(
extern operator '[]' macro LoadContextElement(
Context, constexpr PromiseAnyRejectElementContextSlots): Object;
// Creates the context used by all Promise.any reject element closures,
// together with the errors array. Since all closures for a single Promise.any
// call use the same context, we need to store the indices for the individual
// closures somewhere else (we put them into the identity hash field of the
// closures), and we also need to have a separate marker for when the closure
// was called already (we slap the native context onto the closure in that
// case to mark it's done). See Promise.all which uses the same approach.
transitioning macro CreatePromiseAnyRejectElementContext(implicit context:
Context)(
// Creates the context used by all Promise.any reject element closures,
// together with the errors array. Since all closures for a single Promise.any
// call use the same context, we need to store the indices for the individual
// closures somewhere else (we put them into the identity hash field of the
// closures), and we also need to have a separate marker for when the closure
// was called already (we slap the native context onto the closure in that
// case to mark it's done). See Promise.all which uses the same approach.
transitioning macro CreatePromiseAnyRejectElementContext(
implicit context: Context)(
capability: PromiseCapability, nativeContext: NativeContext): Context {
const rejectContext = AllocateSyntheticFunctionContext(
nativeContext,
......@@ -39,9 +39,9 @@ namespace promise {
rejectContext[PromiseAnyRejectElementContextSlots::
kPromiseAnyRejectElementErrorsArraySlot] = Undefined;
return rejectContext;
}
}
macro CreatePromiseAnyRejectElementFunction(implicit context: Context)(
macro CreatePromiseAnyRejectElementFunction(implicit context: Context)(
rejectElementContext: Context, index: Smi,
nativeContext: NativeContext): JSFunction {
assert(index > 0);
......@@ -50,16 +50,16 @@ namespace promise {
nativeContext
[NativeContextSlot::STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX]);
const rejectInfo = PromiseAnyRejectElementSharedFunConstant();
const reject = AllocateFunctionWithMapAndContext(
map, rejectInfo, rejectElementContext);
const reject =
AllocateFunctionWithMapAndContext(map, rejectInfo, rejectElementContext);
assert(kPropertyArrayNoHashSentinel == 0);
reject.properties_or_hash = index;
return reject;
}
}
// https://tc39.es/proposal-promise-any/#sec-promise.any-reject-element-functions
transitioning javascript builtin
PromiseAnyRejectElementClosure(
// https://tc39.es/proposal-promise-any/#sec-promise.any-reject-element-functions
transitioning javascript builtin
PromiseAnyRejectElementClosure(
js-implicit context: Context, receiver: JSAny,
target: JSFunction)(value: JSAny): JSAny {
// 1. Let F be the active function object.
......@@ -87,8 +87,7 @@ namespace promise {
// 5. Let index be F.[[Index]].
assert(kPropertyArrayNoHashSentinel == 0);
const identityHash =
LoadJSReceiverIdentityHash(target) otherwise unreachable;
const identityHash = LoadJSReceiverIdentityHash(target) otherwise unreachable;
assert(identityHash > 0);
const index = identityHash - 1;
......@@ -135,12 +134,12 @@ namespace promise {
// 12. Return undefined.
return Undefined;
}
}
transitioning macro PerformPromiseAny(implicit context: Context)(
transitioning macro PerformPromiseAny(implicit context: Context)(
iteratorRecord: iterator::IteratorRecord, constructor: Constructor,
resultCapability: PromiseCapability): JSAny labels
Reject(Object) {
Reject(Object) {
// 1. Assert: ! IsConstructor(constructor) is true.
// 2. Assert: resultCapability is a PromiseCapability Record.
......@@ -222,8 +221,7 @@ namespace promise {
let nextPromise: JSAny;
// i. Let nextPromise be ? Call(constructor, promiseResolve,
// «nextValue »).
nextPromise =
CallResolve(constructor, promiseResolveFunction, nextValue);
nextPromise = CallResolve(constructor, promiseResolveFunction, nextValue);
// j. Let steps be the algorithm steps defined in Promise.any
// Reject Element Functions.
......@@ -308,16 +306,15 @@ namespace promise {
}
// iv. Return resultCapability.[[Promise]].
return resultCapability.promise;
}
}
// https://tc39.es/proposal-promise-any/#sec-promise.any
transitioning javascript builtin
PromiseAny(js-implicit context: Context, receiver: JSAny)(iterable: JSAny):
JSAny {
// https://tc39.es/proposal-promise-any/#sec-promise.any
transitioning javascript builtin
PromiseAny(
js-implicit context: Context, receiver: JSAny)(iterable: JSAny): JSAny {
// 1. Let C be the this value.
const receiver = Cast<JSReceiver>(receiver)
otherwise ThrowTypeError(
MessageTemplate::kCalledOnNonObject, 'Promise.any');
otherwise ThrowTypeError(MessageTemplate::kCalledOnNonObject, 'Promise.any');
// 2. Let promiseCapability be ? NewPromiseCapability(C).
const capability = NewPromiseCapability(receiver, False);
......@@ -361,15 +358,15 @@ namespace promise {
UnsafeCast<JSAny>(e));
return capability.promise;
}
}
}
transitioning macro ConstructAggregateError(implicit context: Context)(
transitioning macro ConstructAggregateError(implicit context: Context)(
errorsArray: FixedArray): JSObject {
const obj: JSAggregateError = error::ConstructInternalAggregateErrorHelper(
context, SmiConstant(MessageTemplate::kAllPromisesRejected));
obj.errors = errorsArray;
return obj;
}
}
extern macro PromiseAnyRejectElementSharedFunConstant(): SharedFunctionInfo;
extern macro PromiseAnyRejectElementSharedFunConstant(): SharedFunctionInfo;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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