| 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 11843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11854 | 11854 |
| 11855 | 11855 |
| 11856 static int64_t cast(intptr_t x) { return static_cast<int64_t>(x); } | 11856 static int64_t cast(intptr_t x) { return static_cast<int64_t>(x); } |
| 11857 | 11857 |
| 11858 | 11858 |
| 11859 THREADED_TEST(ExternalAllocatedMemory) { | 11859 THREADED_TEST(ExternalAllocatedMemory) { |
| 11860 v8::HandleScope outer; | 11860 v8::HandleScope outer; |
| 11861 v8::Persistent<Context> env(Context::New()); | 11861 v8::Persistent<Context> env(Context::New()); |
| 11862 CHECK(!env.IsEmpty()); | 11862 CHECK(!env.IsEmpty()); |
| 11863 const intptr_t kSize = 1024*1024; | 11863 const intptr_t kSize = 1024*1024; |
| 11864 CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(kSize)), | 11864 v8::Isolate* isolate = env->GetIsolate(); |
| 11865 CHECK_EQ(cast(isolate->AdjustAmountOfExternalAllocatedMemory(kSize)), |
| 11865 cast(kSize)); | 11866 cast(kSize)); |
| 11866 CHECK_EQ(cast(v8::V8::AdjustAmountOfExternalAllocatedMemory(-kSize)), | 11867 CHECK_EQ(cast(isolate->AdjustAmountOfExternalAllocatedMemory(-kSize)), |
| 11867 cast(0)); | 11868 cast(0)); |
| 11868 } | 11869 } |
| 11869 | 11870 |
| 11870 | 11871 |
| 11871 THREADED_TEST(DisposeEnteredContext) { | 11872 THREADED_TEST(DisposeEnteredContext) { |
| 11872 v8::HandleScope scope; | 11873 v8::HandleScope scope; |
| 11873 LocalContext outer; | 11874 LocalContext outer; |
| 11874 { v8::Persistent<v8::Context> inner = v8::Context::New(); | 11875 { v8::Persistent<v8::Context> inner = v8::Context::New(); |
| 11875 inner->Enter(); | 11876 inner->Enter(); |
| 11876 inner.Dispose(inner->GetIsolate()); | 11877 inner.Dispose(inner->GetIsolate()); |
| (...skipping 6449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18326 i::Semaphore* sem_; | 18327 i::Semaphore* sem_; |
| 18327 volatile int sem_value_; | 18328 volatile int sem_value_; |
| 18328 }; | 18329 }; |
| 18329 | 18330 |
| 18330 | 18331 |
| 18331 THREADED_TEST(SemaphoreInterruption) { | 18332 THREADED_TEST(SemaphoreInterruption) { |
| 18332 ThreadInterruptTest().RunTest(); | 18333 ThreadInterruptTest().RunTest(); |
| 18333 } | 18334 } |
| 18334 | 18335 |
| 18335 #endif // WIN32 | 18336 #endif // WIN32 |
| OLD | NEW |