| 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 3115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3126 Local<String> str = v8_str("str"); | 3126 Local<String> str = v8_str("str"); |
| 3127 global_handles = | 3127 global_handles = |
| 3128 reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles(); | 3128 reinterpret_cast<v8::internal::Isolate*>(isolate)->global_handles(); |
| 3129 initial_handle_count = global_handles->NumberOfGlobalHandles(); | 3129 initial_handle_count = global_handles->NumberOfGlobalHandles(); |
| 3130 global.Reset(isolate, str); | 3130 global.Reset(isolate, str); |
| 3131 } | 3131 } |
| 3132 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); | 3132 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); |
| 3133 String* str = global.ClearAndLeak(); | 3133 String* str = global.ClearAndLeak(); |
| 3134 CHECK(global.IsEmpty()); | 3134 CHECK(global.IsEmpty()); |
| 3135 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); | 3135 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count + 1); |
| 3136 v8::Persistent<String>* new_global = | 3136 global_handles->Destroy(reinterpret_cast<i::Object**>(str)); |
| 3137 reinterpret_cast<v8::Persistent<String>*>(&str); | |
| 3138 new_global->Dispose(); | |
| 3139 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count); | 3137 CHECK_EQ(global_handles->NumberOfGlobalHandles(), initial_handle_count); |
| 3140 } | 3138 } |
| 3141 | 3139 |
| 3142 | 3140 |
| 3143 THREADED_TEST(GlobalHandleUpcast) { | 3141 THREADED_TEST(GlobalHandleUpcast) { |
| 3144 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 3142 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
| 3145 v8::HandleScope scope(isolate); | 3143 v8::HandleScope scope(isolate); |
| 3146 v8::Local<String> local = v8::Local<String>::New(v8_str("str")); | 3144 v8::Local<String> local = v8::Local<String>::New(v8_str("str")); |
| 3147 v8::Persistent<String> global_string(isolate, local); | 3145 v8::Persistent<String> global_string(isolate, local); |
| 3148 #ifdef V8_USE_UNSAFE_HANDLES | 3146 #ifdef V8_USE_UNSAFE_HANDLES |
| (...skipping 16306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19455 i::Semaphore* sem_; | 19453 i::Semaphore* sem_; |
| 19456 volatile int sem_value_; | 19454 volatile int sem_value_; |
| 19457 }; | 19455 }; |
| 19458 | 19456 |
| 19459 | 19457 |
| 19460 THREADED_TEST(SemaphoreInterruption) { | 19458 THREADED_TEST(SemaphoreInterruption) { |
| 19461 ThreadInterruptTest().RunTest(); | 19459 ThreadInterruptTest().RunTest(); |
| 19462 } | 19460 } |
| 19463 | 19461 |
| 19464 #endif // WIN32 | 19462 #endif // WIN32 |
| OLD | NEW |