| 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 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 void PrintAccessorTime() { | 674 void PrintAccessorTime() { |
| 675 i::OS::Print("getter: %f ms (%d); setter: %f ms (%d)\n", getter_duration_, | 675 i::OS::Print("getter: %f ms (%d); setter: %f ms (%d)\n", getter_duration_, |
| 676 getter_iterations_, setter_duration_, setter_iterations_); | 676 getter_iterations_, setter_duration_, setter_iterations_); |
| 677 } | 677 } |
| 678 | 678 |
| 679 private: | 679 private: |
| 680 double Wait(int* iterations) { | 680 double Wait(int* iterations) { |
| 681 double start = i::OS::TimeCurrentMillis(); | 681 double start = i::OS::TimeCurrentMillis(); |
| 682 double duration = 0; | 682 double duration = 0; |
| 683 while (duration < min_duration_ms_) { | 683 while (duration < min_duration_ms_) { |
| 684 i::OS::Sleep(1); |
| 684 duration = i::OS::TimeCurrentMillis() - start; | 685 duration = i::OS::TimeCurrentMillis() - start; |
| 685 ++*iterations; | 686 ++*iterations; |
| 686 } | 687 } |
| 687 return duration; | 688 return duration; |
| 688 } | 689 } |
| 689 | 690 |
| 690 static FooAccessorsData* fromInfo(const v8::AccessorInfo& info) { | 691 static FooAccessorsData* fromInfo(const v8::AccessorInfo& info) { |
| 691 void* data = v8::External::Cast(*info.Data())->Value(); | 692 void* data = v8::External::Cast(*info.Data())->Value(); |
| 692 return reinterpret_cast<FooAccessorsData*>(data); | 693 return reinterpret_cast<FooAccessorsData*>(data); |
| 693 } | 694 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 | 792 |
| 792 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); | 793 const v8::CpuProfileNode* root = profile->GetTopDownRoot(); |
| 793 const v8::CpuProfileNode* startNode = GetChild(root, "start"); | 794 const v8::CpuProfileNode* startNode = GetChild(root, "start"); |
| 794 // TODO(yurys): in LoadIC should be changed to report external callback | 795 // TODO(yurys): in LoadIC should be changed to report external callback |
| 795 // invocation. See r13768 where it was LoadCallbackProperty was removed. | 796 // invocation. See r13768 where it was LoadCallbackProperty was removed. |
| 796 // GetChild(startNode, "get foo"); | 797 // GetChild(startNode, "get foo"); |
| 797 GetChild(startNode, "set foo"); | 798 GetChild(startNode, "set foo"); |
| 798 | 799 |
| 799 cpu_profiler->DeleteAllCpuProfiles(); | 800 cpu_profiler->DeleteAllCpuProfiles(); |
| 800 } | 801 } |
| OLD | NEW |