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

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

Issue 2663513002: [objects.h splitting] Move out ConstantElementsPair and BoileplateDescriptor. (Closed)
Patch Set: moving constant_elements_kind to ast.cc Created 3 years, 10 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
« no previous file with comments | « src/objects-inl.h ('k') | src/objects/literal-objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_OBJECTS_LITERAL_OBJECTS_H_
6 #define V8_OBJECTS_LITERAL_OBJECTS_H_
7
8 #include "src/objects.h"
9
10 // Has to be the last include (doesn't have include guards):
11 #include "src/objects/object-macros.h"
12
13 namespace v8 {
14 namespace internal {
15
16 // BoilerplateDescription is a list of properties consisting of name value
17 // pairs. In addition to the properties, it provides the projected number
18 // of properties in the backing store. This number includes properties with
19 // computed names that are not
20 // in the list.
21 class BoilerplateDescription : public FixedArray {
22 public:
23 Object* name(int index) const;
24 Object* value(int index) const;
25
26 // The number of boilerplate properties.
27 int size() const;
28
29 // Number of boilerplate properties and properties with computed names.
30 int backing_store_size() const;
31
32 void set_backing_store_size(Isolate* isolate, int backing_store_size);
33
34 DECLARE_CAST(BoilerplateDescription)
35
36 private:
37 bool has_number_of_properties() const;
38 };
39
40 // Pair of {ElementsKind} and an array of constant values for {ArrayLiteral}
41 // expressions. Used to communicate with the runtime for literal boilerplate
42 // creation within the {Runtime_CreateArrayLiteral} method.
43 class ConstantElementsPair : public Struct {
44 public:
45 DECL_INT_ACCESSORS(elements_kind)
46 DECL_ACCESSORS(constant_values, FixedArrayBase)
47
48 DECLARE_CAST(ConstantElementsPair)
49
50 // Dispatched behavior.
51 DECLARE_PRINTER(ConstantElementsPair)
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
58 private:
59 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair);
60 };
61
62 } // namespace internal
63 } // namespace v8
64
65 #include "src/objects/object-macros-undef.h"
66
67 #endif // V8_OBJECTS_LITERAL_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/objects/literal-objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698