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 16410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16421 CHECK_EQ(42, object.WrapperClassId()); | 16421 CHECK_EQ(42, object.WrapperClassId()); |
16422 | 16422 |
16423 Visitor42 visitor(object); | 16423 Visitor42 visitor(object); |
16424 v8::V8::VisitHandlesWithClassIds(&visitor); | 16424 v8::V8::VisitHandlesWithClassIds(&visitor); |
16425 CHECK_EQ(1, visitor.counter_); | 16425 CHECK_EQ(1, visitor.counter_); |
16426 | 16426 |
16427 object.Dispose(); | 16427 object.Dispose(); |
16428 } | 16428 } |
16429 | 16429 |
16430 | 16430 |
| 16431 TEST(PersistentHandleInNewSpaceVisitor) { |
| 16432 v8::HandleScope scope; |
| 16433 LocalContext context; |
| 16434 v8::Persistent<v8::Object> object1 = |
| 16435 v8::Persistent<v8::Object>::New(v8::Object::New()); |
| 16436 CHECK_EQ(0, object1.WrapperClassId()); |
| 16437 object1.SetWrapperClassId(42); |
| 16438 CHECK_EQ(42, object1.WrapperClassId()); |
| 16439 |
| 16440 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); |
| 16441 |
| 16442 v8::Persistent<v8::Object> object2 = |
| 16443 v8::Persistent<v8::Object>::New(v8::Object::New()); |
| 16444 CHECK_EQ(0, object2.WrapperClassId()); |
| 16445 object2.SetWrapperClassId(42); |
| 16446 CHECK_EQ(42, object2.WrapperClassId()); |
| 16447 |
| 16448 Visitor42 visitor(object2); |
| 16449 v8::V8::VisitHandlesInNewSpaceWithClassIds(&visitor); |
| 16450 CHECK_EQ(1, visitor.counter_); |
| 16451 |
| 16452 object1.Dispose(); |
| 16453 object2.Dispose(); |
| 16454 } |
| 16455 |
| 16456 |
16431 TEST(RegExp) { | 16457 TEST(RegExp) { |
16432 v8::HandleScope scope; | 16458 v8::HandleScope scope; |
16433 LocalContext context; | 16459 LocalContext context; |
16434 | 16460 |
16435 v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone); | 16461 v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone); |
16436 CHECK(re->IsRegExp()); | 16462 CHECK(re->IsRegExp()); |
16437 CHECK(re->GetSource()->Equals(v8_str("foo"))); | 16463 CHECK(re->GetSource()->Equals(v8_str("foo"))); |
16438 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); | 16464 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); |
16439 | 16465 |
16440 re = v8::RegExp::New(v8_str("bar"), | 16466 re = v8::RegExp::New(v8_str("bar"), |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17884 | 17910 |
17885 i::Semaphore* sem_; | 17911 i::Semaphore* sem_; |
17886 volatile int sem_value_; | 17912 volatile int sem_value_; |
17887 }; | 17913 }; |
17888 | 17914 |
17889 | 17915 |
17890 THREADED_TEST(SemaphoreInterruption) { | 17916 THREADED_TEST(SemaphoreInterruption) { |
17891 ThreadInterruptTest().RunTest(); | 17917 ThreadInterruptTest().RunTest(); |
17892 } | 17918 } |
17893 #endif // WIN32 | 17919 #endif // WIN32 |
OLD | NEW |