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 2211 matching lines...) Loading... |
2222 elms->set_length(len - to_trim); | 2222 elms->set_length(len - to_trim); |
2223 | 2223 |
2224 // Maintain marking consistency for IncrementalMarking. | 2224 // Maintain marking consistency for IncrementalMarking. |
2225 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) { | 2225 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) { |
2226 if (trim_mode == FROM_GC) { | 2226 if (trim_mode == FROM_GC) { |
2227 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta); | 2227 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta); |
2228 } else { | 2228 } else { |
2229 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); | 2229 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); |
2230 } | 2230 } |
2231 } | 2231 } |
| 2232 |
| 2233 // The array may not be moved during GC, |
| 2234 // and size has to be adjusted nevertheless. |
| 2235 HeapProfiler* profiler = heap->isolate()->heap_profiler(); |
| 2236 if (profiler->is_tracking_allocations()) { |
| 2237 profiler->UpdateObjectSizeEvent(elms->address(), elms->Size()); |
| 2238 } |
2232 } | 2239 } |
2233 | 2240 |
2234 | 2241 |
2235 bool Map::InstancesNeedRewriting(Map* target, | 2242 bool Map::InstancesNeedRewriting(Map* target, |
2236 int target_number_of_fields, | 2243 int target_number_of_fields, |
2237 int target_inobject, | 2244 int target_inobject, |
2238 int target_unused) { | 2245 int target_unused) { |
2239 // If fields were added (or removed), rewrite the instance. | 2246 // If fields were added (or removed), rewrite the instance. |
2240 int number_of_fields = NumberOfFields(); | 2247 int number_of_fields = NumberOfFields(); |
2241 ASSERT(target_number_of_fields >= number_of_fields); | 2248 ASSERT(target_number_of_fields >= number_of_fields); |
(...skipping 13836 matching lines...) Loading... |
16078 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16085 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16079 static const char* error_messages_[] = { | 16086 static const char* error_messages_[] = { |
16080 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16087 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16081 }; | 16088 }; |
16082 #undef ERROR_MESSAGES_TEXTS | 16089 #undef ERROR_MESSAGES_TEXTS |
16083 return error_messages_[reason]; | 16090 return error_messages_[reason]; |
16084 } | 16091 } |
16085 | 16092 |
16086 | 16093 |
16087 } } // namespace v8::internal | 16094 } } // namespace v8::internal |
OLD | NEW |