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

Side by Side Diff: src/objects.cc

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make separate API for JS allocations recording, add example of checking JS allocations recording in… Created 7 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
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 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
2305 elms->set_length(len - to_trim); 2305 elms->set_length(len - to_trim);
2306 2306
2307 // Maintain marking consistency for IncrementalMarking. 2307 // Maintain marking consistency for IncrementalMarking.
2308 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) { 2308 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) {
2309 if (trim_mode == FROM_GC) { 2309 if (trim_mode == FROM_GC) {
2310 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta); 2310 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta);
2311 } else { 2311 } else {
2312 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); 2312 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta);
2313 } 2313 }
2314 } 2314 }
2315
2316 // This repeating record is necessary because the array may not be moved
2317 // during GC, and size has to be adjusted nevetheless.
loislo 2013/08/27 09:04:57 tipo: nevertheless
Alexandra Mikhaylova 2013/09/19 16:03:38 Done.
2318 HeapProfiler* profiler = heap->isolate()->heap_profiler();
2319 if (profiler->is_tracking_allocations()) {
2320 profiler->NewObjectEvent(elms->address(), elms->Size());
loislo 2013/08/27 09:04:57 Sounds like we need UpdateObjectSizeEvent method.
Hannes Payer (out of office) 2013/08/28 09:51:32 yes, an update object size event would be the righ
Alexandra Mikhaylova 2013/09/19 16:03:38 Done.
Alexandra Mikhaylova 2013/09/19 16:03:38 Done.
2321 }
2315 } 2322 }
2316 2323
2317 2324
2318 bool Map::InstancesNeedRewriting(Map* target, 2325 bool Map::InstancesNeedRewriting(Map* target,
2319 int target_number_of_fields, 2326 int target_number_of_fields,
2320 int target_inobject, 2327 int target_inobject,
2321 int target_unused) { 2328 int target_unused) {
2322 // If fields were added (or removed), rewrite the instance. 2329 // If fields were added (or removed), rewrite the instance.
2323 int number_of_fields = NumberOfFields(); 2330 int number_of_fields = NumberOfFields();
2324 ASSERT(target_number_of_fields >= number_of_fields); 2331 ASSERT(target_number_of_fields >= number_of_fields);
(...skipping 13627 matching lines...) Expand 10 before | Expand all | Expand 10 after
15952 #define ERROR_MESSAGES_TEXTS(C, T) T, 15959 #define ERROR_MESSAGES_TEXTS(C, T) T,
15953 static const char* error_messages_[] = { 15960 static const char* error_messages_[] = {
15954 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 15961 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
15955 }; 15962 };
15956 #undef ERROR_MESSAGES_TEXTS 15963 #undef ERROR_MESSAGES_TEXTS
15957 return error_messages_[reason]; 15964 return error_messages_[reason];
15958 } 15965 }
15959 15966
15960 15967
15961 } } // namespace v8::internal 15968 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698