Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/objects.cc

Issue 10944011: Clear EnumIndices as well on CNLT. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nit Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6088 matching lines...) Expand 10 before | Expand all | Expand 10 after
6099 set(kEnumCacheIndex, Smi::FromInt(0)); 6099 set(kEnumCacheIndex, Smi::FromInt(0));
6100 } 6100 }
6101 6101
6102 6102
6103 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage, 6103 void DescriptorArray::SetEnumCache(FixedArray* bridge_storage,
6104 FixedArray* new_cache, 6104 FixedArray* new_cache,
6105 Object* new_index_cache) { 6105 Object* new_index_cache) {
6106 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength); 6106 ASSERT(bridge_storage->length() >= kEnumCacheBridgeLength);
6107 ASSERT(new_index_cache->IsSmi() || new_index_cache->IsFixedArray()); 6107 ASSERT(new_index_cache->IsSmi() || new_index_cache->IsFixedArray());
6108 if (HasEnumCache()) { 6108 if (HasEnumCache()) {
6109 ASSERT(new_cache->length() > FixedArray::cast(GetEnumCache())->length()); 6109 ASSERT(new_cache->length() > GetEnumCache()->length());
6110 FixedArray::cast(get(kEnumCacheIndex))-> 6110 FixedArray::cast(get(kEnumCacheIndex))->
6111 set(kEnumCacheBridgeCacheIndex, new_cache); 6111 set(kEnumCacheBridgeCacheIndex, new_cache);
6112 FixedArray::cast(get(kEnumCacheIndex))-> 6112 FixedArray::cast(get(kEnumCacheIndex))->
6113 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); 6113 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache);
6114 } else { 6114 } else {
6115 ASSERT(!IsEmpty()); 6115 ASSERT(!IsEmpty());
6116 FixedArray::cast(bridge_storage)-> 6116 FixedArray::cast(bridge_storage)->
6117 set(kEnumCacheBridgeCacheIndex, new_cache); 6117 set(kEnumCacheBridgeCacheIndex, new_cache);
6118 FixedArray::cast(bridge_storage)-> 6118 FixedArray::cast(bridge_storage)->
6119 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache); 6119 set(kEnumCacheBridgeIndicesCacheIndex, new_index_cache);
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
7514 if (to_trim > keep) { 7514 if (to_trim > keep) {
7515 RightTrimFixedArray<FROM_GC>(heap, descriptors, to_trim - keep); 7515 RightTrimFixedArray<FROM_GC>(heap, descriptors, to_trim - keep);
7516 } 7516 }
7517 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); 7517 descriptors->SetNumberOfDescriptors(number_of_own_descriptors);
7518 if (descriptors->HasEnumCache()) { 7518 if (descriptors->HasEnumCache()) {
7519 int live_enum = 7519 int live_enum =
7520 NumberOfDescribedProperties(OWN_DESCRIPTORS, DONT_ENUM); 7520 NumberOfDescribedProperties(OWN_DESCRIPTORS, DONT_ENUM);
7521 if (live_enum == 0) { 7521 if (live_enum == 0) {
7522 descriptors->ClearEnumCache(); 7522 descriptors->ClearEnumCache();
7523 } else { 7523 } else {
7524 FixedArray* enum_cache = 7524 FixedArray* enum_cache = descriptors->GetEnumCache();
7525 FixedArray::cast(descriptors->GetEnumCache());
7526 to_trim = enum_cache->length() - live_enum; 7525 to_trim = enum_cache->length() - live_enum;
7527 if (to_trim > 0) { 7526 if (to_trim > 0) {
7528 RightTrimFixedArray<FROM_GC>( 7527 RightTrimFixedArray<FROM_GC>(
7529 heap, FixedArray::cast(descriptors->GetEnumCache()), to_trim); 7528 heap, descriptors->GetEnumCache(), to_trim);
7529 if (descriptors->HasEnumIndicesCache()) {
7530 RightTrimFixedArray<FROM_GC>(
7531 heap, descriptors->GetEnumIndicesCache(), to_trim);
7532 }
7530 } 7533 }
7531 } 7534 }
7532 } 7535 }
7533 descriptors->Sort(); 7536 descriptors->Sort();
7534 } 7537 }
7535 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors); 7538 ASSERT(descriptors->number_of_descriptors() == number_of_own_descriptors);
7536 } else { 7539 } else {
7537 t->set_descriptors(heap->empty_descriptor_array()); 7540 t->set_descriptors(heap->empty_descriptor_array());
7538 } 7541 }
7539 set_owns_descriptors(true); 7542 set_owns_descriptors(true);
(...skipping 5978 matching lines...) Expand 10 before | Expand all | Expand 10 after
13518 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13521 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13519 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13522 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13520 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13523 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13521 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13524 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13522 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13525 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13523 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13526 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13524 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13527 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13525 } 13528 }
13526 13529
13527 } } // namespace v8::internal 13530 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698