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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 i::Isolate* isolate = CcTest::i_isolate(); | 52 i::Isolate* isolate = CcTest::i_isolate(); |
53 CpuProfilesCollection profiles(isolate->heap()); | 53 CpuProfilesCollection profiles(isolate->heap()); |
54 ProfileGenerator generator(&profiles); | 54 ProfileGenerator generator(&profiles); |
55 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( | 55 SmartPointer<ProfilerEventsProcessor> processor(new ProfilerEventsProcessor( |
56 &generator, NULL, TimeDelta::FromMicroseconds(100))); | 56 &generator, NULL, TimeDelta::FromMicroseconds(100))); |
57 processor->Start(); | 57 processor->Start(); |
58 processor->StopSynchronously(); | 58 processor->StopSynchronously(); |
59 } | 59 } |
60 | 60 |
61 | 61 |
62 static inline i::Address ToAddress(int n) { | |
63 return reinterpret_cast<i::Address>(n); | |
64 } | |
65 | |
66 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, | 62 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
67 i::Address frame1, | 63 i::Address frame1, |
68 i::Address frame2 = NULL, | 64 i::Address frame2 = NULL, |
69 i::Address frame3 = NULL) { | 65 i::Address frame3 = NULL) { |
70 i::TickSample* sample = proc->StartTickSample(); | 66 i::TickSample* sample = proc->StartTickSample(); |
71 sample->pc = frame1; | 67 sample->pc = frame1; |
72 sample->tos = frame1; | 68 sample->tos = frame1; |
73 sample->frames_count = 0; | 69 sample->frames_count = 0; |
74 if (frame2 != NULL) { | 70 if (frame2 != NULL) { |
75 sample->stack[0] = frame2; | 71 sample->stack[0] = frame2; |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 const v8::CpuProfileNode* baz = GetChild(env->GetIsolate(), script, "baz"); | 1526 const v8::CpuProfileNode* baz = GetChild(env->GetIsolate(), script, "baz"); |
1531 CheckFunctionDetails(env->GetIsolate(), baz, "baz", "script_b", | 1527 CheckFunctionDetails(env->GetIsolate(), baz, "baz", "script_b", |
1532 script_b->GetId(), 3, 16); | 1528 script_b->GetId(), 3, 16); |
1533 const v8::CpuProfileNode* foo = GetChild(env->GetIsolate(), baz, "foo"); | 1529 const v8::CpuProfileNode* foo = GetChild(env->GetIsolate(), baz, "foo"); |
1534 CheckFunctionDetails(env->GetIsolate(), foo, "foo", "script_a", | 1530 CheckFunctionDetails(env->GetIsolate(), foo, "foo", "script_a", |
1535 script_a->GetId(), 2, 1); | 1531 script_a->GetId(), 2, 1); |
1536 const v8::CpuProfileNode* bar = GetChild(env->GetIsolate(), foo, "bar"); | 1532 const v8::CpuProfileNode* bar = GetChild(env->GetIsolate(), foo, "bar"); |
1537 CheckFunctionDetails(env->GetIsolate(), bar, "bar", "script_a", | 1533 CheckFunctionDetails(env->GetIsolate(), bar, "bar", "script_a", |
1538 script_a->GetId(), 3, 14); | 1534 script_a->GetId(), 3, 14); |
1539 } | 1535 } |
OLD | NEW |