| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 | 553 |
| 554 const char* ProfilerExtension::kSource = | 554 const char* ProfilerExtension::kSource = |
| 555 "native function startProfiling();" | 555 "native function startProfiling();" |
| 556 "native function stopProfiling();"; | 556 "native function stopProfiling();"; |
| 557 | 557 |
| 558 v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate( | 558 v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate( |
| 559 v8::Isolate* isolate, v8::Handle<v8::String> name) { | 559 v8::Isolate* isolate, v8::Handle<v8::String> name) { |
| 560 if (name->Equals(v8::String::NewFromUtf8(isolate, "startProfiling"))) { | 560 if (name->Equals(v8::String::NewFromUtf8(isolate, "startProfiling"))) { |
| 561 return v8::FunctionTemplate::New(ProfilerExtension::StartProfiling); | 561 return v8::FunctionTemplate::New(isolate, |
| 562 ProfilerExtension::StartProfiling); |
| 562 } else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) { | 563 } else if (name->Equals(v8::String::NewFromUtf8(isolate, "stopProfiling"))) { |
| 563 return v8::FunctionTemplate::New(ProfilerExtension::StopProfiling); | 564 return v8::FunctionTemplate::New(isolate, ProfilerExtension::StopProfiling); |
| 564 } else { | 565 } else { |
| 565 CHECK(false); | 566 CHECK(false); |
| 566 return v8::Handle<v8::FunctionTemplate>(); | 567 return v8::Handle<v8::FunctionTemplate>(); |
| 567 } | 568 } |
| 568 } | 569 } |
| 569 | 570 |
| 570 | 571 |
| 571 void ProfilerExtension::StartProfiling( | 572 void ProfilerExtension::StartProfiling( |
| 572 const v8::FunctionCallbackInfo<v8::Value>& args) { | 573 const v8::FunctionCallbackInfo<v8::Value>& args) { |
| 573 v8::CpuProfiler* cpu_profiler = args.GetIsolate()->GetCpuProfiler(); | 574 v8::CpuProfiler* cpu_profiler = args.GetIsolate()->GetCpuProfiler(); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 827 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 827 | 828 |
| 828 current = PickChild(current, "TryFinally"); | 829 current = PickChild(current, "TryFinally"); |
| 829 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 830 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 830 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); | 831 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); |
| 831 | 832 |
| 832 current = PickChild(current, "TryCatch"); | 833 current = PickChild(current, "TryCatch"); |
| 833 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 834 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
| 834 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); | 835 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); |
| 835 } | 836 } |
| OLD | NEW |