OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ |
7 | 7 |
| 8 #include "src/globals.h" |
8 #include "src/identity-map.h" | 9 #include "src/identity-map.h" |
9 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
10 #include "src/zone/zone-containers.h" | 11 #include "src/zone/zone-containers.h" |
11 | 12 |
12 namespace v8 { | 13 namespace v8 { |
13 namespace internal { | 14 namespace internal { |
14 | 15 |
15 class Isolate; | 16 class Isolate; |
16 | 17 |
17 namespace interpreter { | 18 namespace interpreter { |
18 | 19 |
19 // A helper class for constructing constant arrays for the | 20 // A helper class for constructing constant arrays for the |
20 // interpreter. Each instance of this class is intended to be used to | 21 // interpreter. Each instance of this class is intended to be used to |
21 // generate exactly one FixedArray of constants via the ToFixedArray | 22 // generate exactly one FixedArray of constants via the ToFixedArray |
22 // method. | 23 // method. |
23 class ConstantArrayBuilder final BASE_EMBEDDED { | 24 class V8_EXPORT_PRIVATE ConstantArrayBuilder final BASE_EMBEDDED { |
24 public: | 25 public: |
25 // Capacity of the 8-bit operand slice. | 26 // Capacity of the 8-bit operand slice. |
26 static const size_t k8BitCapacity = 1u << kBitsPerByte; | 27 static const size_t k8BitCapacity = 1u << kBitsPerByte; |
27 | 28 |
28 // Capacity of the 16-bit operand slice. | 29 // Capacity of the 16-bit operand slice. |
29 static const size_t k16BitCapacity = (1u << 2 * kBitsPerByte) - k8BitCapacity; | 30 static const size_t k16BitCapacity = (1u << 2 * kBitsPerByte) - k8BitCapacity; |
30 | 31 |
31 // Capacity of the 32-bit operand slice. | 32 // Capacity of the 32-bit operand slice. |
32 static const size_t k32BitCapacity = | 33 static const size_t k32BitCapacity = |
33 kMaxUInt32 - k16BitCapacity - k8BitCapacity + 1; | 34 kMaxUInt32 - k16BitCapacity - k8BitCapacity + 1; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 ZoneVector<std::pair<Smi*, index_t>> smi_pairs_; | 115 ZoneVector<std::pair<Smi*, index_t>> smi_pairs_; |
115 Zone* zone_; | 116 Zone* zone_; |
116 Handle<Object> the_hole_value_; | 117 Handle<Object> the_hole_value_; |
117 }; | 118 }; |
118 | 119 |
119 } // namespace interpreter | 120 } // namespace interpreter |
120 } // namespace internal | 121 } // namespace internal |
121 } // namespace v8 | 122 } // namespace v8 |
122 | 123 |
123 #endif // V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ | 124 #endif // V8_INTERPRETER_CONSTANT_ARRAY_BUILDER_H_ |
OLD | NEW |