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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 } | 598 } |
599 return NULL; | 599 return NULL; |
600 } | 600 } |
601 | 601 |
602 | 602 |
603 TEST(RecordStackTraceAtStartProfiling) { | 603 TEST(RecordStackTraceAtStartProfiling) { |
604 // This test does not pass with inlining enabled since inlined functions | 604 // This test does not pass with inlining enabled since inlined functions |
605 // don't appear in the stack trace. | 605 // don't appear in the stack trace. |
606 i::FLAG_use_inlining = false; | 606 i::FLAG_use_inlining = false; |
607 | 607 |
608 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 608 v8::Isolate* isolate = CcTest::isolate(); |
609 v8::HandleScope scope(isolate); | 609 v8::HandleScope scope(isolate); |
610 const char* extensions[] = { "v8/profiler" }; | 610 const char* extensions[] = { "v8/profiler" }; |
611 v8::ExtensionConfiguration config(1, extensions); | 611 v8::ExtensionConfiguration config(1, extensions); |
612 v8::Local<v8::Context> context = v8::Context::New(isolate, &config); | 612 v8::Local<v8::Context> context = v8::Context::New(isolate, &config); |
613 context->Enter(); | 613 context->Enter(); |
614 | 614 |
615 CpuProfiler* profiler = i::Isolate::Current()->cpu_profiler(); | 615 CpuProfiler* profiler = i::Isolate::Current()->cpu_profiler(); |
616 CHECK_EQ(0, profiler->GetProfilesCount()); | 616 CHECK_EQ(0, profiler->GetProfilesCount()); |
617 CompileRun( | 617 CompileRun( |
618 "function c() { startProfiling(); }\n" | 618 "function c() { startProfiling(); }\n" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 821 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
822 | 822 |
823 current = PickChild(current, "TryFinally"); | 823 current = PickChild(current, "TryFinally"); |
824 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 824 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
825 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); | 825 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); |
826 | 826 |
827 current = PickChild(current, "TryCatch"); | 827 current = PickChild(current, "TryCatch"); |
828 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); | 828 CHECK_NE(NULL, const_cast<v8::CpuProfileNode*>(current)); |
829 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); | 829 CHECK(!strcmp("TryCatchStatement", current->GetBailoutReason())); |
830 } | 830 } |
OLD | NEW |