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

Side by Side Diff: src/heap.cc

Issue 70233010: API: Change AdjustAmountOfExternalAllocatedMemory calls to use int64_t instead of intptr_t (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
« include/v8.h ('K') | « src/heap.h ('k') | src/heap-inl.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 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 lo_space_->SizeOfObjects() / KB, 404 lo_space_->SizeOfObjects() / KB,
405 lo_space_->Available() / KB, 405 lo_space_->Available() / KB,
406 lo_space_->CommittedMemory() / KB); 406 lo_space_->CommittedMemory() / KB);
407 PrintPID("All spaces, used: %6" V8_PTR_PREFIX "d KB" 407 PrintPID("All spaces, used: %6" V8_PTR_PREFIX "d KB"
408 ", available: %6" V8_PTR_PREFIX "d KB" 408 ", available: %6" V8_PTR_PREFIX "d KB"
409 ", committed: %6" V8_PTR_PREFIX "d KB\n", 409 ", committed: %6" V8_PTR_PREFIX "d KB\n",
410 this->SizeOfObjects() / KB, 410 this->SizeOfObjects() / KB,
411 this->Available() / KB, 411 this->Available() / KB,
412 this->CommittedMemory() / KB); 412 this->CommittedMemory() / KB);
413 PrintPID("External memory reported: %6" V8_PTR_PREFIX "d KB\n", 413 PrintPID("External memory reported: %6" V8_PTR_PREFIX "d KB\n",
414 amount_of_external_allocated_memory_ / KB); 414 static_cast<intptr_t>(amount_of_external_allocated_memory_ / KB));
415 PrintPID("Total time spent in GC : %.1f ms\n", total_gc_time_ms_); 415 PrintPID("Total time spent in GC : %.1f ms\n", total_gc_time_ms_);
416 } 416 }
417 417
418 418
419 // TODO(1238405): Combine the infrastructure for --heap-stats and 419 // TODO(1238405): Combine the infrastructure for --heap-stats and
420 // --log-gc to avoid the complicated preprocessor and flag testing. 420 // --log-gc to avoid the complicated preprocessor and flag testing.
421 void Heap::ReportStatisticsAfterGC() { 421 void Heap::ReportStatisticsAfterGC() {
422 // Similar to the before GC, we use some complicated logic to ensure that 422 // Similar to the before GC, we use some complicated logic to ensure that
423 // NewSpace statistics are logged exactly once when --log-gc is turned on. 423 // NewSpace statistics are logged exactly once when --log-gc is turned on.
424 #if defined(DEBUG) 424 #if defined(DEBUG)
(...skipping 6146 matching lines...) Expand 10 before | Expand all | Expand 10 after
6571 return old_pointer_space_->SizeOfObjects() 6571 return old_pointer_space_->SizeOfObjects()
6572 + old_data_space_->SizeOfObjects() 6572 + old_data_space_->SizeOfObjects()
6573 + code_space_->SizeOfObjects() 6573 + code_space_->SizeOfObjects()
6574 + map_space_->SizeOfObjects() 6574 + map_space_->SizeOfObjects()
6575 + cell_space_->SizeOfObjects() 6575 + cell_space_->SizeOfObjects()
6576 + property_cell_space_->SizeOfObjects() 6576 + property_cell_space_->SizeOfObjects()
6577 + lo_space_->SizeOfObjects(); 6577 + lo_space_->SizeOfObjects();
6578 } 6578 }
6579 6579
6580 6580
6581 intptr_t Heap::PromotedExternalMemorySize() { 6581 int64_t Heap::PromotedExternalMemorySize() {
6582 if (amount_of_external_allocated_memory_ 6582 if (amount_of_external_allocated_memory_
6583 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; 6583 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0;
6584 return amount_of_external_allocated_memory_ 6584 return amount_of_external_allocated_memory_
6585 - amount_of_external_allocated_memory_at_last_global_gc_; 6585 - amount_of_external_allocated_memory_at_last_global_gc_;
6586 } 6586 }
6587 6587
6588 6588
6589 V8_DECLARE_ONCE(initialize_gc_once); 6589 V8_DECLARE_ONCE(initialize_gc_once);
6590 6590
6591 static void InitializeGCOnce() { 6591 static void InitializeGCOnce() {
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
7929 if (FLAG_concurrent_recompilation) { 7929 if (FLAG_concurrent_recompilation) {
7930 heap_->relocation_mutex_->Lock(); 7930 heap_->relocation_mutex_->Lock();
7931 #ifdef DEBUG 7931 #ifdef DEBUG
7932 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7932 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7933 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7933 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7934 #endif // DEBUG 7934 #endif // DEBUG
7935 } 7935 }
7936 } 7936 }
7937 7937
7938 } } // namespace v8::internal 7938 } } // namespace v8::internal
OLDNEW
« include/v8.h ('K') | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698