| 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 16681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16692 LocalContext context; | 16692 LocalContext context; |
| 16693 v8::Persistent<v8::Object> object = | 16693 v8::Persistent<v8::Object> object = |
| 16694 v8::Persistent<v8::Object>::New(v8::Object::New()); | 16694 v8::Persistent<v8::Object>::New(v8::Object::New()); |
| 16695 CHECK_EQ(0, object.WrapperClassId()); | 16695 CHECK_EQ(0, object.WrapperClassId()); |
| 16696 object.SetWrapperClassId(65535); | 16696 object.SetWrapperClassId(65535); |
| 16697 CHECK_EQ(65535, object.WrapperClassId()); | 16697 CHECK_EQ(65535, object.WrapperClassId()); |
| 16698 object.Dispose(); | 16698 object.Dispose(); |
| 16699 } | 16699 } |
| 16700 | 16700 |
| 16701 | 16701 |
| 16702 TEST(PersistentHandleInNewSpaceVisitor) { |
| 16703 v8::HandleScope scope; |
| 16704 LocalContext context; |
| 16705 v8::Persistent<v8::Object> object1 = |
| 16706 v8::Persistent<v8::Object>::New(v8::Object::New()); |
| 16707 CHECK_EQ(0, object1.WrapperClassId()); |
| 16708 object1.SetWrapperClassId(42); |
| 16709 CHECK_EQ(42, object1.WrapperClassId()); |
| 16710 |
| 16711 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); |
| 16712 |
| 16713 v8::Persistent<v8::Object> object2 = |
| 16714 v8::Persistent<v8::Object>::New(v8::Object::New()); |
| 16715 CHECK_EQ(0, object2.WrapperClassId()); |
| 16716 object2.SetWrapperClassId(42); |
| 16717 CHECK_EQ(42, object2.WrapperClassId()); |
| 16718 |
| 16719 Visitor42 visitor(object2); |
| 16720 v8::V8::VisitHandlesForPartialDependence(v8::Isolate::GetCurrent(), &visitor); |
| 16721 CHECK_EQ(1, visitor.counter_); |
| 16722 |
| 16723 object1.Dispose(); |
| 16724 object2.Dispose(); |
| 16725 } |
| 16726 |
| 16727 |
| 16702 TEST(RegExp) { | 16728 TEST(RegExp) { |
| 16703 v8::HandleScope scope; | 16729 v8::HandleScope scope; |
| 16704 LocalContext context; | 16730 LocalContext context; |
| 16705 | 16731 |
| 16706 v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone); | 16732 v8::Handle<v8::RegExp> re = v8::RegExp::New(v8_str("foo"), v8::RegExp::kNone); |
| 16707 CHECK(re->IsRegExp()); | 16733 CHECK(re->IsRegExp()); |
| 16708 CHECK(re->GetSource()->Equals(v8_str("foo"))); | 16734 CHECK(re->GetSource()->Equals(v8_str("foo"))); |
| 16709 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); | 16735 CHECK_EQ(v8::RegExp::kNone, re->GetFlags()); |
| 16710 | 16736 |
| 16711 re = v8::RegExp::New(v8_str("bar"), | 16737 re = v8::RegExp::New(v8_str("bar"), |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18155 i::Semaphore* sem_; | 18181 i::Semaphore* sem_; |
| 18156 volatile int sem_value_; | 18182 volatile int sem_value_; |
| 18157 }; | 18183 }; |
| 18158 | 18184 |
| 18159 | 18185 |
| 18160 THREADED_TEST(SemaphoreInterruption) { | 18186 THREADED_TEST(SemaphoreInterruption) { |
| 18161 ThreadInterruptTest().RunTest(); | 18187 ThreadInterruptTest().RunTest(); |
| 18162 } | 18188 } |
| 18163 | 18189 |
| 18164 #endif // WIN32 | 18190 #endif // WIN32 |
| OLD | NEW |