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

Side by Side Diff: src/spaces.cc

Issue 174050: Temporarily revert the reduction of semispace sizes and the growth... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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/spaces.h ('k') | 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 #endif 945 #endif
946 946
947 947
948 void NewSpace::Flip() { 948 void NewSpace::Flip() {
949 SemiSpace tmp = from_space_; 949 SemiSpace tmp = from_space_;
950 from_space_ = to_space_; 950 from_space_ = to_space_;
951 to_space_ = tmp; 951 to_space_ = tmp;
952 } 952 }
953 953
954 954
955 bool NewSpace::Grow() { 955 bool NewSpace::Double() {
956 ASSERT(capacity_ < maximum_capacity_); 956 ASSERT(capacity_ <= maximum_capacity_ / 2);
957 // TODO(1240712): Failure to double the from space can result in 957 // TODO(1240712): Failure to double the from space can result in
958 // semispaces of different sizes. In the event of that failure, the 958 // semispaces of different sizes. In the event of that failure, the
959 // to space doubling should be rolled back before returning false. 959 // to space doubling should be rolled back before returning false.
960 if (!to_space_.Grow() || !from_space_.Grow()) return false; 960 if (!to_space_.Double() || !from_space_.Double()) return false;
961 capacity_ = to_space_.Capacity() + from_space_.Capacity(); 961 capacity_ *= 2;
962 allocation_info_.limit = to_space_.high(); 962 allocation_info_.limit = to_space_.high();
963 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); 963 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
964 return true; 964 return true;
965 } 965 }
966 966
967 967
968 void NewSpace::ResetAllocationInfo() { 968 void NewSpace::ResetAllocationInfo() {
969 allocation_info_.top = to_space_.low(); 969 allocation_info_.top = to_space_.low();
970 allocation_info_.limit = to_space_.high(); 970 allocation_info_.limit = to_space_.high();
971 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); 971 ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 return Commit(); 1073 return Commit();
1074 } 1074 }
1075 1075
1076 1076
1077 void SemiSpace::TearDown() { 1077 void SemiSpace::TearDown() {
1078 start_ = NULL; 1078 start_ = NULL;
1079 capacity_ = 0; 1079 capacity_ = 0;
1080 } 1080 }
1081 1081
1082 1082
1083 bool SemiSpace::Grow() { 1083 bool SemiSpace::Double() {
1084 // Commit 50% extra space but only up to maximum capacity. 1084 if (!MemoryAllocator::CommitBlock(high(), capacity_, executable())) {
1085 int extra = RoundUp(capacity_ / 2, OS::AllocateAlignment());
1086 if (capacity_ + extra > maximum_capacity_) {
1087 extra = maximum_capacity_ - capacity_;
1088 }
1089 if (!MemoryAllocator::CommitBlock(high(), extra, executable())) {
1090 return false; 1085 return false;
1091 } 1086 }
1092 capacity_ += extra; 1087 capacity_ *= 2;
1093 return true; 1088 return true;
1094 } 1089 }
1095 1090
1096 1091
1097 #ifdef DEBUG 1092 #ifdef DEBUG
1098 void SemiSpace::Print() { } 1093 void SemiSpace::Print() { }
1099 1094
1100 1095
1101 void SemiSpace::Verify() { } 1096 void SemiSpace::Verify() { }
1102 #endif 1097 #endif
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 reinterpret_cast<Object**>(object->address() 2599 reinterpret_cast<Object**>(object->address()
2605 + Page::kObjectAreaSize), 2600 + Page::kObjectAreaSize),
2606 allocation_top); 2601 allocation_top);
2607 PrintF("\n"); 2602 PrintF("\n");
2608 } 2603 }
2609 } 2604 }
2610 } 2605 }
2611 #endif // DEBUG 2606 #endif // DEBUG
2612 2607
2613 } } // namespace v8::internal 2608 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698