| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 17 matching lines...) Expand all Loading... |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 #include "accessors.h" | 29 #include "accessors.h" |
| 30 | 30 |
| 31 #include "cctest.h" | 31 #include "cctest.h" |
| 32 | 32 |
| 33 | 33 |
| 34 using namespace v8::internal; | 34 using namespace v8::internal; |
| 35 | 35 |
| 36 | 36 |
| 37 static inline void SimulateFullSpace(PagedSpace* space) { | 37 static inline void SimulateFullSpace(PagedSpace* space) { |
| 38 int old_linear_size = static_cast<int>(space->limit() - space->top()); |
| 39 space->Free(space->top(), old_linear_size); |
| 38 space->SetTop(space->limit(), space->limit()); | 40 space->SetTop(space->limit(), space->limit()); |
| 39 space->ResetFreeList(); | 41 space->ResetFreeList(); |
| 40 space->ClearStats(); | 42 space->ClearStats(); |
| 41 } | 43 } |
| 42 | 44 |
| 43 | 45 |
| 44 static MaybeObject* AllocateAfterFailures() { | 46 static MaybeObject* AllocateAfterFailures() { |
| 45 static int attempts = 0; | 47 static int attempts = 0; |
| 46 if (++attempts < 3) return Failure::RetryAfterGC(); | 48 if (++attempts < 3) return Failure::RetryAfterGC(); |
| 47 Heap* heap = Isolate::Current()->heap(); | 49 Heap* heap = Isolate::Current()->heap(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 blocks[index] = blocks.RemoveLast(); | 228 blocks[index] = blocks.RemoveLast(); |
| 227 } else { | 229 } else { |
| 228 blocks.RemoveLast(); | 230 blocks.RemoveLast(); |
| 229 } | 231 } |
| 230 } | 232 } |
| 231 } | 233 } |
| 232 | 234 |
| 233 code_range->TearDown(); | 235 code_range->TearDown(); |
| 234 delete code_range; | 236 delete code_range; |
| 235 } | 237 } |
| OLD | NEW |