| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 v8::Locker locker(isolate); | 51 v8::Locker locker(isolate); |
| 52 v8::Isolate::Scope isolate_scope(isolate); | 52 v8::Isolate::Scope isolate_scope(isolate); |
| 53 v8::HandleScope scope(isolate); | 53 v8::HandleScope scope(isolate); |
| 54 v8::Handle<v8::Context> context = v8::Context::New(isolate); | 54 v8::Handle<v8::Context> context = v8::Context::New(isolate); |
| 55 v8::Context::Scope context_scope(context); | 55 v8::Context::Scope context_scope(context); |
| 56 | 56 |
| 57 CHECK_EQ(FILL_CACHE, turn); | 57 CHECK_EQ(FILL_CACHE, turn); |
| 58 | 58 |
| 59 // Fill String.search cache. | 59 // Fill String.search cache. |
| 60 v8::Handle<v8::Script> script = v8::Script::Compile( | 60 v8::Handle<v8::Script> script = v8::Script::Compile( |
| 61 v8::String::New( | 61 v8::String::NewFromUtf8( |
| 62 isolate, |
| 62 "for (var i = 0; i < 3; i++) {" | 63 "for (var i = 0; i < 3; i++) {" |
| 63 " var result = \"a\".search(\"a\");" | 64 " var result = \"a\".search(\"a\");" |
| 64 " if (result != 0) throw \"result: \" + result + \" @\" + i;" | 65 " if (result != 0) throw \"result: \" + result + \" @\" + i;" |
| 65 "};" | 66 "};" |
| 66 "true")); | 67 "true")); |
| 67 CHECK(script->Run()->IsTrue()); | 68 CHECK(script->Run()->IsTrue()); |
| 68 | 69 |
| 69 turn = CLEAN_CACHE; | 70 turn = CLEAN_CACHE; |
| 70 do { | 71 do { |
| 71 { | 72 { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 Join(); | 185 Join(); |
| 185 } | 186 } |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 | 189 |
| 189 TEST(ThreadJoinSelf) { | 190 TEST(ThreadJoinSelf) { |
| 190 ThreadC thread; | 191 ThreadC thread; |
| 191 thread.Start(); | 192 thread.Start(); |
| 192 thread.Join(); | 193 thread.Join(); |
| 193 } | 194 } |
| OLD | NEW |