| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 TEST(StartStop) { | 51 TEST(StartStop) { |
| 52 CpuProfilesCollection profiles; | 52 CpuProfilesCollection profiles; |
| 53 ProfileGenerator generator(&profiles); | 53 ProfileGenerator generator(&profiles); |
| 54 ProfilerEventsProcessor processor(&generator); | 54 ProfilerEventsProcessor processor(&generator); |
| 55 processor.Start(); | 55 processor.Start(); |
| 56 processor.Stop(); | 56 processor.Stop(); |
| 57 processor.Join(); | 57 processor.Join(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 |
| 60 static inline i::Address ToAddress(int n) { | 61 static inline i::Address ToAddress(int n) { |
| 61 return reinterpret_cast<i::Address>(n); | 62 return reinterpret_cast<i::Address>(n); |
| 62 } | 63 } |
| 63 | 64 |
| 64 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, | 65 static void EnqueueTickSampleEvent(ProfilerEventsProcessor* proc, |
| 65 i::Address frame1, | 66 i::Address frame1, |
| 66 i::Address frame2 = NULL, | 67 i::Address frame2 = NULL, |
| 67 i::Address frame3 = NULL) { | 68 i::Address frame3 = NULL) { |
| 68 i::TickSample* sample = proc->TickSampleEvent(); | 69 i::TickSample* sample = proc->TickSampleEvent(); |
| 69 sample->pc = frame1; | 70 sample->pc = frame1; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 CHECK_NE(NULL, comment2); | 183 CHECK_NE(NULL, comment2); |
| 183 CHECK_EQ("comment2", comment2->name()); | 184 CHECK_EQ("comment2", comment2->name()); |
| 184 } | 185 } |
| 185 | 186 |
| 186 | 187 |
| 187 template<typename T> | 188 template<typename T> |
| 188 static int CompareProfileNodes(const T* p1, const T* p2) { | 189 static int CompareProfileNodes(const T* p1, const T* p2) { |
| 189 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); | 190 return strcmp((*p1)->entry()->name(), (*p2)->entry()->name()); |
| 190 } | 191 } |
| 191 | 192 |
| 193 |
| 192 TEST(TickEvents) { | 194 TEST(TickEvents) { |
| 193 TestSetup test_setup; | 195 TestSetup test_setup; |
| 194 LocalContext env; | 196 LocalContext env; |
| 195 i::Isolate* isolate = i::Isolate::Current(); | 197 i::Isolate* isolate = i::Isolate::Current(); |
| 196 i::HandleScope scope(isolate); | 198 i::HandleScope scope(isolate); |
| 197 | 199 |
| 198 i::Code* frame1_code = CreateCode(&env); | 200 i::Code* frame1_code = CreateCode(&env); |
| 199 i::Code* frame2_code = CreateCode(&env); | 201 i::Code* frame2_code = CreateCode(&env); |
| 200 i::Code* frame3_code = CreateCode(&env); | 202 i::Code* frame3_code = CreateCode(&env); |
| 201 | 203 |
| (...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 FindChild(startNode, ProfileGenerator::kUnresolvedFunctionName)) { | 1197 FindChild(startNode, ProfileGenerator::kUnresolvedFunctionName)) { |
| 1196 ScopedVector<v8::Handle<v8::String> > names(1); | 1198 ScopedVector<v8::Handle<v8::String> > names(1); |
| 1197 names[0] = v8::String::New("apply"); | 1199 names[0] = v8::String::New("apply"); |
| 1198 CheckChildrenNames(unresolvedNode, names); | 1200 CheckChildrenNames(unresolvedNode, names); |
| 1199 GetChild(unresolvedNode, "apply"); | 1201 GetChild(unresolvedNode, "apply"); |
| 1200 } | 1202 } |
| 1201 } | 1203 } |
| 1202 | 1204 |
| 1203 cpu_profiler->DeleteAllCpuProfiles(); | 1205 cpu_profiler->DeleteAllCpuProfiles(); |
| 1204 } | 1206 } |
| OLD | NEW |