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

Side by Side Diff: src/property.h

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Addressing comments Created 3 years, 11 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-printer.cc ('k') | src/property-descriptor.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PROPERTY_H_ 5 #ifndef V8_PROPERTY_H_
6 #define V8_PROPERTY_H_ 6 #define V8_PROPERTY_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/factory.h" 10 #include "src/factory.h"
11 #include "src/isolate.h" 11 #include "src/isolate.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 // Abstraction for elements in instance-descriptor arrays. 16 // Abstraction for elements in instance-descriptor arrays.
17 // 17 //
18 // Each descriptor has a key, property attributes, property type, 18 // Each descriptor has a key, property attributes, property type,
19 // property index (in the actual instance-descriptor array) and 19 // property index (in the actual instance-descriptor array) and
20 // optionally a piece of data. 20 // optionally a piece of data.
21 class Descriptor final BASE_EMBEDDED { 21 class Descriptor final BASE_EMBEDDED {
22 public: 22 public:
23 Descriptor() : details_(Smi::kZero) {}
24
23 Handle<Name> GetKey() const { return key_; } 25 Handle<Name> GetKey() const { return key_; }
24 Handle<Object> GetValue() const { return value_; } 26 Handle<Object> GetValue() const { return value_; }
25 PropertyDetails GetDetails() const { return details_; } 27 PropertyDetails GetDetails() const { return details_; }
26 28
27 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); } 29 void SetSortedKeyIndex(int index) { details_ = details_.set_pointer(index); }
28 30
29 static Descriptor DataField(Handle<Name> key, int field_index, 31 static Descriptor DataField(Handle<Name> key, int field_index,
30 PropertyAttributes attributes, 32 PropertyAttributes attributes,
31 Representation representation); 33 Representation representation);
32 34
(...skipping 17 matching lines...) Expand all
50 return Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, 52 return Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT,
51 Representation::Tagged()); 53 Representation::Tagged());
52 } 54 }
53 55
54 private: 56 private:
55 Handle<Name> key_; 57 Handle<Name> key_;
56 Handle<Object> value_; 58 Handle<Object> value_;
57 PropertyDetails details_; 59 PropertyDetails details_;
58 60
59 protected: 61 protected:
60 Descriptor() : details_(Smi::kZero) {}
61
62 void Init(Handle<Name> key, Handle<Object> value, PropertyDetails details) { 62 void Init(Handle<Name> key, Handle<Object> value, PropertyDetails details) {
63 DCHECK(key->IsUniqueName()); 63 DCHECK(key->IsUniqueName());
64 DCHECK_IMPLIES(key->IsPrivate(), !details.IsEnumerable()); 64 DCHECK_IMPLIES(key->IsPrivate(), !details.IsEnumerable());
65 key_ = key; 65 key_ = key;
66 value_ = value; 66 value_ = value;
67 details_ = details; 67 details_ = details;
68 } 68 }
69 69
70 Descriptor(Handle<Name> key, Handle<Object> value, PropertyDetails details) 70 Descriptor(Handle<Name> key, Handle<Object> value, PropertyDetails details)
71 : key_(key), value_(value), details_(details) { 71 : key_(key), value_(value), details_(details) {
(...skipping 15 matching lines...) Expand all
87 friend class Map; 87 friend class Map;
88 friend class MapUpdater; 88 friend class MapUpdater;
89 }; 89 };
90 90
91 std::ostream& operator<<(std::ostream& os, const Descriptor& d); 91 std::ostream& operator<<(std::ostream& os, const Descriptor& d);
92 92
93 } // namespace internal 93 } // namespace internal
94 } // namespace v8 94 } // namespace v8
95 95
96 #endif // V8_PROPERTY_H_ 96 #endif // V8_PROPERTY_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/property-descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698