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

Side by Side Diff: src/mips/simulator-mips.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/mips/simulator-mips.h ('k') | src/mips64/simulator-mips64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <cmath> 8 #include <cmath>
9 9
10 #if V8_TARGET_ARCH_MIPS 10 #if V8_TARGET_ARCH_MIPS
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 delete static_cast<CachePage*>(entry->value); 1009 delete static_cast<CachePage*>(entry->value);
1010 } 1010 }
1011 delete i_cache; 1011 delete i_cache;
1012 } 1012 }
1013 } 1013 }
1014 1014
1015 1015
1016 void* Simulator::RedirectExternalReference(Isolate* isolate, 1016 void* Simulator::RedirectExternalReference(Isolate* isolate,
1017 void* external_function, 1017 void* external_function,
1018 ExternalReference::Type type) { 1018 ExternalReference::Type type) {
1019 base::LockGuard<base::Mutex> lock_guard(
1020 isolate->simulator_redirection_mutex());
1019 Redirection* redirection = Redirection::Get(isolate, external_function, type); 1021 Redirection* redirection = Redirection::Get(isolate, external_function, type);
1020 return redirection->address_of_swi_instruction(); 1022 return redirection->address_of_swi_instruction();
1021 } 1023 }
1022 1024
1023 1025
1024 // Get the active Simulator for the current thread. 1026 // Get the active Simulator for the current thread.
1025 Simulator* Simulator::current(Isolate* isolate) { 1027 Simulator* Simulator::current(Isolate* isolate) {
1026 v8::internal::Isolate::PerIsolateThreadData* isolate_data = 1028 v8::internal::Isolate::PerIsolateThreadData* isolate_data =
1027 isolate->FindOrAllocatePerThreadDataForThisThread(); 1029 isolate->FindOrAllocatePerThreadDataForThisThread();
1028 DCHECK(isolate_data != NULL); 1030 DCHECK(isolate_data != NULL);
(...skipping 3818 matching lines...) Expand 10 before | Expand all | Expand 10 after
4847 4849
4848 4850
4849 #undef UNSUPPORTED 4851 #undef UNSUPPORTED
4850 4852
4851 } // namespace internal 4853 } // namespace internal
4852 } // namespace v8 4854 } // namespace v8
4853 4855
4854 #endif // USE_SIMULATOR 4856 #endif // USE_SIMULATOR
4855 4857
4856 #endif // V8_TARGET_ARCH_MIPS 4858 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.h ('k') | src/mips64/simulator-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698