| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 Handle<Name> name() const { return name_; } | 85 Handle<Name> name() const { return name_; } |
| 86 | 86 |
| 87 bool IsFound() const { return state_ != NOT_FOUND; } | 87 bool IsFound() const { return state_ != NOT_FOUND; } |
| 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<JSObject> GetHolder() const { | 96 Handle<JSObject> GetHolder() const { |
| 96 ASSERT(IsFound() && state_ != JSPROXY); | 97 ASSERT(IsFound() && state_ != JSPROXY); |
| 97 return Handle<JSObject>::cast(maybe_holder_.ToHandleChecked()); | 98 return Handle<JSObject>::cast(maybe_holder_.ToHandleChecked()); |
| 98 } | 99 } |
| 99 Handle<JSReceiver> GetRoot() const; | 100 Handle<JSReceiver> GetRoot() const; |
| 101 bool HolderIsReceiver() const; |
| 100 | 102 |
| 101 /* Dynamically reduce the trapped types. */ | 103 /* Dynamically reduce the trapped types. */ |
| 102 void skip_interceptor() { | 104 void skip_interceptor() { |
| 103 configuration_ = static_cast<Configuration>( | 105 configuration_ = static_cast<Configuration>( |
| 104 configuration_ & ~CHECK_INTERCEPTOR); | 106 configuration_ & ~CHECK_INTERCEPTOR); |
| 105 } | 107 } |
| 106 void skip_access_check() { | 108 void skip_access_check() { |
| 107 configuration_ = static_cast<Configuration>( | 109 configuration_ = static_cast<Configuration>( |
| 108 configuration_ & ~CHECK_ACCESS_CHECK); | 110 configuration_ & ~CHECK_ACCESS_CHECK); |
| 109 } | 111 } |
| 110 | 112 |
| 111 /* ACCESS_CHECK */ | 113 /* ACCESS_CHECK */ |
| 112 bool HasAccess(v8::AccessType access_type) const; | 114 bool HasAccess(v8::AccessType access_type) const; |
| 113 | 115 |
| 114 /* PROPERTY */ | 116 /* PROPERTY */ |
| 115 // HasProperty needs to be called before any of the other PROPERTY methods | 117 // HasProperty needs to be called before any of the other PROPERTY methods |
| 116 // below can be used. It ensures that we are able to provide a definite | 118 // below can be used. It ensures that we are able to provide a definite |
| 117 // answer, and loads extra information about the property. | 119 // answer, and loads extra information about the property. |
| 118 bool HasProperty(); | 120 bool HasProperty(); |
| 121 void PrepareForDataProperty(Handle<Object> value); |
| 122 void TransitionToDataProperty(Handle<Object> value, |
| 123 PropertyAttributes attributes, |
| 124 Object::StoreFromKeyed store_mode); |
| 119 PropertyKind property_kind() const { | 125 PropertyKind property_kind() const { |
| 120 ASSERT(has_property_); | 126 ASSERT(has_property_); |
| 121 return property_kind_; | 127 return property_kind_; |
| 122 } | 128 } |
| 123 PropertyDetails property_details() const { | 129 PropertyDetails property_details() const { |
| 124 ASSERT(has_property_); | 130 ASSERT(has_property_); |
| 125 return property_details_; | 131 return property_details_; |
| 126 } | 132 } |
| 133 int descriptor_number() const { |
| 134 ASSERT(has_property_); |
| 135 ASSERT_EQ(DESCRIPTOR, property_encoding_); |
| 136 return number_; |
| 137 } |
| 127 Handle<Object> GetAccessors() const; | 138 Handle<Object> GetAccessors() const; |
| 128 Handle<Object> GetDataValue() const; | 139 Handle<Object> GetDataValue() const; |
| 140 void WriteDataValue(Handle<Object> value); |
| 141 |
| 142 void InternalizeName(); |
| 129 | 143 |
| 130 /* JSPROXY */ | 144 /* JSPROXY */ |
| 131 | |
| 132 Handle<JSProxy> GetJSProxy() const { | 145 Handle<JSProxy> GetJSProxy() const { |
| 133 return Handle<JSProxy>::cast(maybe_holder_.ToHandleChecked()); | 146 return Handle<JSProxy>::cast(maybe_holder_.ToHandleChecked()); |
| 134 } | 147 } |
| 135 | 148 |
| 136 private: | 149 private: |
| 137 Handle<Map> GetReceiverMap() const; | 150 Handle<Map> GetReceiverMap() const; |
| 138 | 151 |
| 139 MUST_USE_RESULT bool NextHolder(); | 152 MUST_USE_RESULT bool NextHolder(); |
| 140 State LookupInHolder(); | 153 State LookupInHolder(); |
| 141 Handle<Object> FetchValue() const; | 154 Handle<Object> FetchValue() const; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 MaybeHandle<Object> maybe_receiver_; | 187 MaybeHandle<Object> maybe_receiver_; |
| 175 MaybeHandle<JSReceiver> maybe_holder_; | 188 MaybeHandle<JSReceiver> maybe_holder_; |
| 176 | 189 |
| 177 int number_; | 190 int number_; |
| 178 }; | 191 }; |
| 179 | 192 |
| 180 | 193 |
| 181 } } // namespace v8::internal | 194 } } // namespace v8::internal |
| 182 | 195 |
| 183 #endif // V8_LOOKUP_H_ | 196 #endif // V8_LOOKUP_H_ |
| OLD | NEW |