OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static inline i::Address ToAddress(int n) { | 57 static inline i::Address ToAddress(int n) { |
58 return reinterpret_cast<i::Address>(n); | 58 return reinterpret_cast<i::Address>(n); |
59 } | 59 } |
60 | 60 |
61 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, | 61 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
62 i::Address frame1, | 62 i::Address frame1, |
63 i::Address frame2 = NULL, | 63 i::Address frame2 = NULL, |
64 i::Address frame3 = NULL) { | 64 i::Address frame3 = NULL) { |
65 i::TickSample* sample = proc->TickSampleEvent(); | 65 i::TickSample* sample = proc->TickSampleEvent(); |
66 sample->pc = frame1; | 66 sample->pc = frame1; |
| 67 sample->tos = frame1; |
67 sample->frames_count = 0; | 68 sample->frames_count = 0; |
68 if (frame2 != NULL) { | 69 if (frame2 != NULL) { |
69 sample->stack[0] = frame2; | 70 sample->stack[0] = frame2; |
70 sample->frames_count = 1; | 71 sample->frames_count = 1; |
71 } | 72 } |
72 if (frame3 != NULL) { | 73 if (frame3 != NULL) { |
73 sample->stack[1] = frame3; | 74 sample->stack[1] = frame3; |
74 sample->frames_count = 2; | 75 sample->frames_count = 2; |
75 } | 76 } |
76 } | 77 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 ProfilerEventsProcessor processor(&generator); | 232 ProfilerEventsProcessor processor(&generator); |
232 processor.Start(); | 233 processor.Start(); |
233 | 234 |
234 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, | 235 processor.CodeCreateEvent(i::Logger::BUILTIN_TAG, |
235 "bbb", | 236 "bbb", |
236 ToAddress(0x1200), | 237 ToAddress(0x1200), |
237 0x80); | 238 0x80); |
238 | 239 |
239 i::TickSample* sample = processor.TickSampleEvent(); | 240 i::TickSample* sample = processor.TickSampleEvent(); |
240 sample->pc = ToAddress(0x1200); | 241 sample->pc = ToAddress(0x1200); |
| 242 sample->tos = 0; |
241 sample->frames_count = i::TickSample::kMaxFramesCount; | 243 sample->frames_count = i::TickSample::kMaxFramesCount; |
242 for (int i = 0; i < sample->frames_count; ++i) { | 244 for (int i = 0; i < sample->frames_count; ++i) { |
243 sample->stack[i] = ToAddress(0x1200); | 245 sample->stack[i] = ToAddress(0x1200); |
244 } | 246 } |
245 | 247 |
246 processor.Stop(); | 248 processor.Stop(); |
247 processor.Join(); | 249 processor.Join(); |
248 CpuProfile* profile = | 250 CpuProfile* profile = |
249 profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1); | 251 profiles.StopProfiling(TokenEnumerator::kNoSecurityToken, "", 1); |
250 CHECK_NE(NULL, profile); | 252 CHECK_NE(NULL, profile); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 | 538 |
537 const char* barBranch[] = { "bar", "delay", "loop" }; | 539 const char* barBranch[] = { "bar", "delay", "loop" }; |
538 CheckSimpleBranch(fooNode, barBranch, ARRAY_SIZE(barBranch)); | 540 CheckSimpleBranch(fooNode, barBranch, ARRAY_SIZE(barBranch)); |
539 const char* bazBranch[] = { "baz", "delay", "loop" }; | 541 const char* bazBranch[] = { "baz", "delay", "loop" }; |
540 CheckSimpleBranch(fooNode, bazBranch, ARRAY_SIZE(bazBranch)); | 542 CheckSimpleBranch(fooNode, bazBranch, ARRAY_SIZE(bazBranch)); |
541 const char* delayBranch[] = { "delay", "loop" }; | 543 const char* delayBranch[] = { "delay", "loop" }; |
542 CheckSimpleBranch(fooNode, delayBranch, ARRAY_SIZE(delayBranch)); | 544 CheckSimpleBranch(fooNode, delayBranch, ARRAY_SIZE(delayBranch)); |
543 | 545 |
544 cpu_profiler->DeleteAllCpuProfiles(); | 546 cpu_profiler->DeleteAllCpuProfiles(); |
545 } | 547 } |
OLD | NEW |