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

Side by Side Diff: src/objects.cc

Issue 12084066: Only mark the descriptor that is valid for the map in question. If this map (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 10 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') | src/objects-inl.h » ('j') | 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 7625 matching lines...) Expand 10 before | Expand all | Expand 10 after
7636 if (!descriptors->HasEnumIndicesCache()) return; 7636 if (!descriptors->HasEnumIndicesCache()) return;
7637 FixedArray* enum_indices_cache = descriptors->GetEnumIndicesCache(); 7637 FixedArray* enum_indices_cache = descriptors->GetEnumIndicesCache();
7638 RightTrimFixedArray<FROM_GC>(heap, enum_indices_cache, to_trim); 7638 RightTrimFixedArray<FROM_GC>(heap, enum_indices_cache, to_trim);
7639 } 7639 }
7640 7640
7641 7641
7642 static void TrimDescriptorArray(Heap* heap, 7642 static void TrimDescriptorArray(Heap* heap,
7643 Map* map, 7643 Map* map,
7644 DescriptorArray* descriptors, 7644 DescriptorArray* descriptors,
7645 int number_of_own_descriptors) { 7645 int number_of_own_descriptors) {
7646 int number_of_descriptors = descriptors->number_of_descriptors(); 7646 int number_of_descriptors = descriptors->number_of_descriptors_storage();
7647 int to_trim = number_of_descriptors - number_of_own_descriptors; 7647 int to_trim = number_of_descriptors - number_of_own_descriptors;
7648 if (to_trim <= 0) return; 7648 if (to_trim == 0) return;
7649 7649
7650 RightTrimFixedArray<FROM_GC>(heap, descriptors, to_trim); 7650 RightTrimFixedArray<FROM_GC>(
7651 heap, descriptors, to_trim * DescriptorArray::kDescriptorSize);
7651 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); 7652 descriptors->SetNumberOfDescriptors(number_of_own_descriptors);
7652 7653
7653 if (descriptors->HasEnumCache()) TrimEnumCache(heap, map, descriptors); 7654 if (descriptors->HasEnumCache()) TrimEnumCache(heap, map, descriptors);
7654 descriptors->Sort(); 7655 descriptors->Sort();
7655 } 7656 }
7656 7657
7657 7658
7658 // Clear a possible back pointer in case the transition leads to a dead map. 7659 // Clear a possible back pointer in case the transition leads to a dead map.
7659 // Return true in case a back pointer has been cleared and false otherwise. 7660 // Return true in case a back pointer has been cleared and false otherwise.
7660 static bool ClearBackPointer(Heap* heap, Map* target) { 7661 static bool ClearBackPointer(Heap* heap, Map* target) {
(...skipping 6183 matching lines...) Expand 10 before | Expand all | Expand 10 after
13844 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13845 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13845 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13846 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13846 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13847 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13847 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13848 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13848 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13849 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13849 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13850 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13850 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13851 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13851 } 13852 }
13852 13853
13853 } } // namespace v8::internal 13854 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698