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

Side by Side Diff: src/heap.h

Issue 310393003: Move most of the implementation of AdjustAmountOfExternalMemory to v8.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 6 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/api.cc ('k') | src/heap.cc » ('j') | src/heap-inl.h » ('J')
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 #ifndef V8_HEAP_H_ 5 #ifndef V8_HEAP_H_
6 #define V8_HEAP_H_ 6 #define V8_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 MUST_USE_RESULT AllocationResult CopyCode(Code* code); 1493 MUST_USE_RESULT AllocationResult CopyCode(Code* code);
1494 1494
1495 // Allocates a fixed array initialized with undefined values 1495 // Allocates a fixed array initialized with undefined values
1496 MUST_USE_RESULT AllocationResult AllocateFixedArray( 1496 MUST_USE_RESULT AllocationResult AllocateFixedArray(
1497 int length, 1497 int length,
1498 PretenureFlag pretenure = NOT_TENURED); 1498 PretenureFlag pretenure = NOT_TENURED);
1499 1499
1500 private: 1500 private:
1501 Heap(); 1501 Heap();
1502 1502
1503 // The amount of external memory registered through the API kept alive
1504 // by global handles
1505 int64_t amount_of_external_allocated_memory_;
1506
1507 // Caches the amount of external memory registered at the last global gc.
1508 int64_t amount_of_external_allocated_memory_at_last_global_gc_;
1509
1503 // This can be calculated directly from a pointer to the heap; however, it is 1510 // This can be calculated directly from a pointer to the heap; however, it is
1504 // more expedient to get at the isolate directly from within Heap methods. 1511 // more expedient to get at the isolate directly from within Heap methods.
1505 Isolate* isolate_; 1512 Isolate* isolate_;
1506 1513
1507 Object* roots_[kRootListLength]; 1514 Object* roots_[kRootListLength];
1508 1515
1509 intptr_t code_range_size_; 1516 intptr_t code_range_size_;
1510 int reserved_semispace_size_; 1517 int reserved_semispace_size_;
1511 int max_semi_space_size_; 1518 int max_semi_space_size_;
1512 int initial_semispace_size_; 1519 int initial_semispace_size_;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 1590
1584 // Limit that triggers a global GC on the next (normally caused) GC. This 1591 // Limit that triggers a global GC on the next (normally caused) GC. This
1585 // is checked when we have already decided to do a GC to help determine 1592 // is checked when we have already decided to do a GC to help determine
1586 // which collector to invoke, before expanding a paged space in the old 1593 // which collector to invoke, before expanding a paged space in the old
1587 // generation and on every allocation in large object space. 1594 // generation and on every allocation in large object space.
1588 intptr_t old_generation_allocation_limit_; 1595 intptr_t old_generation_allocation_limit_;
1589 1596
1590 // Used to adjust the limits that control the timing of the next GC. 1597 // Used to adjust the limits that control the timing of the next GC.
1591 intptr_t size_of_old_gen_at_last_old_space_gc_; 1598 intptr_t size_of_old_gen_at_last_old_space_gc_;
1592 1599
1593 // Limit on the amount of externally allocated memory allowed
1594 // between global GCs. If reached a global GC is forced.
1595 intptr_t external_allocation_limit_;
1596
1597 // The amount of external memory registered through the API kept alive
1598 // by global handles
1599 int64_t amount_of_external_allocated_memory_;
1600
1601 // Caches the amount of external memory registered at the last global gc.
1602 int64_t amount_of_external_allocated_memory_at_last_global_gc_;
1603
1604 // Indicates that an allocation has failed in the old generation since the 1600 // Indicates that an allocation has failed in the old generation since the
1605 // last GC. 1601 // last GC.
1606 bool old_gen_exhausted_; 1602 bool old_gen_exhausted_;
1607 1603
1608 // Indicates that inline bump-pointer allocation has been globally disabled 1604 // Indicates that inline bump-pointer allocation has been globally disabled
1609 // for all spaces. This is used to disable allocations in generated code. 1605 // for all spaces. This is used to disable allocations in generated code.
1610 bool inline_allocation_disabled_; 1606 bool inline_allocation_disabled_;
1611 1607
1612 // Weak list heads, threaded through the objects. 1608 // Weak list heads, threaded through the objects.
1613 // List heads are initilized lazily and contain the undefined_value at start. 1609 // List heads are initilized lazily and contain the undefined_value at start.
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
2788 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2784 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2789 2785
2790 private: 2786 private:
2791 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2787 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2792 }; 2788 };
2793 #endif // DEBUG 2789 #endif // DEBUG
2794 2790
2795 } } // namespace v8::internal 2791 } } // namespace v8::internal
2796 2792
2797 #endif // V8_HEAP_H_ 2793 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | src/heap-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698