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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 Handle<Object> LookupIterator::FetchValue() const { | 253 Handle<Object> LookupIterator::FetchValue() const { |
254 Object* result = NULL; | 254 Object* result = NULL; |
255 Handle<JSObject> holder = GetHolder<JSObject>(); | 255 Handle<JSObject> holder = GetHolder<JSObject>(); |
256 if (holder_map_->is_dictionary_map()) { | 256 if (holder_map_->is_dictionary_map()) { |
257 result = holder->property_dictionary()->ValueAt(number_); | 257 result = holder->property_dictionary()->ValueAt(number_); |
258 if (holder_map_->IsGlobalObjectMap()) { | 258 if (holder_map_->IsGlobalObjectMap()) { |
| 259 DCHECK(result->IsPropertyCell()); |
259 result = PropertyCell::cast(result)->value(); | 260 result = PropertyCell::cast(result)->value(); |
260 } | 261 } |
261 } else if (property_details_.type() == v8::internal::DATA) { | 262 } else if (property_details_.type() == v8::internal::DATA) { |
262 FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_); | 263 FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_); |
263 return JSObject::FastPropertyAt(holder, property_details_.representation(), | 264 return JSObject::FastPropertyAt(holder, property_details_.representation(), |
264 field_index); | 265 field_index); |
265 } else { | 266 } else { |
266 result = holder_map_->instance_descriptors()->GetValue(number_); | 267 result = holder_map_->instance_descriptors()->GetValue(number_); |
267 } | 268 } |
268 return handle(result, isolate_); | 269 return handle(result, isolate_); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 return handle( | 304 return handle( |
304 holder_map_->instance_descriptors()->GetFieldType(descriptor_number()), | 305 holder_map_->instance_descriptors()->GetFieldType(descriptor_number()), |
305 isolate_); | 306 isolate_); |
306 } | 307 } |
307 | 308 |
308 | 309 |
309 Handle<PropertyCell> LookupIterator::GetPropertyCell() const { | 310 Handle<PropertyCell> LookupIterator::GetPropertyCell() const { |
310 Handle<JSObject> holder = GetHolder<JSObject>(); | 311 Handle<JSObject> holder = GetHolder<JSObject>(); |
311 Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder); | 312 Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder); |
312 Object* value = global->property_dictionary()->ValueAt(dictionary_entry()); | 313 Object* value = global->property_dictionary()->ValueAt(dictionary_entry()); |
| 314 DCHECK(value->IsPropertyCell()); |
313 return Handle<PropertyCell>(PropertyCell::cast(value)); | 315 return Handle<PropertyCell>(PropertyCell::cast(value)); |
314 } | 316 } |
315 | 317 |
316 | 318 |
317 Handle<Object> LookupIterator::GetAccessors() const { | 319 Handle<Object> LookupIterator::GetAccessors() const { |
318 DCHECK_EQ(ACCESSOR, state_); | 320 DCHECK_EQ(ACCESSOR, state_); |
319 return FetchValue(); | 321 return FetchValue(); |
320 } | 322 } |
321 | 323 |
322 | 324 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // Fall through. | 386 // Fall through. |
385 case InterceptorState::kSkipNonMasking: | 387 case InterceptorState::kSkipNonMasking: |
386 return true; | 388 return true; |
387 case InterceptorState::kProcessNonMasking: | 389 case InterceptorState::kProcessNonMasking: |
388 return false; | 390 return false; |
389 } | 391 } |
390 } | 392 } |
391 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 393 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
392 } | 394 } |
393 } } // namespace v8::internal | 395 } } // namespace v8::internal |
OLD | NEW |