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