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

Side by Side Diff: src/heap-inl.h

Issue 10824196: Add flag to trace the amount of external memory. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/flag-definitions.h ('k') | 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } else { 480 } else {
481 // Avoid underflow. 481 // Avoid underflow.
482 if (amount >= 0) { 482 if (amount >= 0) {
483 amount_of_external_allocated_memory_ = amount; 483 amount_of_external_allocated_memory_ = amount;
484 } else { 484 } else {
485 // Give up and reset the counters in case of an overflow. 485 // Give up and reset the counters in case of an overflow.
486 amount_of_external_allocated_memory_ = 0; 486 amount_of_external_allocated_memory_ = 0;
487 amount_of_external_allocated_memory_at_last_global_gc_ = 0; 487 amount_of_external_allocated_memory_at_last_global_gc_ = 0;
488 } 488 }
489 } 489 }
490 if (FLAG_trace_external_memory) {
491 PrintPID("%8.0f ms: ", isolate()->time_millis_since_init());
492 PrintF("Adjust amount of external memory: delta=%6" V8_PTR_PREFIX "d KB, "
493 " amount=%6" V8_PTR_PREFIX "d KB, isolate=0x%08" V8PRIxPTR ".\n",
494 change_in_bytes / 1024, amount_of_external_allocated_memory_ / 1024,
495 reinterpret_cast<intptr_t>(isolate()));
496 }
490 ASSERT(amount_of_external_allocated_memory_ >= 0); 497 ASSERT(amount_of_external_allocated_memory_ >= 0);
491 return amount_of_external_allocated_memory_; 498 return amount_of_external_allocated_memory_;
492 } 499 }
493 500
494 501
495 void Heap::SetLastScriptId(Object* last_script_id) { 502 void Heap::SetLastScriptId(Object* last_script_id) {
496 roots_[kLastScriptIdRootIndex] = last_script_id; 503 roots_[kLastScriptIdRootIndex] = last_script_id;
497 } 504 }
498 505
499 506
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 AssertNoAllocation::~AssertNoAllocation() { } 819 AssertNoAllocation::~AssertNoAllocation() { }
813 DisableAssertNoAllocation::DisableAssertNoAllocation() { } 820 DisableAssertNoAllocation::DisableAssertNoAllocation() { }
814 DisableAssertNoAllocation::~DisableAssertNoAllocation() { } 821 DisableAssertNoAllocation::~DisableAssertNoAllocation() { }
815 822
816 #endif 823 #endif
817 824
818 825
819 } } // namespace v8::internal 826 } } // namespace v8::internal
820 827
821 #endif // V8_HEAP_INL_H_ 828 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698