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 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 { | 2353 { |
2354 v8::HandleScope scope; | 2354 v8::HandleScope scope; |
2355 Local<String> str = v8_str("str"); | 2355 Local<String> str = v8_str("str"); |
2356 global = v8::Persistent<String>::New(str); | 2356 global = v8::Persistent<String>::New(str); |
2357 } | 2357 } |
2358 CHECK_EQ(global->Length(), 3); | 2358 CHECK_EQ(global->Length(), 3); |
2359 global.Dispose(v8::Isolate::GetCurrent()); | 2359 global.Dispose(v8::Isolate::GetCurrent()); |
2360 } | 2360 } |
2361 | 2361 |
2362 | 2362 |
| 2363 THREADED_TEST(LocalHandle) { |
| 2364 v8::HandleScope scope; |
| 2365 v8::Local<String> local = v8::Local<String>::New(v8_str("str")); |
| 2366 CHECK_EQ(local->Length(), 3); |
| 2367 |
| 2368 local = v8::Local<String>::New(v8::Isolate::GetCurrent(), v8_str("str")); |
| 2369 CHECK_EQ(local->Length(), 3); |
| 2370 } |
| 2371 |
| 2372 |
2363 class WeakCallCounter { | 2373 class WeakCallCounter { |
2364 public: | 2374 public: |
2365 explicit WeakCallCounter(int id) : id_(id), number_of_weak_calls_(0) { } | 2375 explicit WeakCallCounter(int id) : id_(id), number_of_weak_calls_(0) { } |
2366 int id() { return id_; } | 2376 int id() { return id_; } |
2367 void increment() { number_of_weak_calls_++; } | 2377 void increment() { number_of_weak_calls_++; } |
2368 int NumberOfWeakCalls() { return number_of_weak_calls_; } | 2378 int NumberOfWeakCalls() { return number_of_weak_calls_; } |
2369 private: | 2379 private: |
2370 int id_; | 2380 int id_; |
2371 int number_of_weak_calls_; | 2381 int number_of_weak_calls_; |
2372 }; | 2382 }; |
(...skipping 15648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18021 | 18031 |
18022 i::Semaphore* sem_; | 18032 i::Semaphore* sem_; |
18023 volatile int sem_value_; | 18033 volatile int sem_value_; |
18024 }; | 18034 }; |
18025 | 18035 |
18026 | 18036 |
18027 THREADED_TEST(SemaphoreInterruption) { | 18037 THREADED_TEST(SemaphoreInterruption) { |
18028 ThreadInterruptTest().RunTest(); | 18038 ThreadInterruptTest().RunTest(); |
18029 } | 18039 } |
18030 #endif // WIN32 | 18040 #endif // WIN32 |
OLD | NEW |