v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
growable-fixed-array-gen.h
Go to the documentation of this file.
1// Copyright 2018 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_BUILTINS_GROWABLE_FIXED_ARRAY_GEN_H_
6#define V8_BUILTINS_GROWABLE_FIXED_ARRAY_GEN_H_
7
9
10namespace v8 {
11namespace internal {
12
13
14// Utility class implementing a growable fixed array through CSA.
16 public:
18 : CodeStubAssembler(state),
19 var_array_(this),
20 var_length_(this),
21 var_capacity_(this) {
22 var_array_ = EmptyFixedArrayConstant();
25 }
26
27 TNode<IntPtrT> length() const { return var_length_.value(); }
28
32
33 void Reserve(TNode<IntPtrT> required_capacity);
34
35 void Push(const TNode<Object> value);
36
39
40 private:
42
43 // Creates a new array with {new_capacity} and copies the first
44 // {element_count} elements from the current array.
46 const TNode<IntPtrT> new_capacity);
47
48 private:
52};
53
54} // namespace internal
55} // namespace v8
56
57#endif // V8_BUILTINS_GROWABLE_FIXED_ARRAY_GEN_H_
TNode< JSArray > ToJSArray(const TNode< Context > context)
TVariable< FixedArray > * var_array()
GrowableFixedArray(compiler::CodeAssemblerState *state)
TNode< FixedArray > ResizeFixedArray(const TNode< IntPtrT > element_count, const TNode< IntPtrT > new_capacity)
void Push(const TNode< Object > value)
void Reserve(TNode< IntPtrT > required_capacity)
TNode< IntPtrT > NewCapacity(TNode< IntPtrT > current_capacity)
TNode< IntPtrT > IntPtrConstant(intptr_t value)