| OLD | NEW |
| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 private: | 222 private: |
| 223 HANDLE profiled_thread_; | 223 HANDLE profiled_thread_; |
| 224 }; | 224 }; |
| 225 #endif | 225 #endif |
| 226 | 226 |
| 227 | 227 |
| 228 #if defined(USE_SIMULATOR) | 228 #if defined(USE_SIMULATOR) |
| 229 class SimulatorHelper { | 229 class SimulatorHelper { |
| 230 public: | 230 public: |
| 231 inline bool Init(Sampler* sampler, Isolate* isolate) { | 231 inline bool Init(Sampler* sampler, Isolate* isolate) { |
| 232 ThreadId thread_id = sampler->platform_data()->profiled_thread_id(); | 232 simulator_ = isolate->thread_local_top()->simulator_; |
| 233 Isolate::PerIsolateThreadData* per_thread_data = isolate-> | |
| 234 FindPerThreadDataForThread(thread_id); | |
| 235 if (!per_thread_data) return false; | |
| 236 simulator_ = per_thread_data->simulator(); | |
| 237 // Check if there is active simulator. | 233 // Check if there is active simulator. |
| 238 return simulator_ != NULL; | 234 return simulator_ != NULL; |
| 239 } | 235 } |
| 240 | 236 |
| 241 inline void FillRegisters(RegisterState* state) { | 237 inline void FillRegisters(RegisterState* state) { |
| 242 #if V8_TARGET_ARCH_ARM | 238 #if V8_TARGET_ARCH_ARM |
| 243 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); | 239 state->pc = reinterpret_cast<Address>(simulator_->get_pc()); |
| 244 state->sp = reinterpret_cast<Address>(simulator_->get_register( | 240 state->sp = reinterpret_cast<Address>(simulator_->get_register( |
| 245 Simulator::sp)); | 241 Simulator::sp)); |
| 246 state->fp = reinterpret_cast<Address>(simulator_->get_register( | 242 state->fp = reinterpret_cast<Address>(simulator_->get_register( |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 #endif // USE_SIMULATOR | 715 #endif // USE_SIMULATOR |
| 720 SampleStack(state); | 716 SampleStack(state); |
| 721 } | 717 } |
| 722 ResumeThread(profiled_thread); | 718 ResumeThread(profiled_thread); |
| 723 } | 719 } |
| 724 | 720 |
| 725 #endif // USE_SIGNALS | 721 #endif // USE_SIGNALS |
| 726 | 722 |
| 727 | 723 |
| 728 } } // namespace v8::internal | 724 } } // namespace v8::internal |
| OLD | NEW |