OLD | NEW |
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 // Tests the sampling API in include/v8.h | 5 // Tests the sampling API in include/v8.h |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 #include "src/simulator.h" | 10 #include "src/simulator.h" |
(...skipping 53 matching lines...) Loading... |
64 state->sp = reinterpret_cast<void*>( | 64 state->sp = reinterpret_cast<void*>( |
65 simulator_->get_register(v8::internal::Simulator::sp)); | 65 simulator_->get_register(v8::internal::Simulator::sp)); |
66 state->fp = reinterpret_cast<void*>( | 66 state->fp = reinterpret_cast<void*>( |
67 simulator_->get_register(v8::internal::Simulator::fp)); | 67 simulator_->get_register(v8::internal::Simulator::fp)); |
68 #elif V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 | 68 #elif V8_TARGET_ARCH_PPC || V8_TARGET_ARCH_PPC64 |
69 state->pc = reinterpret_cast<void*>(simulator_->get_pc()); | 69 state->pc = reinterpret_cast<void*>(simulator_->get_pc()); |
70 state->sp = reinterpret_cast<void*>( | 70 state->sp = reinterpret_cast<void*>( |
71 simulator_->get_register(v8::internal::Simulator::sp)); | 71 simulator_->get_register(v8::internal::Simulator::sp)); |
72 state->fp = reinterpret_cast<void*>( | 72 state->fp = reinterpret_cast<void*>( |
73 simulator_->get_register(v8::internal::Simulator::fp)); | 73 simulator_->get_register(v8::internal::Simulator::fp)); |
| 74 #elif V8_TARGET_ARCH_S390 || V8_TARGET_ARCH_S390X |
| 75 state->pc = reinterpret_cast<void*>(simulator_->get_pc()); |
| 76 state->sp = reinterpret_cast<void*>( |
| 77 simulator_->get_register(v8::internal::Simulator::sp)); |
| 78 state->fp = reinterpret_cast<void*>( |
| 79 simulator_->get_register(v8::internal::Simulator::fp)); |
74 #endif | 80 #endif |
75 } | 81 } |
76 | 82 |
77 private: | 83 private: |
78 v8::internal::Simulator* simulator_; | 84 v8::internal::Simulator* simulator_; |
79 }; | 85 }; |
80 #endif // USE_SIMULATOR | 86 #endif // USE_SIMULATOR |
81 | 87 |
82 | 88 |
83 class SamplingTestHelper { | 89 class SamplingTestHelper { |
(...skipping 158 matching lines...) Loading... |
242 | 248 |
243 const SamplingTestHelper::CodeEventEntry* entry; | 249 const SamplingTestHelper::CodeEventEntry* entry; |
244 entry = helper.FindEventEntry(sample.begin()[0]); | 250 entry = helper.FindEventEntry(sample.begin()[0]); |
245 CHECK(entry); | 251 CHECK(entry); |
246 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner")); | 252 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner")); |
247 | 253 |
248 entry = helper.FindEventEntry(sample.begin()[1]); | 254 entry = helper.FindEventEntry(sample.begin()[1]); |
249 CHECK(entry); | 255 CHECK(entry); |
250 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer")); | 256 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer")); |
251 } | 257 } |
OLD | NEW |