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: runtime/vm/pages.h

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 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
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/pages.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_PAGES_H_ 5 #ifndef VM_PAGES_H_
6 #define VM_PAGES_H_ 6 #define VM_PAGES_H_
7 7
8 #include "vm/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 290 }
291 291
292 void IncrementCollections() { 292 void IncrementCollections() {
293 collections_++; 293 collections_++;
294 } 294 }
295 295
296 intptr_t collections() const { 296 intptr_t collections() const {
297 return collections_; 297 return collections_;
298 } 298 }
299 299
300 void PrintToJSONObject(JSONObject* object); 300 void PrintToJSONObject(JSONObject* object) const;
301 void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream); 301 void PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) const;
302 302
303 void AllocateExternal(intptr_t size); 303 void AllocateExternal(intptr_t size);
304 void FreeExternal(intptr_t size); 304 void FreeExternal(intptr_t size);
305 305
306 // Bulk data allocation. 306 // Bulk data allocation.
307 void AcquireDataLock(); 307 void AcquireDataLock();
308 void ReleaseDataLock(); 308 void ReleaseDataLock();
309 309
310 uword TryAllocateDataLocked(intptr_t size, GrowthPolicy growth_policy) { 310 uword TryAllocateDataLocked(intptr_t size, GrowthPolicy growth_policy) {
311 bool is_protected = false; 311 bool is_protected = false;
(...skipping 18 matching lines...) Expand all
330 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy); 330 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy);
331 // Allocates memory where every word is guaranteed to be a Smi. Calling this 331 // Allocates memory where every word is guaranteed to be a Smi. Calling this
332 // method after the first garbage collection is inefficient in release mode 332 // method after the first garbage collection is inefficient in release mode
333 // and illegal in debug mode. 333 // and illegal in debug mode.
334 uword TryAllocateSmiInitializedLocked(intptr_t size, 334 uword TryAllocateSmiInitializedLocked(intptr_t size,
335 GrowthPolicy growth_policy); 335 GrowthPolicy growth_policy);
336 336
337 // Bump block allocation from generated code. 337 // Bump block allocation from generated code.
338 uword* TopAddress() { return &bump_top_; } 338 uword* TopAddress() { return &bump_top_; }
339 uword* EndAddress() { return &bump_end_; } 339 uword* EndAddress() { return &bump_end_; }
340 static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); }
341 static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); }
340 342
341 private: 343 private:
342 // Ids for time and data records in Heap::GCStats. 344 // Ids for time and data records in Heap::GCStats.
343 enum { 345 enum {
344 // Time 346 // Time
345 kMarkObjects = 0, 347 kMarkObjects = 0,
346 kResetFreeLists = 1, 348 kResetFreeLists = 1,
347 kSweepPages = 2, 349 kSweepPages = 2,
348 kSweepLargePages = 3, 350 kSweepLargePages = 3,
349 // Data 351 // Data
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 friend class HeapIterationScope; 440 friend class HeapIterationScope;
439 friend class PageSpaceController; 441 friend class PageSpaceController;
440 friend class SweeperTask; 442 friend class SweeperTask;
441 443
442 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); 444 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
443 }; 445 };
444 446
445 } // namespace dart 447 } // namespace dart
446 448
447 #endif // VM_PAGES_H_ 449 #endif // VM_PAGES_H_
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698