| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index 752a1ed73760d0bc92ac0f8586eb05cad6471a47..ee01c22a508107bc541ca23c38f4f07dfd3446af 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -1475,8 +1475,8 @@ class Heap {
|
|
|
| // Adjusts the amount of registered external memory.
|
| // Returns the adjusted value.
|
| - inline intptr_t AdjustAmountOfExternalAllocatedMemory(
|
| - intptr_t change_in_bytes);
|
| + inline int64_t AdjustAmountOfExternalAllocatedMemory(
|
| + int64_t change_in_bytes);
|
|
|
| // This is only needed for testing high promotion mode.
|
| void SetNewSpaceHighPromotionModeActive(bool mode) {
|
| @@ -1495,7 +1495,10 @@ class Heap {
|
| }
|
|
|
| inline intptr_t PromotedTotalSize() {
|
| - return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
|
| + int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
|
| + if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt);
|
| + if (total < 0) return 0;
|
| + return static_cast<intptr_t>(total);
|
| }
|
|
|
| inline intptr_t OldGenerationSpaceAvailable() {
|
| @@ -1780,7 +1783,7 @@ class Heap {
|
|
|
| bool flush_monomorphic_ics() { return flush_monomorphic_ics_; }
|
|
|
| - intptr_t amount_of_external_allocated_memory() {
|
| + int64_t amount_of_external_allocated_memory() {
|
| return amount_of_external_allocated_memory_;
|
| }
|
|
|
| @@ -1906,7 +1909,7 @@ class Heap {
|
| int gc_post_processing_depth_;
|
|
|
| // Returns the amount of external memory registered since last global gc.
|
| - intptr_t PromotedExternalMemorySize();
|
| + int64_t PromotedExternalMemorySize();
|
|
|
| unsigned int ms_count_; // how many mark-sweep collections happened
|
| unsigned int gc_count_; // how many gc happened
|
| @@ -1960,10 +1963,10 @@ class Heap {
|
|
|
| // The amount of external memory registered through the API kept alive
|
| // by global handles
|
| - intptr_t amount_of_external_allocated_memory_;
|
| + int64_t amount_of_external_allocated_memory_;
|
|
|
| // Caches the amount of external memory registered at the last global gc.
|
| - intptr_t amount_of_external_allocated_memory_at_last_global_gc_;
|
| + int64_t amount_of_external_allocated_memory_at_last_global_gc_;
|
|
|
| // Indicates that an allocation has failed in the old generation since the
|
| // last GC.
|
|
|