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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 } | 412 } |
413 | 413 |
414 | 414 |
415 Handle<Object> LookupIterator::GetDataValue() const { | 415 Handle<Object> LookupIterator::GetDataValue() const { |
416 DCHECK_EQ(DATA, state_); | 416 DCHECK_EQ(DATA, state_); |
417 Handle<Object> value = FetchValue(); | 417 Handle<Object> value = FetchValue(); |
418 return value; | 418 return value; |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 void LookupIterator::WriteDataValue(Handle<Object> value) { | 422 Handle<Object> LookupIterator::WriteDataValue(Handle<Object> value) { |
423 DCHECK_EQ(DATA, state_); | 423 DCHECK_EQ(DATA, state_); |
424 Handle<JSObject> holder = GetHolder<JSObject>(); | 424 Handle<JSObject> holder = GetHolder<JSObject>(); |
425 if (IsElement()) { | 425 if (IsElement()) { |
426 ElementsAccessor* accessor = holder->GetElementsAccessor(); | 426 ElementsAccessor* accessor = holder->GetElementsAccessor(); |
427 accessor->Set(holder, index_, value); | 427 return accessor->Set(holder, index_, value); |
428 } else if (holder->IsGlobalObject()) { | 428 } else if (holder->IsGlobalObject()) { |
429 Handle<GlobalDictionary> property_dictionary = | 429 Handle<GlobalDictionary> property_dictionary = |
430 handle(holder->global_dictionary()); | 430 handle(holder->global_dictionary()); |
431 PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value, | 431 PropertyCell::UpdateCell(property_dictionary, dictionary_entry(), value, |
432 property_details_); | 432 property_details_); |
433 } else if (holder_map_->is_dictionary_map()) { | 433 } else if (holder_map_->is_dictionary_map()) { |
434 Handle<NameDictionary> property_dictionary = | 434 Handle<NameDictionary> property_dictionary = |
435 handle(holder->property_dictionary()); | 435 handle(holder->property_dictionary()); |
436 property_dictionary->ValueAtPut(dictionary_entry(), *value); | 436 property_dictionary->ValueAtPut(dictionary_entry(), *value); |
437 } else if (property_details_.type() == v8::internal::DATA) { | 437 } else if (property_details_.type() == v8::internal::DATA) { |
438 holder->WriteToField(descriptor_number(), *value); | 438 holder->WriteToField(descriptor_number(), *value); |
439 } else { | 439 } else { |
440 DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type()); | 440 DCHECK_EQ(v8::internal::DATA_CONSTANT, property_details_.type()); |
441 } | 441 } |
| 442 return value; |
442 } | 443 } |
443 | 444 |
444 | 445 |
445 bool LookupIterator::IsIntegerIndexedExotic(JSReceiver* holder) { | 446 bool LookupIterator::IsIntegerIndexedExotic(JSReceiver* holder) { |
446 DCHECK(exotic_index_state_ != ExoticIndexState::kNotExotic); | 447 DCHECK(exotic_index_state_ != ExoticIndexState::kNotExotic); |
447 // Currently typed arrays are the only such objects. | 448 // Currently typed arrays are the only such objects. |
448 if (!holder->IsJSTypedArray()) return false; | 449 if (!holder->IsJSTypedArray()) return false; |
449 if (exotic_index_state_ == ExoticIndexState::kExotic) return true; | 450 if (exotic_index_state_ == ExoticIndexState::kExotic) return true; |
450 if (!InternalHolderIsReceiverOrHiddenPrototype()) { | 451 if (!InternalHolderIsReceiverOrHiddenPrototype()) { |
451 exotic_index_state_ = ExoticIndexState::kNotExotic; | 452 exotic_index_state_ = ExoticIndexState::kNotExotic; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 case InterceptorState::kSkipNonMasking: | 504 case InterceptorState::kSkipNonMasking: |
504 return true; | 505 return true; |
505 case InterceptorState::kProcessNonMasking: | 506 case InterceptorState::kProcessNonMasking: |
506 return false; | 507 return false; |
507 } | 508 } |
508 } | 509 } |
509 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 510 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
510 } | 511 } |
511 } // namespace internal | 512 } // namespace internal |
512 } // namespace v8 | 513 } // namespace v8 |
OLD | NEW |