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

Side by Side Diff: src/zone.cc

Issue 665893006: [turbofan] add ZonePool to correctly track compiler phase memory usage (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/compiler/zone-pool.cc ('k') | test/cctest/compiler/test-instruction.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string.h> 5 #include <string.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 #include "src/zone-inl.h" 8 #include "src/zone-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // Un-poison so we can re-use the segment later. 143 // Un-poison so we can re-use the segment later.
144 ASAN_UNPOISON_MEMORY_REGION(start, keep->capacity()); 144 ASAN_UNPOISON_MEMORY_REGION(start, keep->capacity());
145 #ifdef DEBUG 145 #ifdef DEBUG
146 // Zap the contents of the kept segment (but not the header). 146 // Zap the contents of the kept segment (but not the header).
147 memset(start, kZapDeadByte, keep->capacity()); 147 memset(start, kZapDeadByte, keep->capacity());
148 #endif 148 #endif
149 } else { 149 } else {
150 position_ = limit_ = 0; 150 position_ = limit_ = 0;
151 } 151 }
152 152
153 allocation_size_ = 0;
153 // Update the head segment to be the kept segment (if any). 154 // Update the head segment to be the kept segment (if any).
154 segment_head_ = keep; 155 segment_head_ = keep;
155 } 156 }
156 157
157 158
158 void Zone::DeleteKeptSegment() { 159 void Zone::DeleteKeptSegment() {
159 #ifdef DEBUG 160 #ifdef DEBUG
160 // Constant byte value used for zapping dead memory in debug mode. 161 // Constant byte value used for zapping dead memory in debug mode.
161 static const unsigned char kZapDeadByte = 0xcd; 162 static const unsigned char kZapDeadByte = 0xcd;
162 #endif 163 #endif
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 V8::FatalProcessOutOfMemory("Zone"); 251 V8::FatalProcessOutOfMemory("Zone");
251 return NULL; 252 return NULL;
252 } 253 }
253 limit_ = segment->end(); 254 limit_ = segment->end();
254 DCHECK(position_ <= limit_); 255 DCHECK(position_ <= limit_);
255 return result; 256 return result;
256 } 257 }
257 258
258 259
259 } } // namespace v8::internal 260 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler/zone-pool.cc ('k') | test/cctest/compiler/test-instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698