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

Side by Side Diff: src/sampler.cc

Issue 25053002: Fix threading problems in test-api when running on simulator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed simulator() getter from isolate Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/cctest.status » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 private: 209 private:
210 HANDLE profiled_thread_; 210 HANDLE profiled_thread_;
211 }; 211 };
212 #endif 212 #endif
213 213
214 214
215 #if defined(USE_SIMULATOR) 215 #if defined(USE_SIMULATOR)
216 class SimulatorHelper { 216 class SimulatorHelper {
217 public: 217 public:
218 inline bool Init(Sampler* sampler, Isolate* isolate) { 218 inline bool Init(Sampler* sampler, Isolate* isolate) {
219 ThreadId thread_id = sampler->platform_data()->profiled_thread_id(); 219 simulator_ = isolate->thread_local_top()->simulator_;
220 Isolate::PerIsolateThreadData* per_thread_data = isolate->
221 FindPerThreadDataForThread(thread_id);
222 if (!per_thread_data) return false;
223 simulator_ = per_thread_data->simulator();
224 // Check if there is active simulator. 220 // Check if there is active simulator.
225 return simulator_ != NULL; 221 return simulator_ != NULL;
226 } 222 }
227 223
228 inline void FillRegisters(RegisterState* state) { 224 inline void FillRegisters(RegisterState* state) {
229 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); 225 state->pc = reinterpret_cast<Address>(simulator_->get_pc());
230 state->sp = reinterpret_cast<Address>(simulator_->get_register( 226 state->sp = reinterpret_cast<Address>(simulator_->get_register(
231 Simulator::sp)); 227 Simulator::sp));
232 #if V8_TARGET_ARCH_ARM 228 #if V8_TARGET_ARCH_ARM
233 state->fp = reinterpret_cast<Address>(simulator_->get_register( 229 state->fp = reinterpret_cast<Address>(simulator_->get_register(
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 #endif // USE_SIMULATOR 678 #endif // USE_SIMULATOR
683 SampleStack(state); 679 SampleStack(state);
684 } 680 }
685 ResumeThread(profiled_thread); 681 ResumeThread(profiled_thread);
686 } 682 }
687 683
688 #endif // USE_SIGNALS 684 #endif // USE_SIGNALS
689 685
690 686
691 } } // namespace v8::internal 687 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698