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

Side by Side Diff: src/compiler/access-info.h

Issue 2290233002: [turbofan] Introduce MachineRepresentation to PropertyAccessInfo. (Closed)
Patch Set: Created 4 years, 3 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 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_COMPILER_ACCESS_INFO_H_ 5 #ifndef V8_COMPILER_ACCESS_INFO_H_
6 #define V8_COMPILER_ACCESS_INFO_H_ 6 #define V8_COMPILER_ACCESS_INFO_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/field-index.h" 10 #include "src/field-index.h"
11 #include "src/machine-type.h"
11 #include "src/objects.h" 12 #include "src/objects.h"
12 #include "src/zone-containers.h" 13 #include "src/zone-containers.h"
13 14
14 namespace v8 { 15 namespace v8 {
15 namespace internal { 16 namespace internal {
16 17
17 // Forward declarations. 18 // Forward declarations.
18 class CompilationDependencies; 19 class CompilationDependencies;
19 class Factory; 20 class Factory;
20 21
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 kDataField, 62 kDataField,
62 kAccessorConstant 63 kAccessorConstant
63 }; 64 };
64 65
65 static PropertyAccessInfo NotFound(MapList const& receiver_maps, 66 static PropertyAccessInfo NotFound(MapList const& receiver_maps,
66 MaybeHandle<JSObject> holder); 67 MaybeHandle<JSObject> holder);
67 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, 68 static PropertyAccessInfo DataConstant(MapList const& receiver_maps,
68 Handle<Object> constant, 69 Handle<Object> constant,
69 MaybeHandle<JSObject> holder); 70 MaybeHandle<JSObject> holder);
70 static PropertyAccessInfo DataField( 71 static PropertyAccessInfo DataField(
71 MapList const& receiver_maps, FieldIndex field_index, Type* field_type, 72 MapList const& receiver_maps, FieldIndex field_index,
73 MachineRepresentation representation, Type* field_type,
72 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), 74 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(),
73 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); 75 MaybeHandle<Map> transition_map = MaybeHandle<Map>());
74 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, 76 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps,
75 Handle<Object> constant, 77 Handle<Object> constant,
76 MaybeHandle<JSObject> holder); 78 MaybeHandle<JSObject> holder);
77 79
78 PropertyAccessInfo(); 80 PropertyAccessInfo();
79 81
80 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; 82 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT;
81 83
82 bool IsNotFound() const { return kind() == kNotFound; } 84 bool IsNotFound() const { return kind() == kNotFound; }
83 bool IsDataConstant() const { return kind() == kDataConstant; } 85 bool IsDataConstant() const { return kind() == kDataConstant; }
84 bool IsDataField() const { return kind() == kDataField; } 86 bool IsDataField() const { return kind() == kDataField; }
85 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } 87 bool IsAccessorConstant() const { return kind() == kAccessorConstant; }
86 88
87 bool HasTransitionMap() const { return !transition_map().is_null(); } 89 bool HasTransitionMap() const { return !transition_map().is_null(); }
88 90
89 Kind kind() const { return kind_; } 91 Kind kind() const { return kind_; }
90 MaybeHandle<JSObject> holder() const { return holder_; } 92 MaybeHandle<JSObject> holder() const { return holder_; }
91 MaybeHandle<Map> transition_map() const { return transition_map_; } 93 MaybeHandle<Map> transition_map() const { return transition_map_; }
92 Handle<Object> constant() const { return constant_; } 94 Handle<Object> constant() const { return constant_; }
93 FieldIndex field_index() const { return field_index_; } 95 FieldIndex field_index() const { return field_index_; }
94 Type* field_type() const { return field_type_; } 96 Type* field_type() const { return field_type_; }
97 MachineRepresentation representation() const { return representation_; }
Benedikt Meurer 2016/08/30 17:14:49 Nit: Can you rename to field_representation?
mvstanton 2016/08/30 18:59:34 Done.
95 MapList const& receiver_maps() const { return receiver_maps_; } 98 MapList const& receiver_maps() const { return receiver_maps_; }
96 99
97 private: 100 private:
98 PropertyAccessInfo(MaybeHandle<JSObject> holder, 101 PropertyAccessInfo(MaybeHandle<JSObject> holder,
99 MapList const& receiver_maps); 102 MapList const& receiver_maps);
100 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder, 103 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder,
101 Handle<Object> constant, MapList const& receiver_maps); 104 Handle<Object> constant, MapList const& receiver_maps);
102 PropertyAccessInfo(MaybeHandle<JSObject> holder, 105 PropertyAccessInfo(MaybeHandle<JSObject> holder,
103 MaybeHandle<Map> transition_map, FieldIndex field_index, 106 MaybeHandle<Map> transition_map, FieldIndex field_index,
104 Type* field_type, MapList const& receiver_maps); 107 MachineRepresentation representation, Type* field_type,
Benedikt Meurer 2016/08/30 17:14:49 Nit: Can you rename to field_representation?
mvstanton 2016/08/30 18:59:34 Done.
108 MapList const& receiver_maps);
105 109
106 Kind kind_; 110 Kind kind_;
107 MapList receiver_maps_; 111 MapList receiver_maps_;
108 Handle<Object> constant_; 112 Handle<Object> constant_;
109 MaybeHandle<Map> transition_map_; 113 MaybeHandle<Map> transition_map_;
110 MaybeHandle<JSObject> holder_; 114 MaybeHandle<JSObject> holder_;
111 FieldIndex field_index_; 115 FieldIndex field_index_;
116 MachineRepresentation representation_;
Benedikt Meurer 2016/08/30 17:14:49 Nit: Can you rename to field_representation_?
mvstanton 2016/08/30 18:59:34 Done.
112 Type* field_type_; 117 Type* field_type_;
113 }; 118 };
114 119
115 120
116 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. 121 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s.
117 class AccessInfoFactory final { 122 class AccessInfoFactory final {
118 public: 123 public:
119 AccessInfoFactory(CompilationDependencies* dependencies, 124 AccessInfoFactory(CompilationDependencies* dependencies,
120 Handle<Context> native_context, Zone* zone); 125 Handle<Context> native_context, Zone* zone);
121 126
(...skipping 29 matching lines...) Expand all
151 Zone* const zone_; 156 Zone* const zone_;
152 157
153 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); 158 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory);
154 }; 159 };
155 160
156 } // namespace compiler 161 } // namespace compiler
157 } // namespace internal 162 } // namespace internal
158 } // namespace v8 163 } // namespace v8
159 164
160 #endif // V8_COMPILER_ACCESS_INFO_H_ 165 #endif // V8_COMPILER_ACCESS_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698