%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
// Copyright 2019 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. namespace growable_fixed_array { // TODO(pwong): Support FixedTypedArrays. struct GrowableFixedArray { macro Push(obj: Object) { this.EnsureCapacity(); this.array.objects[this.length++] = obj; } macro ResizeFixedArray(newCapacity: intptr): FixedArray { assert(this.length >= 0); assert(newCapacity >= 0); assert(newCapacity >= this.length); const first: intptr = 0; return ExtractFixedArray(this.array, first, this.length, newCapacity); } macro EnsureCapacity() { assert(this.length <= this.capacity); if (this.capacity == this.length) { // Growth rate is analog to JSObject::NewElementsCapacity: // new_capacity = (current_capacity + (current_capacity >> 1)) + 16. this.capacity = this.capacity + (this.capacity >> 1) + 16; this.array = this.ResizeFixedArray(this.capacity); } } macro ToJSArray(implicit context: Context)(): JSArray { const nativeContext: NativeContext = LoadNativeContext(context); const map: Map = LoadJSArrayElementsMap(ElementsKind::PACKED_ELEMENTS, nativeContext); const fixedArray: FixedArray = this.ResizeFixedArray(this.length); const lengthSmi = Convert<Smi>(this.length); return AllocateJSArray(map, fixedArray, lengthSmi); } array: FixedArray; // TODO(v8:4153): make capacity and length uintptr capacity: intptr; length: intptr; } macro NewGrowableFixedArray(): GrowableFixedArray { return GrowableFixedArray{array: kEmptyFixedArray, capacity: 0, length: 0}; } }