Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: test/cctest/test-threads.cc

Issue 1267493006: Remove JSFunctionResultCache. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-threads.cc
diff --git a/test/cctest/test-threads.cc b/test/cctest/test-threads.cc
index 5f2cdae2a2488a2931c50eee50c54933e8f47042..a9058a523a4b0338f4e5f0df57127721644007e5 100644
--- a/test/cctest/test-threads.cc
+++ b/test/cctest/test-threads.cc
@@ -32,88 +32,6 @@
#include "src/isolate.h"
-enum Turn { FILL_CACHE, CLEAN_CACHE, SECOND_TIME_FILL_CACHE, CACHE_DONE };
-
-static Turn turn = FILL_CACHE;
-
-
-class ThreadA : public v8::base::Thread {
- public:
- ThreadA() : Thread(Options("ThreadA")) {}
- void Run() {
- v8::Isolate* isolate = CcTest::isolate();
- v8::Locker locker(isolate);
- v8::Isolate::Scope isolate_scope(isolate);
- v8::HandleScope scope(isolate);
- v8::Handle<v8::Context> context = v8::Context::New(isolate);
- v8::Context::Scope context_scope(context);
-
- CHECK_EQ(FILL_CACHE, turn);
-
- // Fill String.search cache.
- v8::Handle<v8::Script> script = v8::Script::Compile(
- v8::String::NewFromUtf8(
- isolate,
- "for (var i = 0; i < 3; i++) {"
- " var result = \"a\".search(\"a\");"
- " if (result != 0) throw \"result: \" + result + \" @\" + i;"
- "};"
- "true"));
- CHECK(script->Run()->IsTrue());
-
- turn = CLEAN_CACHE;
- do {
- {
- v8::Unlocker unlocker(CcTest::isolate());
- }
- } while (turn != SECOND_TIME_FILL_CACHE);
-
- // Rerun the script.
- CHECK(script->Run()->IsTrue());
-
- turn = CACHE_DONE;
- }
-};
-
-
-class ThreadB : public v8::base::Thread {
- public:
- ThreadB() : Thread(Options("ThreadB")) {}
- void Run() {
- do {
- {
- v8::Isolate* isolate = CcTest::isolate();
- v8::Locker locker(isolate);
- v8::Isolate::Scope isolate_scope(isolate);
- if (turn == CLEAN_CACHE) {
- v8::HandleScope scope(isolate);
- v8::Handle<v8::Context> context = v8::Context::New(isolate);
- v8::Context::Scope context_scope(context);
-
- // Clear the caches by forcing major GC.
- CcTest::heap()->CollectAllGarbage();
- turn = SECOND_TIME_FILL_CACHE;
- break;
- }
- }
- } while (true);
- }
-};
-
-
-TEST(JSFunctionResultCachesInTwoThreads) {
- ThreadA threadA;
- ThreadB threadB;
-
- threadA.Start();
- threadB.Start();
-
- threadA.Join();
- threadB.Join();
-
- CHECK_EQ(CACHE_DONE, turn);
-}
-
class ThreadIdValidationThread : public v8::base::Thread {
public:
ThreadIdValidationThread(v8::base::Thread* thread_to_start,
« no previous file with comments | « test/cctest/test-api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698