OLD | NEW |
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_LOOKUP_H_ | 5 #ifndef V8_LOOKUP_H_ |
6 #define V8_LOOKUP_H_ | 6 #define V8_LOOKUP_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 void Next(); | 88 void Next(); |
89 | 89 |
90 Heap* heap() const { return isolate_->heap(); } | 90 Heap* heap() const { return isolate_->heap(); } |
91 Factory* factory() const { return isolate_->factory(); } | 91 Factory* factory() const { return isolate_->factory(); } |
92 Handle<Object> GetReceiver() const { | 92 Handle<Object> GetReceiver() const { |
93 return Handle<Object>::cast(maybe_receiver_.ToHandleChecked()); | 93 return Handle<Object>::cast(maybe_receiver_.ToHandleChecked()); |
94 } | 94 } |
95 Handle<Map> holder_map() const { return holder_map_; } | 95 Handle<Map> holder_map() const { return holder_map_; } |
96 template <class T> | 96 template <class T> |
97 Handle<T> GetHolder() const { | 97 Handle<T> GetHolder() const { |
98 ASSERT(IsFound()); | 98 DCHECK(IsFound()); |
99 return Handle<T>::cast(maybe_holder_.ToHandleChecked()); | 99 return Handle<T>::cast(maybe_holder_.ToHandleChecked()); |
100 } | 100 } |
101 Handle<JSReceiver> GetRoot() const; | 101 Handle<JSReceiver> GetRoot() const; |
102 bool HolderIsReceiverOrHiddenPrototype() const; | 102 bool HolderIsReceiverOrHiddenPrototype() const; |
103 | 103 |
104 /* Dynamically reduce the trapped types. */ | 104 /* Dynamically reduce the trapped types. */ |
105 void skip_interceptor() { | 105 void skip_interceptor() { |
106 configuration_ = static_cast<Configuration>( | 106 configuration_ = static_cast<Configuration>( |
107 configuration_ & ~CHECK_INTERCEPTOR); | 107 configuration_ & ~CHECK_INTERCEPTOR); |
108 } | 108 } |
109 void skip_access_check() { | 109 void skip_access_check() { |
110 configuration_ = static_cast<Configuration>( | 110 configuration_ = static_cast<Configuration>( |
111 configuration_ & ~CHECK_ACCESS_CHECK); | 111 configuration_ & ~CHECK_ACCESS_CHECK); |
112 } | 112 } |
113 | 113 |
114 /* ACCESS_CHECK */ | 114 /* ACCESS_CHECK */ |
115 bool HasAccess(v8::AccessType access_type) const; | 115 bool HasAccess(v8::AccessType access_type) const; |
116 | 116 |
117 /* PROPERTY */ | 117 /* PROPERTY */ |
118 // HasProperty needs to be called before any of the other PROPERTY methods | 118 // HasProperty needs to be called before any of the other PROPERTY methods |
119 // below can be used. It ensures that we are able to provide a definite | 119 // below can be used. It ensures that we are able to provide a definite |
120 // answer, and loads extra information about the property. | 120 // answer, and loads extra information about the property. |
121 bool HasProperty(); | 121 bool HasProperty(); |
122 void PrepareForDataProperty(Handle<Object> value); | 122 void PrepareForDataProperty(Handle<Object> value); |
123 void TransitionToDataProperty(Handle<Object> value, | 123 void TransitionToDataProperty(Handle<Object> value, |
124 PropertyAttributes attributes, | 124 PropertyAttributes attributes, |
125 Object::StoreFromKeyed store_mode); | 125 Object::StoreFromKeyed store_mode); |
126 PropertyKind property_kind() const { | 126 PropertyKind property_kind() const { |
127 ASSERT(has_property_); | 127 DCHECK(has_property_); |
128 return property_kind_; | 128 return property_kind_; |
129 } | 129 } |
130 PropertyEncoding property_encoding() const { | 130 PropertyEncoding property_encoding() const { |
131 ASSERT(has_property_); | 131 DCHECK(has_property_); |
132 return property_encoding_; | 132 return property_encoding_; |
133 } | 133 } |
134 PropertyDetails property_details() const { | 134 PropertyDetails property_details() const { |
135 ASSERT(has_property_); | 135 DCHECK(has_property_); |
136 return property_details_; | 136 return property_details_; |
137 } | 137 } |
138 bool IsConfigurable() const { return !property_details().IsDontDelete(); } | 138 bool IsConfigurable() const { return !property_details().IsDontDelete(); } |
139 Representation representation() const { | 139 Representation representation() const { |
140 return property_details().representation(); | 140 return property_details().representation(); |
141 } | 141 } |
142 FieldIndex GetFieldIndex() const; | 142 FieldIndex GetFieldIndex() const; |
143 Handle<PropertyCell> GetPropertyCell() const; | 143 Handle<PropertyCell> GetPropertyCell() const; |
144 Handle<Object> GetAccessors() const; | 144 Handle<Object> GetAccessors() const; |
145 Handle<Object> GetDataValue() const; | 145 Handle<Object> GetDataValue() const; |
(...skipping 23 matching lines...) Expand all Loading... |
169 bool check_derived() const { | 169 bool check_derived() const { |
170 return (configuration_ & CHECK_DERIVED) != 0; | 170 return (configuration_ & CHECK_DERIVED) != 0; |
171 } | 171 } |
172 bool check_hidden() const { | 172 bool check_hidden() const { |
173 return (configuration_ & CHECK_HIDDEN) != 0; | 173 return (configuration_ & CHECK_HIDDEN) != 0; |
174 } | 174 } |
175 bool check_access_check() const { | 175 bool check_access_check() const { |
176 return (configuration_ & CHECK_ACCESS_CHECK) != 0; | 176 return (configuration_ & CHECK_ACCESS_CHECK) != 0; |
177 } | 177 } |
178 int descriptor_number() const { | 178 int descriptor_number() const { |
179 ASSERT(has_property_); | 179 DCHECK(has_property_); |
180 ASSERT_EQ(DESCRIPTOR, property_encoding_); | 180 DCHECK_EQ(DESCRIPTOR, property_encoding_); |
181 return number_; | 181 return number_; |
182 } | 182 } |
183 int dictionary_entry() const { | 183 int dictionary_entry() const { |
184 ASSERT(has_property_); | 184 DCHECK(has_property_); |
185 ASSERT_EQ(DICTIONARY, property_encoding_); | 185 DCHECK_EQ(DICTIONARY, property_encoding_); |
186 return number_; | 186 return number_; |
187 } | 187 } |
188 | 188 |
189 Configuration configuration_; | 189 Configuration configuration_; |
190 State state_; | 190 State state_; |
191 bool has_property_; | 191 bool has_property_; |
192 PropertyKind property_kind_; | 192 PropertyKind property_kind_; |
193 PropertyEncoding property_encoding_; | 193 PropertyEncoding property_encoding_; |
194 PropertyDetails property_details_; | 194 PropertyDetails property_details_; |
195 Isolate* isolate_; | 195 Isolate* isolate_; |
196 Handle<Name> name_; | 196 Handle<Name> name_; |
197 Handle<Map> holder_map_; | 197 Handle<Map> holder_map_; |
198 MaybeHandle<Object> maybe_receiver_; | 198 MaybeHandle<Object> maybe_receiver_; |
199 MaybeHandle<JSReceiver> maybe_holder_; | 199 MaybeHandle<JSReceiver> maybe_holder_; |
200 | 200 |
201 int number_; | 201 int number_; |
202 }; | 202 }; |
203 | 203 |
204 | 204 |
205 } } // namespace v8::internal | 205 } } // namespace v8::internal |
206 | 206 |
207 #endif // V8_LOOKUP_H_ | 207 #endif // V8_LOOKUP_H_ |
OLD | NEW |