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

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: Fix style + rebase 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 | « src/mark-compact.cc ('k') | src/serialize.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 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 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after
2277 elms->set_length(len - to_trim); 2277 elms->set_length(len - to_trim);
2278 2278
2279 // Maintain marking consistency for IncrementalMarking. 2279 // Maintain marking consistency for IncrementalMarking.
2280 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) { 2280 if (Marking::IsBlack(Marking::MarkBitFrom(elms))) {
2281 if (trim_mode == FROM_GC) { 2281 if (trim_mode == FROM_GC) {
2282 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta); 2282 MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta);
2283 } else { 2283 } else {
2284 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); 2284 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta);
2285 } 2285 }
2286 } 2286 }
2287
2288 // The array may not be moved during GC,
2289 // and size has to be adjusted nevertheless.
2290 HeapProfiler* profiler = heap->isolate()->heap_profiler();
2291 if (profiler->is_tracking_allocations()) {
2292 profiler->UpdateObjectSizeEvent(elms->address(), elms->Size());
2293 }
2287 } 2294 }
2288 2295
2289 2296
2290 bool Map::InstancesNeedRewriting(Map* target, 2297 bool Map::InstancesNeedRewriting(Map* target,
2291 int target_number_of_fields, 2298 int target_number_of_fields,
2292 int target_inobject, 2299 int target_inobject,
2293 int target_unused) { 2300 int target_unused) {
2294 // If fields were added (or removed), rewrite the instance. 2301 // If fields were added (or removed), rewrite the instance.
2295 int number_of_fields = NumberOfFields(); 2302 int number_of_fields = NumberOfFields();
2296 ASSERT(target_number_of_fields >= number_of_fields); 2303 ASSERT(target_number_of_fields >= number_of_fields);
(...skipping 13957 matching lines...) Expand 10 before | Expand all | Expand 10 after
16254 #define ERROR_MESSAGES_TEXTS(C, T) T, 16261 #define ERROR_MESSAGES_TEXTS(C, T) T,
16255 static const char* error_messages_[] = { 16262 static const char* error_messages_[] = {
16256 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16263 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16257 }; 16264 };
16258 #undef ERROR_MESSAGES_TEXTS 16265 #undef ERROR_MESSAGES_TEXTS
16259 return error_messages_[reason]; 16266 return error_messages_[reason];
16260 } 16267 }
16261 16268
16262 16269
16263 } } // namespace v8::internal 16270 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/serialize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698