Commit be8c9e73 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Commit Bot

Split torque generated files for faster build

By using different namespace, generated code split into different files.

By this CL, build time of torque_generated_initializers is improved from 80 seconds to 40 seconds on Z840 Linux measured by following command:

# Remove generated code to re-compile all generated files.
~/v8/v8$ rm -rf out/x64.release/gen/
# GOMA_STORE_ONLY=true disables goma's backend cache.
~/v8/v8$ time GOMA_STORE_ONLY=true autoninja -C out/x64.release/ torque_generated_initializers

Bug: v8:8732
Change-Id: I64545f9994aea7e4209ac3852aadf4e2e9f4bc93
Reviewed-on: https://chromium-review.googlesource.com/c/1446331Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59215}
parent 4b9eb7f7
...@@ -882,10 +882,22 @@ torque_namespaces = [ ...@@ -882,10 +882,22 @@ torque_namespaces = [
"base", "base",
"arguments", "arguments",
"array", "array",
"array-copywithin",
"array-filter",
"array-foreach",
"array-join",
"array-map",
"array-of",
"array-reverse",
"array-slice",
"array-splice",
"array-unshift",
"array-lastindexof",
"collections", "collections",
"iterator", "iterator",
"object", "object",
"typed-array", "typed-array",
"typed-array-createtypedarray",
"data-view", "data-view",
"extras-utils", "extras-utils",
"test", "test",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_copywithin {
macro ConvertToRelativeIndex(index: Number, length: Number): Number { macro ConvertToRelativeIndex(index: Number, length: Number): Number {
return index < 0 ? Max(index + length, 0) : Min(index, length); return index < 0 ? Max(index + length, 0) : Min(index, length);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_filter {
transitioning javascript builtin transitioning javascript builtin
ArrayFilterLoopEagerDeoptContinuation(implicit context: Context)( ArrayFilterLoopEagerDeoptContinuation(implicit context: Context)(
receiver: Object, callback: Object, thisArg: Object, array: Object, receiver: Object, callback: Object, thisArg: Object, array: Object,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_foreach {
transitioning javascript builtin transitioning javascript builtin
ArrayForEachLoopEagerDeoptContinuation(implicit context: Context)( ArrayForEachLoopEagerDeoptContinuation(implicit context: Context)(
receiver: Object, callback: Object, thisArg: Object, initialK: Object, receiver: Object, callback: Object, thisArg: Object, initialK: Object,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_join {
type LoadJoinElementFn = builtin(Context, JSReceiver, Number) => Object; type LoadJoinElementFn = builtin(Context, JSReceiver, Number) => Object;
// Fast C call to write a fixed array (see Buffer.fixedArray) to a single // Fast C call to write a fixed array (see Buffer.fixedArray) to a single
...@@ -16,7 +16,7 @@ namespace array { ...@@ -16,7 +16,7 @@ namespace array {
return GetProperty(receiver, k); return GetProperty(receiver, k);
} }
LoadJoinElement<DictionaryElements>( LoadJoinElement<array::DictionaryElements>(
context: Context, receiver: JSReceiver, k: Number): Object { context: Context, receiver: JSReceiver, k: Number): Object {
const array: JSArray = UnsafeCast<JSArray>(receiver); const array: JSArray = UnsafeCast<JSArray>(receiver);
const dict: NumberDictionary = UnsafeCast<NumberDictionary>(array.elements); const dict: NumberDictionary = UnsafeCast<NumberDictionary>(array.elements);
...@@ -32,7 +32,7 @@ namespace array { ...@@ -32,7 +32,7 @@ namespace array {
} }
} }
LoadJoinElement<FastSmiOrObjectElements>( LoadJoinElement<array::FastSmiOrObjectElements>(
context: Context, receiver: JSReceiver, k: Number): Object { context: Context, receiver: JSReceiver, k: Number): Object {
const array: JSArray = UnsafeCast<JSArray>(receiver); const array: JSArray = UnsafeCast<JSArray>(receiver);
const fixedArray: FixedArray = UnsafeCast<FixedArray>(array.elements); const fixedArray: FixedArray = UnsafeCast<FixedArray>(array.elements);
...@@ -40,7 +40,7 @@ namespace array { ...@@ -40,7 +40,7 @@ namespace array {
return element == Hole ? kEmptyString : element; return element == Hole ? kEmptyString : element;
} }
LoadJoinElement<FastDoubleElements>( LoadJoinElement<array::FastDoubleElements>(
context: Context, receiver: JSReceiver, k: Number): Object { context: Context, receiver: JSReceiver, k: Number): Object {
const array: JSArray = UnsafeCast<JSArray>(receiver); const array: JSArray = UnsafeCast<JSArray>(receiver);
const fixedDoubleArray: FixedDoubleArray = const fixedDoubleArray: FixedDoubleArray =
...@@ -98,7 +98,7 @@ namespace array { ...@@ -98,7 +98,7 @@ namespace array {
loadFn: LoadJoinElementFn, receiver: JSReceiver, originalMap: Map, loadFn: LoadJoinElementFn, receiver: JSReceiver, originalMap: Map,
originalLen: Number): never originalLen: Number): never
labels Cannot, Can { labels Cannot, Can {
if (loadFn == LoadJoinElement<GenericElementsAccessor>) goto Can; if (loadFn == LoadJoinElement<array::GenericElementsAccessor>) goto Can;
const array: JSArray = UnsafeCast<JSArray>(receiver); const array: JSArray = UnsafeCast<JSArray>(receiver);
if (originalMap != array.map) goto Cannot; if (originalMap != array.map) goto Cannot;
...@@ -280,7 +280,7 @@ namespace array { ...@@ -280,7 +280,7 @@ namespace array {
if (CannotUseSameArrayAccessor<T>( if (CannotUseSameArrayAccessor<T>(
loadFn, receiver, initialMap, lengthNumber)) loadFn, receiver, initialMap, lengthNumber))
deferred { deferred {
loadFn = LoadJoinElement<GenericElementsAccessor>; loadFn = LoadJoinElement<array::GenericElementsAccessor>;
} }
if (k > 0) { if (k > 0) {
...@@ -343,9 +343,9 @@ namespace array { ...@@ -343,9 +343,9 @@ namespace array {
if (IsNoElementsProtectorCellInvalid()) goto IfSlowPath; if (IsNoElementsProtectorCellInvalid()) goto IfSlowPath;
if (IsElementsKindLessThanOrEqual(kind, HOLEY_ELEMENTS)) { if (IsElementsKindLessThanOrEqual(kind, HOLEY_ELEMENTS)) {
loadFn = LoadJoinElement<FastSmiOrObjectElements>; loadFn = LoadJoinElement<array::FastSmiOrObjectElements>;
} else if (IsElementsKindLessThanOrEqual(kind, HOLEY_DOUBLE_ELEMENTS)) { } else if (IsElementsKindLessThanOrEqual(kind, HOLEY_DOUBLE_ELEMENTS)) {
loadFn = LoadJoinElement<FastDoubleElements>; loadFn = LoadJoinElement<array::FastDoubleElements>;
} else if (kind == DICTIONARY_ELEMENTS) } else if (kind == DICTIONARY_ELEMENTS)
deferred { deferred {
const dict: NumberDictionary = const dict: NumberDictionary =
...@@ -362,7 +362,7 @@ namespace array { ...@@ -362,7 +362,7 @@ namespace array {
ThrowInvalidStringLength(context); ThrowInvalidStringLength(context);
} }
} else { } else {
loadFn = LoadJoinElement<DictionaryElements>; loadFn = LoadJoinElement<array::DictionaryElements>;
} }
} }
else { else {
...@@ -370,7 +370,7 @@ namespace array { ...@@ -370,7 +370,7 @@ namespace array {
} }
} }
label IfSlowPath { label IfSlowPath {
loadFn = LoadJoinElement<GenericElementsAccessor>; loadFn = LoadJoinElement<array::GenericElementsAccessor>;
} }
return ArrayJoinImpl<JSArray>( return ArrayJoinImpl<JSArray>(
receiver, sep, lenNumber, useToLocaleString, locales, options, loadFn); receiver, sep, lenNumber, useToLocaleString, locales, options, loadFn);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_lastindexof {
macro LoadWithHoleCheck<Elements: type>( macro LoadWithHoleCheck<Elements: type>(
elements: FixedArrayBase, index: Smi): Object elements: FixedArrayBase, index: Smi): Object
labels IfHole; labels IfHole;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_map {
transitioning javascript builtin transitioning javascript builtin
ArrayMapLoopEagerDeoptContinuation(implicit context: Context)( ArrayMapLoopEagerDeoptContinuation(implicit context: Context)(
receiver: Object, callback: Object, thisArg: Object, array: Object, receiver: Object, callback: Object, thisArg: Object, array: Object,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_of {
// https://tc39.github.io/ecma262/#sec-array.of // https://tc39.github.io/ecma262/#sec-array.of
transitioning javascript builtin transitioning javascript builtin
ArrayOf(implicit context: Context)(receiver: Object, ...arguments): Object { ArrayOf(implicit context: Context)(receiver: Object, ...arguments): Object {
...@@ -46,7 +46,7 @@ namespace array { ...@@ -46,7 +46,7 @@ namespace array {
} }
// 8. Perform ? Set(A, "length", len, true). // 8. Perform ? Set(A, "length", len, true).
SetPropertyLength(a, len); array::SetPropertyLength(a, len);
// 9. Return A. // 9. Return A.
return a; return a;
......
...@@ -2,24 +2,25 @@ ...@@ -2,24 +2,25 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_reverse {
macro LoadElement<ElementsAccessor: type, T: type>( macro LoadElement<ElementsAccessor: type, T: type>(
elements: FixedArrayBase, index: Smi): T; elements: FixedArrayBase, index: Smi): T;
LoadElement<FastPackedSmiElements, Smi>(implicit context: Context)( LoadElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
elements: FixedArrayBase, index: Smi): Smi { elements: FixedArrayBase, index: Smi): Smi {
const elems: FixedArray = UnsafeCast<FixedArray>(elements); const elems: FixedArray = UnsafeCast<FixedArray>(elements);
return UnsafeCast<Smi>(elems[index]); return UnsafeCast<Smi>(elems[index]);
} }
LoadElement<FastPackedObjectElements, Object>(implicit context: Context)( LoadElement<array::FastPackedObjectElements, Object>(
elements: FixedArrayBase, index: Smi): Object { implicit context: Context)(elements: FixedArrayBase, index: Smi): Object {
const elems: FixedArray = UnsafeCast<FixedArray>(elements); const elems: FixedArray = UnsafeCast<FixedArray>(elements);
return elems[index]; return elems[index];
} }
LoadElement<FastPackedDoubleElements, float64>(implicit context: Context)( LoadElement<array::FastPackedDoubleElements, float64>(
elements: FixedArrayBase, index: Smi): float64 { implicit context: Context)(elements: FixedArrayBase, index: Smi):
float64 {
try { try {
const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements); const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
return LoadDoubleWithHoleCheck(elems, index) otherwise Hole; return LoadDoubleWithHoleCheck(elems, index) otherwise Hole;
...@@ -35,20 +36,22 @@ namespace array { ...@@ -35,20 +36,22 @@ namespace array {
implicit context: implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: T); Context)(elements: FixedArrayBase, index: Smi, value: T);
StoreElement<FastPackedSmiElements, Smi>(implicit context: Context)( StoreElement<array::FastPackedSmiElements, Smi>(implicit context: Context)(
elements: FixedArrayBase, index: Smi, value: Smi) { elements: FixedArrayBase, index: Smi, value: Smi) {
const elems: FixedArray = UnsafeCast<FixedArray>(elements); const elems: FixedArray = UnsafeCast<FixedArray>(elements);
StoreFixedArrayElementSmi(elems, index, value, SKIP_WRITE_BARRIER); StoreFixedArrayElementSmi(elems, index, value, SKIP_WRITE_BARRIER);
} }
StoreElement<FastPackedObjectElements, Object>(implicit context: Context)( StoreElement<array::FastPackedObjectElements, Object>(
elements: FixedArrayBase, index: Smi, value: Object) { implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: Object) {
const elems: FixedArray = UnsafeCast<FixedArray>(elements); const elems: FixedArray = UnsafeCast<FixedArray>(elements);
elems[index] = value; elems[index] = value;
} }
StoreElement<FastPackedDoubleElements, float64>(implicit context: Context)( StoreElement<array::FastPackedDoubleElements, float64>(
elements: FixedArrayBase, index: Smi, value: float64) { implicit context:
Context)(elements: FixedArrayBase, index: Smi, value: float64) {
const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements); const elems: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements);
StoreFixedDoubleArrayElementWithSmiIndex(elems, index, value); StoreFixedDoubleArrayElementWithSmiIndex(elems, index, value);
} }
...@@ -149,15 +152,15 @@ namespace array { ...@@ -149,15 +152,15 @@ namespace array {
const kind: ElementsKind = array.map.elements_kind; const kind: ElementsKind = array.map.elements_kind;
if (kind == PACKED_SMI_ELEMENTS) { if (kind == PACKED_SMI_ELEMENTS) {
EnsureWriteableFastElements(array); array::EnsureWriteableFastElements(array);
FastPackedArrayReverse<FastPackedSmiElements, Smi>( FastPackedArrayReverse<array::FastPackedSmiElements, Smi>(
array.elements, array.length); array.elements, array.length);
} else if (kind == PACKED_ELEMENTS) { } else if (kind == PACKED_ELEMENTS) {
EnsureWriteableFastElements(array); array::EnsureWriteableFastElements(array);
FastPackedArrayReverse<FastPackedObjectElements, Object>( FastPackedArrayReverse<array::FastPackedObjectElements, Object>(
array.elements, array.length); array.elements, array.length);
} else if (kind == PACKED_DOUBLE_ELEMENTS) { } else if (kind == PACKED_DOUBLE_ELEMENTS) {
FastPackedArrayReverse<FastPackedDoubleElements, float64>( FastPackedArrayReverse<array::FastPackedDoubleElements, float64>(
array.elements, array.length); array.elements, array.length);
} else { } else {
goto Slow; goto Slow;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_slice {
macro HandleSimpleArgumentsSlice( macro HandleSimpleArgumentsSlice(
context: Context, args: JSArgumentsObjectWithLength, start: Smi, context: Context, args: JSArgumentsObjectWithLength, start: Smi,
count: Smi): JSArray count: Smi): JSArray
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_splice {
// Given {elements}, we want to create a non-zero length array of type // Given {elements}, we want to create a non-zero length array of type
// FixedArrayType. Most of this behavior is outsourced to ExtractFixedArray(), // FixedArrayType. Most of this behavior is outsourced to ExtractFixedArray(),
// but the special case of wanting to have a FixedDoubleArray when given a // but the special case of wanting to have a FixedDoubleArray when given a
...@@ -39,7 +39,7 @@ namespace array { ...@@ -39,7 +39,7 @@ namespace array {
macro StoreHoles<FixedArrayType: type>( macro StoreHoles<FixedArrayType: type>(
elements: FixedArrayType, holeStartIndex: Smi, holeEndIndex: Smi): void { elements: FixedArrayType, holeStartIndex: Smi, holeEndIndex: Smi): void {
for (let i: Smi = holeStartIndex; i < holeEndIndex; i++) { for (let i: Smi = holeStartIndex; i < holeEndIndex; i++) {
StoreArrayHole(elements, i); array::StoreArrayHole(elements, i);
} }
} }
...@@ -57,7 +57,7 @@ namespace array { ...@@ -57,7 +57,7 @@ namespace array {
lengthDelta: Smi, actualStart: Smi, insertCount: Smi, lengthDelta: Smi, actualStart: Smi, insertCount: Smi,
actualDeleteCount: Smi): void labels Bailout { actualDeleteCount: Smi): void labels Bailout {
// Make sure elements are writable. // Make sure elements are writable.
EnsureWriteableFastElements(a); array::EnsureWriteableFastElements(a);
if (insertCount != actualDeleteCount) { if (insertCount != actualDeleteCount) {
const elements: FixedArrayBase = a.elements; const elements: FixedArrayBase = a.elements;
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
namespace array { namespace array_unshift {
extern builtin ArrayUnshift(Context, JSFunction, Object, int32); extern builtin ArrayUnshift(Context, JSFunction, Object, int32);
macro TryFastArrayUnshift( macro TryFastArrayUnshift(
context: Context, receiver: Object, arguments: constexpr Arguments): never context: Context, receiver: Object, arguments: constexpr Arguments): never
labels Slow { labels Slow {
const array: FastJSArray = Cast<FastJSArray>(receiver) otherwise Slow; const array: FastJSArray = Cast<FastJSArray>(receiver) otherwise Slow;
EnsureWriteableFastElements(array); array::EnsureWriteableFastElements(array);
const map: Map = array.map; const map: Map = array.map;
if (!IsExtensibleMap(map)) goto Slow; if (!IsExtensibleMap(map)) goto Slow;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include 'src/builtins/builtins-constructor-gen.h' #include 'src/builtins/builtins-constructor-gen.h'
namespace typed_array { namespace typed_array_createtypedarray {
extern builtin IterableToListMayPreserveHoles(Context, Object, Callable): extern builtin IterableToListMayPreserveHoles(Context, Object, Callable):
JSArray; JSArray;
extern builtin TypedArrayInitialize(implicit context: Context)( extern builtin TypedArrayInitialize(implicit context: Context)(
...@@ -29,7 +29,7 @@ namespace typed_array { ...@@ -29,7 +29,7 @@ namespace typed_array {
macro TypedArrayInitializeWithBuffer( macro TypedArrayInitializeWithBuffer(
typedArray: JSTypedArray, length: PositiveSmi, buffer: JSArrayBuffer, typedArray: JSTypedArray, length: PositiveSmi, buffer: JSArrayBuffer,
elementsInfo: TypedArrayElementsInfo, byteOffset: Number) { elementsInfo: typed_array::TypedArrayElementsInfo, byteOffset: Number) {
const byteLength: Number = SmiMul(length, elementsInfo.size); const byteLength: Number = SmiMul(length, elementsInfo.size);
SetupTypedArray( SetupTypedArray(
...@@ -43,7 +43,7 @@ namespace typed_array { ...@@ -43,7 +43,7 @@ namespace typed_array {
// ES #sec-typedarray-length // ES #sec-typedarray-length
macro ConstructByLength(implicit context: Context)( macro ConstructByLength(implicit context: Context)(
typedArray: JSTypedArray, length: Object, typedArray: JSTypedArray, length: Object,
elementsInfo: TypedArrayElementsInfo): void { elementsInfo: typed_array::TypedArrayElementsInfo): void {
const convertedLength: Number = const convertedLength: Number =
ToInteger_Inline(context, length, kTruncateMinusZero); ToInteger_Inline(context, length, kTruncateMinusZero);
// The maximum length of a TypedArray is MaxSmi(). // The maximum length of a TypedArray is MaxSmi().
...@@ -63,7 +63,7 @@ namespace typed_array { ...@@ -63,7 +63,7 @@ namespace typed_array {
// ES #sec-typedarray-object // ES #sec-typedarray-object
macro ConstructByArrayLike(implicit context: Context)( macro ConstructByArrayLike(implicit context: Context)(
typedArray: JSTypedArray, arrayLike: HeapObject, initialLength: Object, typedArray: JSTypedArray, arrayLike: HeapObject, initialLength: Object,
elementsInfo: TypedArrayElementsInfo, elementsInfo: typed_array::TypedArrayElementsInfo,
bufferConstructor: JSReceiver): void { bufferConstructor: JSReceiver): void {
// The caller has looked up length on arrayLike, which is observable. // The caller has looked up length on arrayLike, which is observable.
const length: PositiveSmi = ToSmiLength(initialLength) const length: PositiveSmi = ToSmiLength(initialLength)
...@@ -99,7 +99,7 @@ namespace typed_array { ...@@ -99,7 +99,7 @@ namespace typed_array {
// ES #sec-typedarray-object // ES #sec-typedarray-object
macro ConstructByIterable(implicit context: Context)( macro ConstructByIterable(implicit context: Context)(
typedArray: JSTypedArray, iterable: JSReceiver, iteratorFn: Callable, typedArray: JSTypedArray, iterable: JSReceiver, iteratorFn: Callable,
elementsInfo: TypedArrayElementsInfo): void { elementsInfo: typed_array::TypedArrayElementsInfo): void {
const array: JSArray = const array: JSArray =
IterableToListMayPreserveHoles(context, iterable, iteratorFn); IterableToListMayPreserveHoles(context, iterable, iteratorFn);
ConstructByArrayLike( ConstructByArrayLike(
...@@ -111,7 +111,7 @@ namespace typed_array { ...@@ -111,7 +111,7 @@ namespace typed_array {
// ES #sec-typedarray-typedarray // ES #sec-typedarray-typedarray
macro ConstructByTypedArray(implicit context: Context)( macro ConstructByTypedArray(implicit context: Context)(
typedArray: JSTypedArray, srcTypedArray: JSTypedArray, typedArray: JSTypedArray, srcTypedArray: JSTypedArray,
elementsInfo: TypedArrayElementsInfo): void { elementsInfo: typed_array::TypedArrayElementsInfo): void {
let bufferConstructor: JSReceiver = GetArrayBufferFunction(); let bufferConstructor: JSReceiver = GetArrayBufferFunction();
const srcBuffer: JSArrayBuffer = srcTypedArray.buffer; const srcBuffer: JSArrayBuffer = srcTypedArray.buffer;
// TODO(petermarshall): Throw on detached typedArray. // TODO(petermarshall): Throw on detached typedArray.
...@@ -144,7 +144,7 @@ namespace typed_array { ...@@ -144,7 +144,7 @@ namespace typed_array {
// ES #sec-typedarray-buffer-byteoffset-length // ES #sec-typedarray-buffer-byteoffset-length
macro ConstructByArrayBuffer(implicit context: Context)( macro ConstructByArrayBuffer(implicit context: Context)(
typedArray: JSTypedArray, buffer: JSArrayBuffer, byteOffset: Object, typedArray: JSTypedArray, buffer: JSArrayBuffer, byteOffset: Object,
length: Object, elementsInfo: TypedArrayElementsInfo): void { length: Object, elementsInfo: typed_array::TypedArrayElementsInfo): void {
try { try {
let offset: Number = FromConstexpr<Smi>(0); let offset: Number = FromConstexpr<Smi>(0);
if (byteOffset != Undefined) { if (byteOffset != Undefined) {
...@@ -220,7 +220,7 @@ namespace typed_array { ...@@ -220,7 +220,7 @@ namespace typed_array {
transitioning macro ConstructByJSReceiver(implicit context: Context)( transitioning macro ConstructByJSReceiver(implicit context: Context)(
array: JSTypedArray, obj: JSReceiver, array: JSTypedArray, obj: JSReceiver,
elementsInfo: TypedArrayElementsInfo) { elementsInfo: typed_array::TypedArrayElementsInfo) {
try { try {
const iteratorMethod: Object = const iteratorMethod: Object =
GetIteratorMethod(obj) otherwise IfIteratorUndefined; GetIteratorMethod(obj) otherwise IfIteratorUndefined;
...@@ -259,8 +259,8 @@ namespace typed_array { ...@@ -259,8 +259,8 @@ namespace typed_array {
// 5. Let elementSize be the Number value of the Element Size value in Table // 5. Let elementSize be the Number value of the Element Size value in Table
// 56 for constructorName. // 56 for constructorName.
const elementsInfo: TypedArrayElementsInfo = const elementsInfo: typed_array::TypedArrayElementsInfo =
GetTypedArrayElementsInfo(array); typed_array::GetTypedArrayElementsInfo(array);
try { try {
typeswitch (arg1) { typeswitch (arg1) {
......
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