Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: src/objects/literal-objects.h

Issue 2811183005: Do not use new struct type where unnecessary. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 Tuple2 {
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. 50 static const int kElementsKindOffset = kValue1Offset;
51 DECLARE_PRINTER(ConstantElementsPair) 51 static const int kConstantValuesOffset = kValue2Offset;
52 DECLARE_VERIFIER(ConstantElementsPair)
53
54 static const int kElementsKindOffset = HeapObject::kHeaderSize;
55 static const int kConstantValuesOffset = kElementsKindOffset + kPointerSize;
56 static const int kSize = kConstantValuesOffset + kPointerSize;
57 52
58 private: 53 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair); 54 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair);
60 }; 55 };
61 56
62 } // namespace internal 57 } // namespace internal
63 } // namespace v8 58 } // namespace v8
64 59
65 #include "src/objects/object-macros-undef.h" 60 #include "src/objects/object-macros-undef.h"
66 61
67 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_ 62 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | test/cctest/interpreter/bytecode_expectations/ArrayLiterals.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698