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

Side by Side Diff: src/ppc/simulator-ppc.cc

Issue 2852983002: [simulator] Make reference redirection thread-safe. (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/ppc/simulator-ppc.h ('k') | src/s390/simulator-s390.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdarg.h> 5 #include <stdarg.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <cmath> 7 #include <cmath>
8 8
9 #if V8_TARGET_ARCH_PPC 9 #if V8_TARGET_ARCH_PPC
10 10
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 delete static_cast<CachePage*>(entry->value); 887 delete static_cast<CachePage*>(entry->value);
888 } 888 }
889 delete i_cache; 889 delete i_cache;
890 } 890 }
891 } 891 }
892 892
893 893
894 void* Simulator::RedirectExternalReference(Isolate* isolate, 894 void* Simulator::RedirectExternalReference(Isolate* isolate,
895 void* external_function, 895 void* external_function,
896 ExternalReference::Type type) { 896 ExternalReference::Type type) {
897 base::LockGuard<base::Mutex> lock_guard(
898 isolate->simulator_redirection_mutex());
897 Redirection* redirection = Redirection::Get(isolate, external_function, type); 899 Redirection* redirection = Redirection::Get(isolate, external_function, type);
898 return redirection->address(); 900 return redirection->address();
899 } 901 }
900 902
901 903
902 // Get the active Simulator for the current thread. 904 // Get the active Simulator for the current thread.
903 Simulator* Simulator::current(Isolate* isolate) { 905 Simulator* Simulator::current(Isolate* isolate) {
904 v8::internal::Isolate::PerIsolateThreadData* isolate_data = 906 v8::internal::Isolate::PerIsolateThreadData* isolate_data =
905 isolate->FindOrAllocatePerThreadDataForThisThread(); 907 isolate->FindOrAllocatePerThreadDataForThisThread();
906 DCHECK(isolate_data != NULL); 908 DCHECK(isolate_data != NULL);
(...skipping 3523 matching lines...) Expand 10 before | Expand all | Expand 10 after
4430 } 4432 }
4431 processor->prev_ = nullptr; 4433 processor->prev_ = nullptr;
4432 processor->next_ = nullptr; 4434 processor->next_ = nullptr;
4433 } 4435 }
4434 4436
4435 } // namespace internal 4437 } // namespace internal
4436 } // namespace v8 4438 } // namespace v8
4437 4439
4438 #endif // USE_SIMULATOR 4440 #endif // USE_SIMULATOR
4439 #endif // V8_TARGET_ARCH_PPC 4441 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/ppc/simulator-ppc.h ('k') | src/s390/simulator-s390.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698