OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 } | 533 } |
534 } | 534 } |
535 } | 535 } |
536 | 536 |
537 | 537 |
538 void Heap::EnsureFromSpaceIsCommitted() { | 538 void Heap::EnsureFromSpaceIsCommitted() { |
539 if (new_space_.CommitFromSpaceIfNeeded()) return; | 539 if (new_space_.CommitFromSpaceIfNeeded()) return; |
540 | 540 |
541 // Committing memory to from space failed. | 541 // Committing memory to from space failed. |
542 // Try shrinking and try again. | 542 // Try shrinking and try again. |
| 543 PagedSpaces spaces; |
| 544 for (PagedSpace* space = spaces.next(); |
| 545 space != NULL; |
| 546 space = spaces.next()) { |
| 547 space->RelinkPageListInChunkOrder(true); |
| 548 } |
| 549 |
543 Shrink(); | 550 Shrink(); |
544 if (new_space_.CommitFromSpaceIfNeeded()) return; | 551 if (new_space_.CommitFromSpaceIfNeeded()) return; |
545 | 552 |
546 // Committing memory to from space failed again. | 553 // Committing memory to from space failed again. |
547 // Memory is exhausted and we will die. | 554 // Memory is exhausted and we will die. |
548 V8::FatalProcessOutOfMemory("Committing semi space failed."); | 555 V8::FatalProcessOutOfMemory("Committing semi space failed."); |
549 } | 556 } |
550 | 557 |
551 | 558 |
552 class ClearThreadJSFunctionResultCachesVisitor: public ThreadVisitor { | 559 class ClearThreadJSFunctionResultCachesVisitor: public ThreadVisitor { |
(...skipping 4324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4877 void ExternalStringTable::TearDown() { | 4884 void ExternalStringTable::TearDown() { |
4878 new_space_strings_.Free(); | 4885 new_space_strings_.Free(); |
4879 old_space_strings_.Free(); | 4886 old_space_strings_.Free(); |
4880 } | 4887 } |
4881 | 4888 |
4882 | 4889 |
4883 List<Object*> ExternalStringTable::new_space_strings_; | 4890 List<Object*> ExternalStringTable::new_space_strings_; |
4884 List<Object*> ExternalStringTable::old_space_strings_; | 4891 List<Object*> ExternalStringTable::old_space_strings_; |
4885 | 4892 |
4886 } } // namespace v8::internal | 4893 } } // namespace v8::internal |
OLD | NEW |