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

Side by Side Diff: src/heap/heap.h

Issue 1133243006: Remove 64-bit unclean line from heap size estimation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Suggestion from Jakob Created 5 years, 7 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 | « no previous file | no next file » | 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 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 bool ReserveSpace(Reservation* reservations); 1085 bool ReserveSpace(Reservation* reservations);
1086 1086
1087 // 1087 //
1088 // Support for the API. 1088 // Support for the API.
1089 // 1089 //
1090 1090
1091 void CreateApiObjects(); 1091 void CreateApiObjects();
1092 1092
1093 inline intptr_t PromotedTotalSize() { 1093 inline intptr_t PromotedTotalSize() {
1094 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); 1094 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
1095 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); 1095 if (total > std::numeric_limits<intptr_t>::max()) {
1096 // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations.
1097 return std::numeric_limits<intptr_t>::max();
1098 }
1096 if (total < 0) return 0; 1099 if (total < 0) return 0;
1097 return static_cast<intptr_t>(total); 1100 return static_cast<intptr_t>(total);
1098 } 1101 }
1099 1102
1100 inline intptr_t OldGenerationSpaceAvailable() { 1103 inline intptr_t OldGenerationSpaceAvailable() {
1101 return old_generation_allocation_limit_ - PromotedTotalSize(); 1104 return old_generation_allocation_limit_ - PromotedTotalSize();
1102 } 1105 }
1103 1106
1104 inline intptr_t OldGenerationCapacityAvailable() { 1107 inline intptr_t OldGenerationCapacityAvailable() {
1105 return max_old_generation_size_ - PromotedTotalSize(); 1108 return max_old_generation_size_ - PromotedTotalSize();
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2655 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2658 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2656 2659
2657 private: 2660 private:
2658 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2661 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2659 }; 2662 };
2660 #endif // DEBUG 2663 #endif // DEBUG
2661 } 2664 }
2662 } // namespace v8::internal 2665 } // namespace v8::internal
2663 2666
2664 #endif // V8_HEAP_HEAP_H_ 2667 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698