Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: test/cctest/test-profile-generator.cc

Issue 1728593002: [Interpreter] Add support for cpu profiler logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-log-stack-tracer.cc ('k') | tools/ll_prof.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 int GetFunctionLineNumber(LocalContext* env, const char* name) { 642 int GetFunctionLineNumber(LocalContext* env, const char* name) {
643 CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler(); 643 CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler();
644 CodeMap* code_map = profiler->generator()->code_map(); 644 CodeMap* code_map = profiler->generator()->code_map();
645 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast( 645 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(
646 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast( 646 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
647 (*(*env)) 647 (*(*env))
648 ->Global() 648 ->Global()
649 ->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), 649 ->Get(v8::Isolate::GetCurrent()->GetCurrentContext(),
650 v8_str(name)) 650 v8_str(name))
651 .ToLocalChecked()))); 651 .ToLocalChecked())));
652 CodeEntry* func_entry = code_map->FindEntry(func->code()->address()); 652 CodeEntry* func_entry = code_map->FindEntry(func->abstract_code()->address());
653 if (!func_entry) 653 if (!func_entry)
654 FATAL(name); 654 FATAL(name);
655 return func_entry->line_number(); 655 return func_entry->line_number();
656 } 656 }
657 657
658 658
659 TEST(LineNumber) { 659 TEST(LineNumber) {
660 i::FLAG_use_inlining = false; 660 i::FLAG_use_inlining = false;
661 661
662 CcTest::InitializeVM(); 662 CcTest::InitializeVM();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 CHECK(const_cast<v8::CpuProfileNode*>(current)); 721 CHECK(const_cast<v8::CpuProfileNode*>(current));
722 722
723 current = PickChild(current, "TryFinally"); 723 current = PickChild(current, "TryFinally");
724 CHECK(const_cast<v8::CpuProfileNode*>(current)); 724 CHECK(const_cast<v8::CpuProfileNode*>(current));
725 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); 725 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason()));
726 726
727 current = PickChild(current, "Debugger"); 727 current = PickChild(current, "Debugger");
728 CHECK(const_cast<v8::CpuProfileNode*>(current)); 728 CHECK(const_cast<v8::CpuProfileNode*>(current));
729 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); 729 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason()));
730 } 730 }
OLDNEW
« no previous file with comments | « test/cctest/test-log-stack-tracer.cc ('k') | tools/ll_prof.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698