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

Side by Side Diff: src/heap.cc

Issue 69953023: Add ability to disable inline bump-pointer allocation. (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
« no previous file with comments | « src/heap.h ('k') | src/heap-profiler.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 allocation_timeout_(0), 107 allocation_timeout_(0),
108 disallow_allocation_failure_(false), 108 disallow_allocation_failure_(false),
109 #endif // DEBUG 109 #endif // DEBUG
110 new_space_high_promotion_mode_active_(false), 110 new_space_high_promotion_mode_active_(false),
111 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), 111 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit),
112 size_of_old_gen_at_last_old_space_gc_(0), 112 size_of_old_gen_at_last_old_space_gc_(0),
113 external_allocation_limit_(0), 113 external_allocation_limit_(0),
114 amount_of_external_allocated_memory_(0), 114 amount_of_external_allocated_memory_(0),
115 amount_of_external_allocated_memory_at_last_global_gc_(0), 115 amount_of_external_allocated_memory_at_last_global_gc_(0),
116 old_gen_exhausted_(false), 116 old_gen_exhausted_(false),
117 inline_allocation_disabled_(false),
117 store_buffer_rebuilder_(store_buffer()), 118 store_buffer_rebuilder_(store_buffer()),
118 hidden_string_(NULL), 119 hidden_string_(NULL),
119 gc_safe_size_of_old_object_(NULL), 120 gc_safe_size_of_old_object_(NULL),
120 total_regexp_code_generated_(0), 121 total_regexp_code_generated_(0),
121 tracer_(NULL), 122 tracer_(NULL),
122 young_survivors_after_last_gc_(0), 123 young_survivors_after_last_gc_(0),
123 high_survival_rate_period_length_(0), 124 high_survival_rate_period_length_(0),
124 low_survival_rate_period_length_(0), 125 low_survival_rate_period_length_(0),
125 survival_rate_(0), 126 survival_rate_(0),
126 previous_survival_rate_trend_(Heap::STABLE), 127 previous_survival_rate_trend_(Heap::STABLE),
(...skipping 6434 matching lines...) Expand 10 before | Expand all | Expand 10 after
6561 6562
6562 6563
6563 intptr_t Heap::PromotedExternalMemorySize() { 6564 intptr_t Heap::PromotedExternalMemorySize() {
6564 if (amount_of_external_allocated_memory_ 6565 if (amount_of_external_allocated_memory_
6565 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0; 6566 <= amount_of_external_allocated_memory_at_last_global_gc_) return 0;
6566 return amount_of_external_allocated_memory_ 6567 return amount_of_external_allocated_memory_
6567 - amount_of_external_allocated_memory_at_last_global_gc_; 6568 - amount_of_external_allocated_memory_at_last_global_gc_;
6568 } 6569 }
6569 6570
6570 6571
6572 void Heap::EnableInlineAllocation() {
6573 ASSERT(inline_allocation_disabled_);
6574 inline_allocation_disabled_ = false;
6575
6576 // Update inline allocation limit for new space.
6577 new_space()->UpdateInlineAllocationLimit(0);
6578 }
6579
6580
6581 void Heap::DisableInlineAllocation() {
6582 ASSERT(!inline_allocation_disabled_);
6583 inline_allocation_disabled_ = true;
6584
6585 // Update inline allocation limit for new space.
6586 new_space()->UpdateInlineAllocationLimit(0);
6587
6588 // Update inline allocation limit for old spaces.
6589 PagedSpaces spaces(this);
6590 for (PagedSpace* space = spaces.next();
6591 space != NULL;
6592 space = spaces.next()) {
6593 space->EmptyAllocationInfo();
6594 }
6595 }
6596
6597
6571 V8_DECLARE_ONCE(initialize_gc_once); 6598 V8_DECLARE_ONCE(initialize_gc_once);
6572 6599
6573 static void InitializeGCOnce() { 6600 static void InitializeGCOnce() {
6574 InitializeScavengingVisitorsTables(); 6601 InitializeScavengingVisitorsTables();
6575 NewSpaceScavenger::Initialize(); 6602 NewSpaceScavenger::Initialize();
6576 MarkCompactCollector::Initialize(); 6603 MarkCompactCollector::Initialize();
6577 } 6604 }
6578 6605
6579 6606
6580 bool Heap::SetUp() { 6607 bool Heap::SetUp() {
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
7911 if (FLAG_concurrent_recompilation) { 7938 if (FLAG_concurrent_recompilation) {
7912 heap_->relocation_mutex_->Lock(); 7939 heap_->relocation_mutex_->Lock();
7913 #ifdef DEBUG 7940 #ifdef DEBUG
7914 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7941 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7915 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7942 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7916 #endif // DEBUG 7943 #endif // DEBUG
7917 } 7944 }
7918 } 7945 }
7919 7946
7920 } } // namespace v8::internal 7947 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698