| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3777 } | 3777 } |
| 3778 | 3778 |
| 3779 | 3779 |
| 3780 TEST(HugeConsStringOutOfMemory) { | 3780 TEST(HugeConsStringOutOfMemory) { |
| 3781 // It's not possible to read a snapshot into a heap with different dimensions. | 3781 // It's not possible to read a snapshot into a heap with different dimensions. |
| 3782 if (i::Snapshot::IsEnabled()) return; | 3782 if (i::Snapshot::IsEnabled()) return; |
| 3783 // Set heap limits. | 3783 // Set heap limits. |
| 3784 static const int K = 1024; | 3784 static const int K = 1024; |
| 3785 v8::ResourceConstraints constraints; | 3785 v8::ResourceConstraints constraints; |
| 3786 constraints.set_max_young_space_size(256 * K); | 3786 constraints.set_max_young_space_size(256 * K); |
| 3787 constraints.set_max_old_space_size(3 * K * K); | 3787 constraints.set_max_old_space_size(3 * K * K + 4 * K); |
| 3788 v8::SetResourceConstraints(&constraints); | 3788 v8::SetResourceConstraints(&constraints); |
| 3789 | 3789 |
| 3790 // Execute a script that causes out of memory. | 3790 // Execute a script that causes out of memory. |
| 3791 v8::V8::IgnoreOutOfMemoryException(); | 3791 v8::V8::IgnoreOutOfMemoryException(); |
| 3792 | 3792 |
| 3793 LocalContext context; | 3793 LocalContext context; |
| 3794 v8::HandleScope scope(context->GetIsolate()); | 3794 v8::HandleScope scope(context->GetIsolate()); |
| 3795 | 3795 |
| 3796 // Build huge string. This should fail with out of memory exception. | 3796 // Build huge string. This should fail with out of memory exception. |
| 3797 Local<Value> result = CompileRun( | 3797 Local<Value> result = CompileRun( |
| (...skipping 15803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19601 i::Semaphore* sem_; | 19601 i::Semaphore* sem_; |
| 19602 volatile int sem_value_; | 19602 volatile int sem_value_; |
| 19603 }; | 19603 }; |
| 19604 | 19604 |
| 19605 | 19605 |
| 19606 THREADED_TEST(SemaphoreInterruption) { | 19606 THREADED_TEST(SemaphoreInterruption) { |
| 19607 ThreadInterruptTest().RunTest(); | 19607 ThreadInterruptTest().RunTest(); |
| 19608 } | 19608 } |
| 19609 | 19609 |
| 19610 #endif // WIN32 | 19610 #endif // WIN32 |
| OLD | NEW |