OLD | NEW |
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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 } | 1072 } |
1073 | 1073 |
1074 | 1074 |
1075 void SemiSpace::TearDown() { | 1075 void SemiSpace::TearDown() { |
1076 start_ = NULL; | 1076 start_ = NULL; |
1077 capacity_ = 0; | 1077 capacity_ = 0; |
1078 } | 1078 } |
1079 | 1079 |
1080 | 1080 |
1081 bool SemiSpace::Grow() { | 1081 bool SemiSpace::Grow() { |
1082 // Commit 50% extra space but only up to maximum capacity. | 1082 // Double the semispace size but only up to maximum capacity. |
1083 int maximum_extra = maximum_capacity_ - capacity_; | 1083 int maximum_extra = maximum_capacity_ - capacity_; |
1084 int extra = Min(RoundUp(capacity_ / 2, OS::AllocateAlignment()), | 1084 int extra = Min(RoundUp(capacity_, OS::AllocateAlignment()), |
1085 maximum_extra); | 1085 maximum_extra); |
1086 if (!MemoryAllocator::CommitBlock(high(), extra, executable())) { | 1086 if (!MemoryAllocator::CommitBlock(high(), extra, executable())) { |
1087 return false; | 1087 return false; |
1088 } | 1088 } |
1089 capacity_ += extra; | 1089 capacity_ += extra; |
1090 return true; | 1090 return true; |
1091 } | 1091 } |
1092 | 1092 |
1093 | 1093 |
1094 #ifdef DEBUG | 1094 #ifdef DEBUG |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2601 reinterpret_cast<Object**>(object->address() | 2601 reinterpret_cast<Object**>(object->address() |
2602 + Page::kObjectAreaSize), | 2602 + Page::kObjectAreaSize), |
2603 allocation_top); | 2603 allocation_top); |
2604 PrintF("\n"); | 2604 PrintF("\n"); |
2605 } | 2605 } |
2606 } | 2606 } |
2607 } | 2607 } |
2608 #endif // DEBUG | 2608 #endif // DEBUG |
2609 | 2609 |
2610 } } // namespace v8::internal | 2610 } } // namespace v8::internal |
OLD | NEW |