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

Unified Diff: src/d8.cc

Issue 1252623003: [d8] Fix tsan bugs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: re-enable d8-worker-sharedarraybuffer Created 5 years, 5 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 | « src/d8.h ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index a56d029f5a5fb2fedb3fb568578ca9b90f53bada..1dad5694970cb343e88b5138dac20d86ba775ef2 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -335,7 +335,7 @@ bool Shell::ExecuteString(Isolate* isolate, Local<String> source,
#endif // !V8_SHARED
HandleScope handle_scope(isolate);
TryCatch try_catch(isolate);
- options.script_executed = true;
+ options.set_script_executed(true);
Jarin 2015/07/23 06:49:14 It looks like the set_script_executed could be cal
binji 2015/07/24 23:13:08 Done.
if (FLAG_debugger) {
// When debugging make exceptions appear to be uncaught.
try_catch.SetVerbose(true);
@@ -1645,7 +1645,7 @@ void SourceGroup::ExecuteInThread() {
Shell::CollectGarbage(isolate);
}
done_semaphore_.Signal();
- } while (!Shell::options.last_run);
+ } while (!Shell::options.last_run());
isolate->Dispose();
}
@@ -1662,7 +1662,7 @@ void SourceGroup::StartExecuteInThread() {
void SourceGroup::WaitForThread() {
if (thread_ == NULL) return;
- if (Shell::options.last_run) {
+ if (Shell::options.last_run()) {
thread_->Join();
} else {
done_semaphore_.Wait();
@@ -2100,7 +2100,7 @@ int Shell::RunMain(Isolate* isolate, int argc, char* argv[]) {
{
HandleScope scope(isolate);
Local<Context> context = CreateEvaluationContext(isolate);
- if (options.last_run && options.use_interactive_shell()) {
+ if (options.last_run() && options.use_interactive_shell()) {
// Keep using the same context in the interactive shell.
evaluation_context_.Reset(isolate, context);
#ifndef V8_SHARED
@@ -2246,6 +2246,7 @@ bool Shell::SerializeValue(Isolate* isolate, Local<Value> value,
contents = sab->GetContents();
} else {
contents = sab->Externalize();
+ base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
externalized_shared_contents_.Add(contents);
}
out_data->WriteSharedArrayBufferContents(contents);
@@ -2401,10 +2402,8 @@ void Shell::CleanupWorkers() {
}
// Now that all workers are terminated, we can re-enable Worker creation.
- {
- base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
- allow_new_workers_ = true;
- }
+ base::LockGuard<base::Mutex> lock_guard(workers_mutex_.Pointer());
+ allow_new_workers_ = true;
for (int i = 0; i < externalized_shared_contents_.length(); ++i) {
const SharedArrayBuffer::Contents& contents =
@@ -2552,7 +2551,7 @@ int Shell::Main(int argc, char* argv[]) {
for (int i = 0; i < stress_runs && result == 0; i++) {
printf("============ Stress %d/%d ============\n", i + 1, stress_runs);
Testing::PrepareStressRun(i);
- options.last_run = (i == stress_runs - 1);
+ options.set_last_run(i == stress_runs - 1);
Jarin 2015/07/23 06:49:14 I am a bit confused about how this can be run in p
binji 2015/07/24 23:13:08 No, the SourceGroup spawns a thread per isolate th
result = RunMain(isolate, argc, argv);
}
printf("======== Full Deoptimization =======\n");
@@ -2562,7 +2561,7 @@ int Shell::Main(int argc, char* argv[]) {
int stress_runs = i::FLAG_stress_runs;
for (int i = 0; i < stress_runs && result == 0; i++) {
printf("============ Run %d/%d ============\n", i + 1, stress_runs);
- options.last_run = (i == stress_runs - 1);
+ options.set_last_run(i == stress_runs - 1);
Jarin 2015/07/23 06:49:14 Same here.
result = RunMain(isolate, argc, argv);
}
#endif
« no previous file with comments | « src/d8.h ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698