OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5721 FixedArray* result; | 5721 FixedArray* result; |
5722 if (number_of_descriptors == 0 && shared_mode == MAY_BE_SHARED) { | 5722 if (number_of_descriptors == 0 && shared_mode == MAY_BE_SHARED) { |
5723 return heap->empty_descriptor_array(); | 5723 return heap->empty_descriptor_array(); |
5724 } | 5724 } |
5725 // Allocate the array of keys. | 5725 // Allocate the array of keys. |
5726 { MaybeObject* maybe_array = | 5726 { MaybeObject* maybe_array = |
5727 heap->AllocateFixedArray(ToKeyIndex(number_of_descriptors)); | 5727 heap->AllocateFixedArray(ToKeyIndex(number_of_descriptors)); |
5728 if (!maybe_array->To(&result)) return maybe_array; | 5728 if (!maybe_array->To(&result)) return maybe_array; |
5729 } | 5729 } |
5730 | 5730 |
5731 result->set(kEnumCacheIndex, Smi::FromInt(Map::kNoneAdded)); | 5731 result->set(kEnumCacheIndex, Smi::FromInt(0)); |
5732 result->set(kTransitionsIndex, Smi::FromInt(0)); | 5732 result->set(kTransitionsIndex, Smi::FromInt(0)); |
5733 return result; | 5733 return result; |
5734 } | 5734 } |
5735 | 5735 |
5736 | 5736 |
5737 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, | 5737 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, |
5738 FixedArray* new_cache, | 5738 FixedArray* new_cache, |
5739 Object* new_index_cache) { | 5739 Object* new_index_cache) { |
5740 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength); | 5740 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength); |
5741 ASSERT(new_index_cache->IsSmi() || new_index_cache->IsFixedArray()); | 5741 ASSERT(new_index_cache->IsSmi() || new_index_cache->IsFixedArray()); |
5742 if (HasEnumCache()) { | 5742 if (HasEnumCache()) { |
5743 FixedArray::cast(get(kEnumCacheIndex))-> | 5743 FixedArray::cast(get(kEnumCacheIndex))-> |
5744 set(kEnumCacheBridgeCacheIndex, new_cache); | 5744 set(kEnumCacheBridgeCacheIndex, new_cache); |
5745 FixedArray::cast(get(kEnumCacheIndex))-> | 5745 FixedArray::cast(get(kEnumCacheIndex))-> |
5746 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); | 5746 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); |
5747 } else { | 5747 } else { |
5748 if (IsEmpty()) return; // Do nothing for empty descriptor array. | 5748 if (IsEmpty()) return; // Do nothing for empty descriptor array. |
5749 FixedArray::cast(bridge_storage)-> | 5749 FixedArray::cast(bridge_storage)-> |
5750 set(kEnumCacheBridgeCacheIndex, new_cache); | 5750 set(kEnumCacheBridgeCacheIndex, new_cache); |
5751 FixedArray::cast(bridge_storage)-> | 5751 FixedArray::cast(bridge_storage)-> |
5752 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); | 5752 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); |
5753 NoWriteBarrierSet(FixedArray::cast(bridge_storage), | |
5754 kEnumCacheBridgeLastAdded, | |
5755 get(kEnumCacheIndex)); | |
5756 set(kEnumCacheIndex, bridge_storage); | 5753 set(kEnumCacheIndex, bridge_storage); |
5757 } | 5754 } |
5758 } | 5755 } |
5759 | 5756 |
5760 | 5757 |
5761 void DescriptorArray::CopyFrom(int dst_index, | 5758 void DescriptorArray::CopyFrom(int dst_index, |
5762 DescriptorArray* src, | 5759 DescriptorArray* src, |
5763 int src_index, | 5760 int src_index, |
5764 const WhitenessWitness& witness) { | 5761 const WhitenessWitness& witness) { |
5765 Object* value = src->GetValue(src_index); | 5762 Object* value = src->GetValue(src_index); |
(...skipping 7266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13032 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13029 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13033 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13030 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13034 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13031 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13035 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13032 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13036 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13033 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13037 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13034 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13038 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13035 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13039 } | 13036 } |
13040 | 13037 |
13041 } } // namespace v8::internal | 13038 } } // namespace v8::internal |
OLD | NEW |