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

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: Deoptimize code and generate optimized code when switching allocations tracking 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 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 13847 matching lines...) Expand 10 before | Expand all | Expand 10 after
16089 #define ERROR_MESSAGES_TEXTS(C, T) T, 16096 #define ERROR_MESSAGES_TEXTS(C, T) T,
16090 static const char* error_messages_[] = { 16097 static const char* error_messages_[] = {
16091 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16098 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16092 }; 16099 };
16093 #undef ERROR_MESSAGES_TEXTS 16100 #undef ERROR_MESSAGES_TEXTS
16094 return error_messages_[reason]; 16101 return error_messages_[reason];
16095 } 16102 }
16096 16103
16097 16104
16098 } } // namespace v8::internal 16105 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/serialize.h » ('j') | test/cctest/cctest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698