| 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 | 665 |
| 666 CompileRun(line_number_test_source_existing_functions); | 666 CompileRun(line_number_test_source_existing_functions); |
| 667 | 667 |
| 668 CpuProfiler* profiler = isolate->cpu_profiler(); | 668 CpuProfiler* profiler = isolate->cpu_profiler(); |
| 669 profiler->StartProfiling("LineNumber"); | 669 profiler->StartProfiling("LineNumber"); |
| 670 | 670 |
| 671 CompileRun(line_number_test_source_profile_time_functions); | 671 CompileRun(line_number_test_source_profile_time_functions); |
| 672 | 672 |
| 673 profiler->processor()->StopSynchronously(); | 673 profiler->processor()->StopSynchronously(); |
| 674 | 674 |
| 675 bool is_lazy = i::FLAG_lazy && !(i::FLAG_ignition && i::FLAG_ignition_eager); |
| 675 CHECK_EQ(1, GetFunctionLineNumber(&env, "foo_at_the_first_line")); | 676 CHECK_EQ(1, GetFunctionLineNumber(&env, "foo_at_the_first_line")); |
| 676 CHECK_EQ(0, GetFunctionLineNumber(&env, "lazy_func_at_forth_line")); | 677 CHECK_EQ(is_lazy ? 0 : 4, |
| 678 GetFunctionLineNumber(&env, "lazy_func_at_forth_line")); |
| 677 CHECK_EQ(2, GetFunctionLineNumber(&env, "bar_at_the_second_line")); | 679 CHECK_EQ(2, GetFunctionLineNumber(&env, "bar_at_the_second_line")); |
| 678 CHECK_EQ(0, GetFunctionLineNumber(&env, "lazy_func_at_6th_line")); | 680 CHECK_EQ(is_lazy ? 0 : 6, |
| 681 GetFunctionLineNumber(&env, "lazy_func_at_6th_line")); |
| 679 | 682 |
| 680 profiler->StopProfiling("LineNumber"); | 683 profiler->StopProfiling("LineNumber"); |
| 681 } | 684 } |
| 682 | 685 |
| 683 | 686 |
| 684 | 687 |
| 685 TEST(BailoutReason) { | 688 TEST(BailoutReason) { |
| 686 v8::HandleScope scope(CcTest::isolate()); | 689 v8::HandleScope scope(CcTest::isolate()); |
| 687 v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION); | 690 v8::Local<v8::Context> env = CcTest::NewContext(PROFILER_EXTENSION); |
| 688 v8::Context::Scope context_scope(env); | 691 v8::Context::Scope context_scope(env); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 718 CHECK(const_cast<v8::CpuProfileNode*>(current)); | 721 CHECK(const_cast<v8::CpuProfileNode*>(current)); |
| 719 | 722 |
| 720 current = PickChild(current, "TryFinally"); | 723 current = PickChild(current, "TryFinally"); |
| 721 CHECK(const_cast<v8::CpuProfileNode*>(current)); | 724 CHECK(const_cast<v8::CpuProfileNode*>(current)); |
| 722 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); | 725 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); |
| 723 | 726 |
| 724 current = PickChild(current, "Debugger"); | 727 current = PickChild(current, "Debugger"); |
| 725 CHECK(const_cast<v8::CpuProfileNode*>(current)); | 728 CHECK(const_cast<v8::CpuProfileNode*>(current)); |
| 726 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); | 729 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); |
| 727 } | 730 } |
| OLD | NEW |