OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 GetIsolate()->ReportFailedAccessCheck(this, v8::ACCESS_HAS); | 623 GetIsolate()->ReportFailedAccessCheck(this, v8::ACCESS_HAS); |
624 return ABSENT; | 624 return ABSENT; |
625 } | 625 } |
626 | 626 |
627 | 627 |
628 Object* JSObject::GetNormalizedProperty(LookupResult* result) { | 628 Object* JSObject::GetNormalizedProperty(LookupResult* result) { |
629 ASSERT(!HasFastProperties()); | 629 ASSERT(!HasFastProperties()); |
630 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); | 630 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); |
631 if (IsGlobalObject()) { | 631 if (IsGlobalObject()) { |
632 value = JSGlobalPropertyCell::cast(value)->value(); | 632 value = PropertyCell::cast(value)->value(); |
633 } | 633 } |
634 ASSERT(!value->IsJSGlobalPropertyCell() && !value->IsCell()); | 634 ASSERT(!value->IsPropertyCell() && !value->IsCell()); |
635 return value; | 635 return value; |
636 } | 636 } |
637 | 637 |
638 | 638 |
639 Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) { | 639 Object* JSObject::SetNormalizedProperty(LookupResult* result, Object* value) { |
640 ASSERT(!HasFastProperties()); | 640 ASSERT(!HasFastProperties()); |
641 if (IsGlobalObject()) { | 641 if (IsGlobalObject()) { |
642 JSGlobalPropertyCell* cell = JSGlobalPropertyCell::cast( | 642 PropertyCell* cell = PropertyCell::cast( |
643 property_dictionary()->ValueAt(result->GetDictionaryEntry())); | 643 property_dictionary()->ValueAt(result->GetDictionaryEntry())); |
644 cell->set_value(value); | 644 cell->set_value(value); |
645 } else { | 645 } else { |
646 property_dictionary()->ValueAtPut(result->GetDictionaryEntry(), value); | 646 property_dictionary()->ValueAtPut(result->GetDictionaryEntry(), value); |
647 } | 647 } |
648 return value; | 648 return value; |
649 } | 649 } |
650 | 650 |
651 | 651 |
652 Handle<Object> JSObject::SetNormalizedProperty(Handle<JSObject> object, | 652 Handle<Object> JSObject::SetNormalizedProperty(Handle<JSObject> object, |
653 Handle<Name> key, | 653 Handle<Name> key, |
654 Handle<Object> value, | 654 Handle<Object> value, |
655 PropertyDetails details) { | 655 PropertyDetails details) { |
656 CALL_HEAP_FUNCTION(object->GetIsolate(), | 656 CALL_HEAP_FUNCTION(object->GetIsolate(), |
657 object->SetNormalizedProperty(*key, *value, details), | 657 object->SetNormalizedProperty(*key, *value, details), |
658 Object); | 658 Object); |
659 } | 659 } |
660 | 660 |
661 | 661 |
662 MaybeObject* JSObject::SetNormalizedProperty(Name* name, | 662 MaybeObject* JSObject::SetNormalizedProperty(Name* name, |
663 Object* value, | 663 Object* value, |
664 PropertyDetails details) { | 664 PropertyDetails details) { |
665 ASSERT(!HasFastProperties()); | 665 ASSERT(!HasFastProperties()); |
666 int entry = property_dictionary()->FindEntry(name); | 666 int entry = property_dictionary()->FindEntry(name); |
667 if (entry == NameDictionary::kNotFound) { | 667 if (entry == NameDictionary::kNotFound) { |
668 Object* store_value = value; | 668 Object* store_value = value; |
669 if (IsGlobalObject()) { | 669 if (IsGlobalObject()) { |
670 Heap* heap = name->GetHeap(); | 670 Heap* heap = name->GetHeap(); |
671 MaybeObject* maybe_store_value = | 671 MaybeObject* maybe_store_value = |
672 heap->AllocateJSGlobalPropertyCell(value); | 672 heap->AllocatePropertyCell(value); |
673 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; | 673 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; |
674 } | 674 } |
675 Object* dict; | 675 Object* dict; |
676 { MaybeObject* maybe_dict = | 676 { MaybeObject* maybe_dict = |
677 property_dictionary()->Add(name, store_value, details); | 677 property_dictionary()->Add(name, store_value, details); |
678 if (!maybe_dict->ToObject(&dict)) return maybe_dict; | 678 if (!maybe_dict->ToObject(&dict)) return maybe_dict; |
679 } | 679 } |
680 set_properties(NameDictionary::cast(dict)); | 680 set_properties(NameDictionary::cast(dict)); |
681 return value; | 681 return value; |
682 } | 682 } |
683 | 683 |
684 PropertyDetails original_details = property_dictionary()->DetailsAt(entry); | 684 PropertyDetails original_details = property_dictionary()->DetailsAt(entry); |
685 int enumeration_index; | 685 int enumeration_index; |
686 // Preserve the enumeration index unless the property was deleted. | 686 // Preserve the enumeration index unless the property was deleted. |
687 if (original_details.IsDeleted()) { | 687 if (original_details.IsDeleted()) { |
688 enumeration_index = property_dictionary()->NextEnumerationIndex(); | 688 enumeration_index = property_dictionary()->NextEnumerationIndex(); |
689 property_dictionary()->SetNextEnumerationIndex(enumeration_index + 1); | 689 property_dictionary()->SetNextEnumerationIndex(enumeration_index + 1); |
690 } else { | 690 } else { |
691 enumeration_index = original_details.dictionary_index(); | 691 enumeration_index = original_details.dictionary_index(); |
692 ASSERT(enumeration_index > 0); | 692 ASSERT(enumeration_index > 0); |
693 } | 693 } |
694 | 694 |
695 details = PropertyDetails( | 695 details = PropertyDetails( |
696 details.attributes(), details.type(), enumeration_index); | 696 details.attributes(), details.type(), enumeration_index); |
697 | 697 |
698 if (IsGlobalObject()) { | 698 if (IsGlobalObject()) { |
699 JSGlobalPropertyCell* cell = | 699 PropertyCell* cell = |
700 JSGlobalPropertyCell::cast(property_dictionary()->ValueAt(entry)); | 700 PropertyCell::cast(property_dictionary()->ValueAt(entry)); |
701 cell->set_value(value); | 701 cell->set_value(value); |
702 // Please note we have to update the property details. | 702 // Please note we have to update the property details. |
703 property_dictionary()->DetailsAtPut(entry, details); | 703 property_dictionary()->DetailsAtPut(entry, details); |
704 } else { | 704 } else { |
705 property_dictionary()->SetEntry(entry, name, value, details); | 705 property_dictionary()->SetEntry(entry, name, value, details); |
706 } | 706 } |
707 return value; | 707 return value; |
708 } | 708 } |
709 | 709 |
710 | 710 |
(...skipping 11 matching lines...) Expand all Loading... |
722 // map change to invalidate any ICs that think they can load | 722 // map change to invalidate any ICs that think they can load |
723 // from the DontDelete cell without checking if it contains | 723 // from the DontDelete cell without checking if it contains |
724 // the hole value. | 724 // the hole value. |
725 Map* new_map; | 725 Map* new_map; |
726 MaybeObject* maybe_new_map = map()->CopyDropDescriptors(); | 726 MaybeObject* maybe_new_map = map()->CopyDropDescriptors(); |
727 if (!maybe_new_map->To(&new_map)) return maybe_new_map; | 727 if (!maybe_new_map->To(&new_map)) return maybe_new_map; |
728 | 728 |
729 ASSERT(new_map->is_dictionary_map()); | 729 ASSERT(new_map->is_dictionary_map()); |
730 set_map(new_map); | 730 set_map(new_map); |
731 } | 731 } |
732 JSGlobalPropertyCell* cell = | 732 PropertyCell* cell = PropertyCell::cast(dictionary->ValueAt(entry)); |
733 JSGlobalPropertyCell::cast(dictionary->ValueAt(entry)); | |
734 cell->set_value(cell->GetHeap()->the_hole_value()); | 733 cell->set_value(cell->GetHeap()->the_hole_value()); |
735 dictionary->DetailsAtPut(entry, details.AsDeleted()); | 734 dictionary->DetailsAtPut(entry, details.AsDeleted()); |
736 } else { | 735 } else { |
737 Object* deleted = dictionary->DeleteProperty(entry, mode); | 736 Object* deleted = dictionary->DeleteProperty(entry, mode); |
738 if (deleted == GetHeap()->true_value()) { | 737 if (deleted == GetHeap()->true_value()) { |
739 FixedArray* new_properties = NULL; | 738 FixedArray* new_properties = NULL; |
740 MaybeObject* maybe_properties = dictionary->Shrink(name); | 739 MaybeObject* maybe_properties = dictionary->Shrink(name); |
741 if (!maybe_properties->To(&new_properties)) { | 740 if (!maybe_properties->To(&new_properties)) { |
742 return maybe_properties; | 741 return maybe_properties; |
743 } | 742 } |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 break; | 1564 break; |
1566 case FOREIGN_TYPE: | 1565 case FOREIGN_TYPE: |
1567 accumulator->Add("<Foreign>"); | 1566 accumulator->Add("<Foreign>"); |
1568 break; | 1567 break; |
1569 case CELL_TYPE: | 1568 case CELL_TYPE: |
1570 accumulator->Add("Cell for "); | 1569 accumulator->Add("Cell for "); |
1571 Cell::cast(this)->value()->ShortPrint(accumulator); | 1570 Cell::cast(this)->value()->ShortPrint(accumulator); |
1572 break; | 1571 break; |
1573 case PROPERTY_CELL_TYPE: | 1572 case PROPERTY_CELL_TYPE: |
1574 accumulator->Add("PropertyCell for "); | 1573 accumulator->Add("PropertyCell for "); |
1575 JSGlobalPropertyCell::cast(this)->value()->ShortPrint(accumulator); | 1574 PropertyCell::cast(this)->value()->ShortPrint(accumulator); |
1576 break; | 1575 break; |
1577 default: | 1576 default: |
1578 accumulator->Add("<Other heap object (%d)>", map()->instance_type()); | 1577 accumulator->Add("<Other heap object (%d)>", map()->instance_type()); |
1579 break; | 1578 break; |
1580 } | 1579 } |
1581 } | 1580 } |
1582 | 1581 |
1583 | 1582 |
1584 void HeapObject::Iterate(ObjectVisitor* v) { | 1583 void HeapObject::Iterate(ObjectVisitor* v) { |
1585 // Handle header | 1584 // Handle header |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 case MAP_TYPE: | 1660 case MAP_TYPE: |
1662 Map::BodyDescriptor::IterateBody(this, v); | 1661 Map::BodyDescriptor::IterateBody(this, v); |
1663 break; | 1662 break; |
1664 case CODE_TYPE: | 1663 case CODE_TYPE: |
1665 reinterpret_cast<Code*>(this)->CodeIterateBody(v); | 1664 reinterpret_cast<Code*>(this)->CodeIterateBody(v); |
1666 break; | 1665 break; |
1667 case CELL_TYPE: | 1666 case CELL_TYPE: |
1668 Cell::BodyDescriptor::IterateBody(this, v); | 1667 Cell::BodyDescriptor::IterateBody(this, v); |
1669 break; | 1668 break; |
1670 case PROPERTY_CELL_TYPE: | 1669 case PROPERTY_CELL_TYPE: |
1671 JSGlobalPropertyCell::BodyDescriptor::IterateBody(this, v); | 1670 PropertyCell::BodyDescriptor::IterateBody(this, v); |
1672 break; | 1671 break; |
1673 case SYMBOL_TYPE: | 1672 case SYMBOL_TYPE: |
1674 Symbol::BodyDescriptor::IterateBody(this, v); | 1673 Symbol::BodyDescriptor::IterateBody(this, v); |
1675 break; | 1674 break; |
1676 case HEAP_NUMBER_TYPE: | 1675 case HEAP_NUMBER_TYPE: |
1677 case FILLER_TYPE: | 1676 case FILLER_TYPE: |
1678 case BYTE_ARRAY_TYPE: | 1677 case BYTE_ARRAY_TYPE: |
1679 case FREE_SPACE_TYPE: | 1678 case FREE_SPACE_TYPE: |
1680 case EXTERNAL_PIXEL_ARRAY_TYPE: | 1679 case EXTERNAL_PIXEL_ARRAY_TYPE: |
1681 case EXTERNAL_BYTE_ARRAY_TYPE: | 1680 case EXTERNAL_BYTE_ARRAY_TYPE: |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 Object* value, | 1929 Object* value, |
1931 PropertyAttributes attributes) { | 1930 PropertyAttributes attributes) { |
1932 ASSERT(!HasFastProperties()); | 1931 ASSERT(!HasFastProperties()); |
1933 NameDictionary* dict = property_dictionary(); | 1932 NameDictionary* dict = property_dictionary(); |
1934 Object* store_value = value; | 1933 Object* store_value = value; |
1935 if (IsGlobalObject()) { | 1934 if (IsGlobalObject()) { |
1936 // In case name is an orphaned property reuse the cell. | 1935 // In case name is an orphaned property reuse the cell. |
1937 int entry = dict->FindEntry(name); | 1936 int entry = dict->FindEntry(name); |
1938 if (entry != NameDictionary::kNotFound) { | 1937 if (entry != NameDictionary::kNotFound) { |
1939 store_value = dict->ValueAt(entry); | 1938 store_value = dict->ValueAt(entry); |
1940 JSGlobalPropertyCell::cast(store_value)->set_value(value); | 1939 PropertyCell::cast(store_value)->set_value(value); |
1941 // Assign an enumeration index to the property and update | 1940 // Assign an enumeration index to the property and update |
1942 // SetNextEnumerationIndex. | 1941 // SetNextEnumerationIndex. |
1943 int index = dict->NextEnumerationIndex(); | 1942 int index = dict->NextEnumerationIndex(); |
1944 PropertyDetails details = PropertyDetails(attributes, NORMAL, index); | 1943 PropertyDetails details = PropertyDetails(attributes, NORMAL, index); |
1945 dict->SetNextEnumerationIndex(index + 1); | 1944 dict->SetNextEnumerationIndex(index + 1); |
1946 dict->SetEntry(entry, name, store_value, details); | 1945 dict->SetEntry(entry, name, store_value, details); |
1947 return value; | 1946 return value; |
1948 } | 1947 } |
1949 Heap* heap = GetHeap(); | 1948 Heap* heap = GetHeap(); |
1950 { MaybeObject* maybe_store_value = | 1949 { MaybeObject* maybe_store_value = |
1951 heap->AllocateJSGlobalPropertyCell(value); | 1950 heap->AllocatePropertyCell(value); |
1952 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; | 1951 if (!maybe_store_value->ToObject(&store_value)) return maybe_store_value; |
1953 } | 1952 } |
1954 JSGlobalPropertyCell::cast(store_value)->set_value(value); | 1953 PropertyCell::cast(store_value)->set_value(value); |
1955 } | 1954 } |
1956 PropertyDetails details = PropertyDetails(attributes, NORMAL, 0); | 1955 PropertyDetails details = PropertyDetails(attributes, NORMAL, 0); |
1957 Object* result; | 1956 Object* result; |
1958 { MaybeObject* maybe_result = dict->Add(name, store_value, details); | 1957 { MaybeObject* maybe_result = dict->Add(name, store_value, details); |
1959 if (!maybe_result->ToObject(&result)) return maybe_result; | 1958 if (!maybe_result->ToObject(&result)) return maybe_result; |
1960 } | 1959 } |
1961 if (dict != result) set_properties(NameDictionary::cast(result)); | 1960 if (dict != result) set_properties(NameDictionary::cast(result)); |
1962 return value; | 1961 return value; |
1963 } | 1962 } |
1964 | 1963 |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 | 3265 |
3267 int entry = property_dictionary()->FindEntry(name); | 3266 int entry = property_dictionary()->FindEntry(name); |
3268 if (entry != NameDictionary::kNotFound) { | 3267 if (entry != NameDictionary::kNotFound) { |
3269 Object* value = property_dictionary()->ValueAt(entry); | 3268 Object* value = property_dictionary()->ValueAt(entry); |
3270 if (IsGlobalObject()) { | 3269 if (IsGlobalObject()) { |
3271 PropertyDetails d = property_dictionary()->DetailsAt(entry); | 3270 PropertyDetails d = property_dictionary()->DetailsAt(entry); |
3272 if (d.IsDeleted()) { | 3271 if (d.IsDeleted()) { |
3273 result->NotFound(); | 3272 result->NotFound(); |
3274 return; | 3273 return; |
3275 } | 3274 } |
3276 value = JSGlobalPropertyCell::cast(value)->value(); | 3275 value = PropertyCell::cast(value)->value(); |
3277 } | 3276 } |
3278 // Make sure to disallow caching for uninitialized constants | 3277 // Make sure to disallow caching for uninitialized constants |
3279 // found in the dictionary-mode objects. | 3278 // found in the dictionary-mode objects. |
3280 if (value->IsTheHole()) result->DisallowCaching(); | 3279 if (value->IsTheHole()) result->DisallowCaching(); |
3281 result->DictionaryResult(this, entry); | 3280 result->DictionaryResult(this, entry); |
3282 return; | 3281 return; |
3283 } | 3282 } |
3284 | 3283 |
3285 result->NotFound(); | 3284 result->NotFound(); |
3286 } | 3285 } |
(...skipping 10965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14252 // Clamp undefined to NaN (default). All other types have been | 14251 // Clamp undefined to NaN (default). All other types have been |
14253 // converted to a number type further up in the call chain. | 14252 // converted to a number type further up in the call chain. |
14254 ASSERT(value->IsUndefined()); | 14253 ASSERT(value->IsUndefined()); |
14255 } | 14254 } |
14256 set(index, double_value); | 14255 set(index, double_value); |
14257 } | 14256 } |
14258 return heap->AllocateHeapNumber(double_value); | 14257 return heap->AllocateHeapNumber(double_value); |
14259 } | 14258 } |
14260 | 14259 |
14261 | 14260 |
14262 JSGlobalPropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { | 14261 PropertyCell* GlobalObject::GetPropertyCell(LookupResult* result) { |
14263 ASSERT(!HasFastProperties()); | 14262 ASSERT(!HasFastProperties()); |
14264 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); | 14263 Object* value = property_dictionary()->ValueAt(result->GetDictionaryEntry()); |
14265 return JSGlobalPropertyCell::cast(value); | 14264 return PropertyCell::cast(value); |
14266 } | 14265 } |
14267 | 14266 |
14268 | 14267 |
14269 Handle<JSGlobalPropertyCell> GlobalObject::EnsurePropertyCell( | 14268 Handle<PropertyCell> GlobalObject::EnsurePropertyCell( |
14270 Handle<GlobalObject> global, | 14269 Handle<GlobalObject> global, |
14271 Handle<Name> name) { | 14270 Handle<Name> name) { |
14272 Isolate* isolate = global->GetIsolate(); | 14271 Isolate* isolate = global->GetIsolate(); |
14273 CALL_HEAP_FUNCTION(isolate, | 14272 CALL_HEAP_FUNCTION(isolate, |
14274 global->EnsurePropertyCell(*name), | 14273 global->EnsurePropertyCell(*name), |
14275 JSGlobalPropertyCell); | 14274 PropertyCell); |
14276 } | 14275 } |
14277 | 14276 |
14278 | 14277 |
14279 MaybeObject* GlobalObject::EnsurePropertyCell(Name* name) { | 14278 MaybeObject* GlobalObject::EnsurePropertyCell(Name* name) { |
14280 ASSERT(!HasFastProperties()); | 14279 ASSERT(!HasFastProperties()); |
14281 int entry = property_dictionary()->FindEntry(name); | 14280 int entry = property_dictionary()->FindEntry(name); |
14282 if (entry == NameDictionary::kNotFound) { | 14281 if (entry == NameDictionary::kNotFound) { |
14283 Heap* heap = GetHeap(); | 14282 Heap* heap = GetHeap(); |
14284 Object* cell; | 14283 Object* cell; |
14285 { MaybeObject* maybe_cell = | 14284 { MaybeObject* maybe_cell = |
14286 heap->AllocateJSGlobalPropertyCell(heap->the_hole_value()); | 14285 heap->AllocatePropertyCell(heap->the_hole_value()); |
14287 if (!maybe_cell->ToObject(&cell)) return maybe_cell; | 14286 if (!maybe_cell->ToObject(&cell)) return maybe_cell; |
14288 } | 14287 } |
14289 PropertyDetails details(NONE, NORMAL, 0); | 14288 PropertyDetails details(NONE, NORMAL, 0); |
14290 details = details.AsDeleted(); | 14289 details = details.AsDeleted(); |
14291 Object* dictionary; | 14290 Object* dictionary; |
14292 { MaybeObject* maybe_dictionary = | 14291 { MaybeObject* maybe_dictionary = |
14293 property_dictionary()->Add(name, cell, details); | 14292 property_dictionary()->Add(name, cell, details); |
14294 if (!maybe_dictionary->ToObject(&dictionary)) return maybe_dictionary; | 14293 if (!maybe_dictionary->ToObject(&dictionary)) return maybe_dictionary; |
14295 } | 14294 } |
14296 set_properties(NameDictionary::cast(dictionary)); | 14295 set_properties(NameDictionary::cast(dictionary)); |
14297 return cell; | 14296 return cell; |
14298 } else { | 14297 } else { |
14299 Object* value = property_dictionary()->ValueAt(entry); | 14298 Object* value = property_dictionary()->ValueAt(entry); |
14300 ASSERT(value->IsJSGlobalPropertyCell()); | 14299 ASSERT(value->IsPropertyCell()); |
14301 return value; | 14300 return value; |
14302 } | 14301 } |
14303 } | 14302 } |
14304 | 14303 |
14305 | 14304 |
14306 MaybeObject* StringTable::LookupString(String* string, Object** s) { | 14305 MaybeObject* StringTable::LookupString(String* string, Object** s) { |
14307 InternalizedStringKey key(string); | 14306 InternalizedStringKey key(string); |
14308 return LookupKey(&key, s); | 14307 return LookupKey(&key, s); |
14309 } | 14308 } |
14310 | 14309 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15073 | 15072 |
15074 | 15073 |
15075 // Backwards lookup (slow). | 15074 // Backwards lookup (slow). |
15076 template<typename Shape, typename Key> | 15075 template<typename Shape, typename Key> |
15077 Object* Dictionary<Shape, Key>::SlowReverseLookup(Object* value) { | 15076 Object* Dictionary<Shape, Key>::SlowReverseLookup(Object* value) { |
15078 int capacity = HashTable<Shape, Key>::Capacity(); | 15077 int capacity = HashTable<Shape, Key>::Capacity(); |
15079 for (int i = 0; i < capacity; i++) { | 15078 for (int i = 0; i < capacity; i++) { |
15080 Object* k = HashTable<Shape, Key>::KeyAt(i); | 15079 Object* k = HashTable<Shape, Key>::KeyAt(i); |
15081 if (Dictionary<Shape, Key>::IsKey(k)) { | 15080 if (Dictionary<Shape, Key>::IsKey(k)) { |
15082 Object* e = ValueAt(i); | 15081 Object* e = ValueAt(i); |
15083 if (e->IsJSGlobalPropertyCell()) { | 15082 if (e->IsPropertyCell()) { |
15084 e = JSGlobalPropertyCell::cast(e)->value(); | 15083 e = PropertyCell::cast(e)->value(); |
15085 } | 15084 } |
15086 if (e == value) return k; | 15085 if (e == value) return k; |
15087 } | 15086 } |
15088 } | 15087 } |
15089 Heap* heap = Dictionary<Shape, Key>::GetHeap(); | 15088 Heap* heap = Dictionary<Shape, Key>::GetHeap(); |
15090 return heap->undefined_value(); | 15089 return heap->undefined_value(); |
15091 } | 15090 } |
15092 | 15091 |
15093 | 15092 |
15094 MaybeObject* NameDictionary::TransformPropertiesToFastFor( | 15093 MaybeObject* NameDictionary::TransformPropertiesToFastFor( |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15804 | 15803 |
15805 | 15804 |
15806 void JSTypedArray::Neuter() { | 15805 void JSTypedArray::Neuter() { |
15807 set_byte_offset(Smi::FromInt(0)); | 15806 set_byte_offset(Smi::FromInt(0)); |
15808 set_byte_length(Smi::FromInt(0)); | 15807 set_byte_length(Smi::FromInt(0)); |
15809 set_length(Smi::FromInt(0)); | 15808 set_length(Smi::FromInt(0)); |
15810 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); | 15809 set_elements(GetHeap()->EmptyExternalArrayForMap(map())); |
15811 } | 15810 } |
15812 | 15811 |
15813 | 15812 |
15814 Type* JSGlobalPropertyCell::type() { | 15813 Type* PropertyCell::type() { |
15815 return static_cast<Type*>(type_raw()); | 15814 return static_cast<Type*>(type_raw()); |
15816 } | 15815 } |
15817 | 15816 |
15818 | 15817 |
15819 void JSGlobalPropertyCell::set_type(Type* type, WriteBarrierMode ignored) { | 15818 void PropertyCell::set_type(Type* type, WriteBarrierMode ignored) { |
15820 set_type_raw(type, ignored); | 15819 set_type_raw(type, ignored); |
15821 } | 15820 } |
15822 | 15821 |
15823 | 15822 |
15824 } } // namespace v8::internal | 15823 } } // namespace v8::internal |
OLD | NEW |