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.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: 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
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 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 void ReserveSpace(int *sizes, Address* addresses); 1031 void ReserveSpace(int *sizes, Address* addresses);
1032 1032
1033 // 1033 //
1034 // Support for the API. 1034 // Support for the API.
1035 // 1035 //
1036 1036
1037 void CreateApiObjects(); 1037 void CreateApiObjects();
1038 1038
1039 // Adjusts the amount of registered external memory. 1039 // Adjusts the amount of registered external memory.
1040 // Returns the adjusted value. 1040 // Returns the adjusted value.
1041 inline int64_t AdjustAmountOfExternalAllocatedMemory( 1041 inline int64_t AdjustAmountOfExternalAllocatedMemory(
Hannes Payer (out of office) 2014/06/04 11:24:49 With that change, can we get rid of this method? T
jochen (gone - plz use gerrit) 2014/06/04 11:41:24 The fast path method doesn't handle the case where
1042 int64_t change_in_bytes); 1042 int64_t change_in_bytes);
1043 1043
1044 inline intptr_t PromotedTotalSize() { 1044 inline intptr_t PromotedTotalSize() {
1045 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); 1045 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
1046 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); 1046 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt);
1047 if (total < 0) return 0; 1047 if (total < 0) return 0;
1048 return static_cast<intptr_t>(total); 1048 return static_cast<intptr_t>(total);
1049 } 1049 }
1050 1050
1051 inline intptr_t OldGenerationSpaceAvailable() { 1051 inline intptr_t OldGenerationSpaceAvailable() {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // This can be calculated directly from a pointer to the heap; however, it is 1503 // 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. 1504 // more expedient to get at the isolate directly from within Heap methods.
1505 Isolate* isolate_; 1505 Isolate* isolate_;
1506 1506
1507 // The amount of external memory registered through the API kept alive
1508 // by global handles
1509 int64_t amount_of_external_allocated_memory_;
1510
1511 // Caches the amount of external memory registered at the last global gc.
1512 int64_t amount_of_external_allocated_memory_at_last_global_gc_;
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_;
1513 intptr_t max_old_generation_size_; 1520 intptr_t max_old_generation_size_;
1514 intptr_t max_executable_size_; 1521 intptr_t max_executable_size_;
1515 intptr_t maximum_committed_; 1522 intptr_t maximum_committed_;
1516 1523
(...skipping 66 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

Powered by Google App Engine
This is Rietveld 408576698