| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 CodeEntries::iterator it = code_entries_.find(event->code_start); | 165 CodeEntries::iterator it = code_entries_.find(event->code_start); |
| 166 CHECK(it != code_entries_.end()); | 166 CHECK(it != code_entries_.end()); |
| 167 code_entries_.erase(it); | 167 code_entries_.erase(it); |
| 168 CodeEventEntry entry; | 168 CodeEventEntry entry; |
| 169 entry.name = std::string(event->name.str, event->name.len); | 169 entry.name = std::string(event->name.str, event->name.len); |
| 170 entry.code_start = event->new_code_start; | 170 entry.code_start = event->new_code_start; |
| 171 entry.code_len = event->code_len; | 171 entry.code_len = event->code_len; |
| 172 code_entries_.insert(std::make_pair(entry.code_start, entry)); | 172 code_entries_.insert(std::make_pair(entry.code_start, entry)); |
| 173 break; | 173 break; |
| 174 } | 174 } |
| 175 case v8::JitCodeEvent::CODE_REMOVED: | |
| 176 code_entries_.erase(event->code_start); | |
| 177 break; | |
| 178 default: | 175 default: |
| 179 break; | 176 break; |
| 180 } | 177 } |
| 181 } | 178 } |
| 182 | 179 |
| 183 Sample sample_; | 180 Sample sample_; |
| 184 bool sample_is_taken_; | 181 bool sample_is_taken_; |
| 185 v8::Isolate* isolate_; | 182 v8::Isolate* isolate_; |
| 186 CodeEntries code_entries_; | 183 CodeEntries code_entries_; |
| 187 | 184 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 239 |
| 243 const SamplingTestHelper::CodeEventEntry* entry; | 240 const SamplingTestHelper::CodeEventEntry* entry; |
| 244 entry = helper.FindEventEntry(sample.begin()[0]); | 241 entry = helper.FindEventEntry(sample.begin()[0]); |
| 245 CHECK(entry); | 242 CHECK(entry); |
| 246 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner")); | 243 CHECK(std::string::npos != entry->name.find("test_sampler_api_inner")); |
| 247 | 244 |
| 248 entry = helper.FindEventEntry(sample.begin()[1]); | 245 entry = helper.FindEventEntry(sample.begin()[1]); |
| 249 CHECK(entry); | 246 CHECK(entry); |
| 250 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer")); | 247 CHECK(std::string::npos != entry->name.find("test_sampler_api_outer")); |
| 251 } | 248 } |
| OLD | NEW |