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 19262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19273 v8::HandleScope scope(context->GetIsolate()); | 19273 v8::HandleScope scope(context->GetIsolate()); |
19274 Local<Value> set_value = CompileRun("new Set();"); | 19274 Local<Value> set_value = CompileRun("new Set();"); |
19275 Local<Object> set_object(Local<Object>::Cast(set_value)); | 19275 Local<Object> set_object(Local<Object>::Cast(set_value)); |
19276 CHECK_EQ(0, set_object->InternalFieldCount()); | 19276 CHECK_EQ(0, set_object->InternalFieldCount()); |
19277 Local<Value> map_value = CompileRun("new Map();"); | 19277 Local<Value> map_value = CompileRun("new Map();"); |
19278 Local<Object> map_object(Local<Object>::Cast(map_value)); | 19278 Local<Object> map_object(Local<Object>::Cast(map_value)); |
19279 CHECK_EQ(0, map_object->InternalFieldCount()); | 19279 CHECK_EQ(0, map_object->InternalFieldCount()); |
19280 } | 19280 } |
19281 | 19281 |
19282 | 19282 |
| 19283 THREADED_TEST(Regress2746) { |
| 19284 LocalContext context; |
| 19285 v8::HandleScope scope(context->GetIsolate()); |
| 19286 Local<Object> obj = Object::New(); |
| 19287 Local<String> key = String::New("key"); |
| 19288 obj->SetHiddenValue(key, v8::Undefined()); |
| 19289 Local<Value> value = obj->GetHiddenValue(key); |
| 19290 CHECK(!value.IsEmpty()); |
| 19291 CHECK(value->IsUndefined()); |
| 19292 } |
| 19293 |
| 19294 |
19283 #ifndef WIN32 | 19295 #ifndef WIN32 |
19284 class ThreadInterruptTest { | 19296 class ThreadInterruptTest { |
19285 public: | 19297 public: |
19286 ThreadInterruptTest() : sem_(NULL), sem_value_(0) { } | 19298 ThreadInterruptTest() : sem_(NULL), sem_value_(0) { } |
19287 ~ThreadInterruptTest() { delete sem_; } | 19299 ~ThreadInterruptTest() { delete sem_; } |
19288 | 19300 |
19289 void RunTest() { | 19301 void RunTest() { |
19290 sem_ = i::OS::CreateSemaphore(0); | 19302 sem_ = i::OS::CreateSemaphore(0); |
19291 | 19303 |
19292 InterruptThread i_thread(this); | 19304 InterruptThread i_thread(this); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19336 i::Semaphore* sem_; | 19348 i::Semaphore* sem_; |
19337 volatile int sem_value_; | 19349 volatile int sem_value_; |
19338 }; | 19350 }; |
19339 | 19351 |
19340 | 19352 |
19341 THREADED_TEST(SemaphoreInterruption) { | 19353 THREADED_TEST(SemaphoreInterruption) { |
19342 ThreadInterruptTest().RunTest(); | 19354 ThreadInterruptTest().RunTest(); |
19343 } | 19355 } |
19344 | 19356 |
19345 #endif // WIN32 | 19357 #endif // WIN32 |
OLD | NEW |