OLD | NEW |
---|---|
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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_OBJECTS_LITERAL_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_LITERAL_OBJECTS_H_ |
6 #define V8_OBJECTS_LITERAL_OBJECTS_H_ | 6 #define V8_OBJECTS_LITERAL_OBJECTS_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 // Has to be the last include (doesn't have include guards): | 10 // Has to be the last include (doesn't have include guards): |
(...skipping 22 matching lines...) Expand all Loading... | |
33 | 33 |
34 DECLARE_CAST(BoilerplateDescription) | 34 DECLARE_CAST(BoilerplateDescription) |
35 | 35 |
36 private: | 36 private: |
37 bool has_number_of_properties() const; | 37 bool has_number_of_properties() const; |
38 }; | 38 }; |
39 | 39 |
40 // Pair of {ElementsKind} and an array of constant values for {ArrayLiteral} | 40 // Pair of {ElementsKind} and an array of constant values for {ArrayLiteral} |
41 // expressions. Used to communicate with the runtime for literal boilerplate | 41 // expressions. Used to communicate with the runtime for literal boilerplate |
42 // creation within the {Runtime_CreateArrayLiteral} method. | 42 // creation within the {Runtime_CreateArrayLiteral} method. |
43 class ConstantElementsPair : public Struct { | 43 class ConstantElementsPair : public Struct { |
Michael Starzinger
2017/04/13 11:25:59
nit: Should inherit from Tuple2 now.
Yang
2017/04/13 11:53:33
Done.
| |
44 public: | 44 public: |
45 DECL_INT_ACCESSORS(elements_kind) | 45 DECL_INT_ACCESSORS(elements_kind) |
46 DECL_ACCESSORS(constant_values, FixedArrayBase) | 46 DECL_ACCESSORS(constant_values, FixedArrayBase) |
47 | 47 |
48 DECLARE_CAST(ConstantElementsPair) | 48 DECLARE_CAST(ConstantElementsPair) |
49 | 49 |
50 // Dispatched behavior. | |
51 DECLARE_PRINTER(ConstantElementsPair) | |
52 DECLARE_VERIFIER(ConstantElementsPair) | |
53 | |
54 static const int kElementsKindOffset = HeapObject::kHeaderSize; | 50 static const int kElementsKindOffset = HeapObject::kHeaderSize; |
55 static const int kConstantValuesOffset = kElementsKindOffset + kPointerSize; | 51 static const int kConstantValuesOffset = kElementsKindOffset + kPointerSize; |
Michael Starzinger
2017/04/13 11:25:59
Likewise.
Yang
2017/04/13 11:53:33
Done.
| |
56 static const int kSize = kConstantValuesOffset + kPointerSize; | 52 static const int kSize = kConstantValuesOffset + kPointerSize; |
57 | 53 |
58 private: | 54 private: |
59 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair); | 55 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair); |
60 }; | 56 }; |
61 | 57 |
62 } // namespace internal | 58 } // namespace internal |
63 } // namespace v8 | 59 } // namespace v8 |
64 | 60 |
65 #include "src/objects/object-macros-undef.h" | 61 #include "src/objects/object-macros-undef.h" |
66 | 62 |
67 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_ | 63 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_ |
OLD | NEW |