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

Side by Side Diff: src/objects.cc

Issue 27197002: Return descriptor ownership after TrimDescriptorArray to allow resharing of descriptor arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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 | « no previous file | 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 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 9228 matching lines...) Expand 10 before | Expand all | Expand 10 after
9239 int number_of_descriptors = descriptors->number_of_descriptors_storage(); 9239 int number_of_descriptors = descriptors->number_of_descriptors_storage();
9240 int to_trim = number_of_descriptors - number_of_own_descriptors; 9240 int to_trim = number_of_descriptors - number_of_own_descriptors;
9241 if (to_trim == 0) return; 9241 if (to_trim == 0) return;
9242 9242
9243 RightTrimFixedArray<FROM_GC>( 9243 RightTrimFixedArray<FROM_GC>(
9244 heap, descriptors, to_trim * DescriptorArray::kDescriptorSize); 9244 heap, descriptors, to_trim * DescriptorArray::kDescriptorSize);
9245 descriptors->SetNumberOfDescriptors(number_of_own_descriptors); 9245 descriptors->SetNumberOfDescriptors(number_of_own_descriptors);
9246 9246
9247 if (descriptors->HasEnumCache()) TrimEnumCache(heap, map, descriptors); 9247 if (descriptors->HasEnumCache()) TrimEnumCache(heap, map, descriptors);
9248 descriptors->Sort(); 9248 descriptors->Sort();
9249
9250 map->set_owns_descriptors(true);
Michael Starzinger 2013/10/16 09:34:06 nit: Can we hoist this out of this helper into Map
rmcilroy 2013/10/16 10:44:01 Makes sense, done.
9249 } 9251 }
9250 9252
9251 9253
9252 // Clear a possible back pointer in case the transition leads to a dead map. 9254 // Clear a possible back pointer in case the transition leads to a dead map.
9253 // Return true in case a back pointer has been cleared and false otherwise. 9255 // Return true in case a back pointer has been cleared and false otherwise.
9254 static bool ClearBackPointer(Heap* heap, Map* target) { 9256 static bool ClearBackPointer(Heap* heap, Map* target) {
9255 if (Marking::MarkBitFrom(target).Get()) return false; 9257 if (Marking::MarkBitFrom(target).Get()) return false;
9256 target->SetBackPointer(heap->undefined_value(), SKIP_WRITE_BARRIER); 9258 target->SetBackPointer(heap->undefined_value(), SKIP_WRITE_BARRIER);
9257 return true; 9259 return true;
9258 } 9260 }
(...skipping 7002 matching lines...) Expand 10 before | Expand all | Expand 10 after
16261 #define ERROR_MESSAGES_TEXTS(C, T) T, 16263 #define ERROR_MESSAGES_TEXTS(C, T) T,
16262 static const char* error_messages_[] = { 16264 static const char* error_messages_[] = {
16263 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16265 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16264 }; 16266 };
16265 #undef ERROR_MESSAGES_TEXTS 16267 #undef ERROR_MESSAGES_TEXTS
16266 return error_messages_[reason]; 16268 return error_messages_[reason];
16267 } 16269 }
16268 16270
16269 16271
16270 } } // namespace v8::internal 16272 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698