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/heap.cc

Issue 144543005: Allow to enable/disable inline allocation via runtime function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review. Created 6 years, 11 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 | « no previous file | src/runtime.cc » ('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 6379 matching lines...) Expand 10 before | Expand all | Expand 10 after
6390 6390
6391 int64_t Heap::PromotedExternalMemorySize() { 6391 int64_t Heap::PromotedExternalMemorySize() {
6392 if (amount_of_external_allocated_memory_ 6392 if (amount_of_external_allocated_memory_
6393 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; 6393 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0;
6394 return amount_of_external_allocated_memory_ 6394 return amount_of_external_allocated_memory_
6395 - amount_of_external_allocated_memory_at_last_global_gc_; 6395 - amount_of_external_allocated_memory_at_last_global_gc_;
6396 } 6396 }
6397 6397
6398 6398
6399 void Heap::EnableInlineAllocation() { 6399 void Heap::EnableInlineAllocation() {
6400 ASSERT(inline_allocation_disabled_); 6400 if (!inline_allocation_disabled_) return;
6401 inline_allocation_disabled_ = false; 6401 inline_allocation_disabled_ = false;
6402 6402
6403 // Update inline allocation limit for new space. 6403 // Update inline allocation limit for new space.
6404 new_space()->UpdateInlineAllocationLimit(0); 6404 new_space()->UpdateInlineAllocationLimit(0);
6405 } 6405 }
6406 6406
6407 6407
6408 void Heap::DisableInlineAllocation() { 6408 void Heap::DisableInlineAllocation() {
6409 ASSERT(!inline_allocation_disabled_); 6409 if (inline_allocation_disabled_) return;
6410 inline_allocation_disabled_ = true; 6410 inline_allocation_disabled_ = true;
6411 6411
6412 // Update inline allocation limit for new space. 6412 // Update inline allocation limit for new space.
6413 new_space()->UpdateInlineAllocationLimit(0); 6413 new_space()->UpdateInlineAllocationLimit(0);
6414 6414
6415 // Update inline allocation limit for old spaces. 6415 // Update inline allocation limit for old spaces.
6416 PagedSpaces spaces(this); 6416 PagedSpaces spaces(this);
6417 for (PagedSpace* space = spaces.next(); 6417 for (PagedSpace* space = spaces.next();
6418 space != NULL; 6418 space != NULL;
6419 space = spaces.next()) { 6419 space = spaces.next()) {
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
7741 static_cast<int>(object_sizes_last_time_[index])); 7741 static_cast<int>(object_sizes_last_time_[index]));
7742 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7742 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7743 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7743 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7744 7744
7745 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7745 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7746 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7746 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7747 ClearObjectStats(); 7747 ClearObjectStats();
7748 } 7748 }
7749 7749
7750 } } // namespace v8::internal 7750 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698