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

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

Issue 1423723002: Map v8::Function to JSReceiver + IsCallable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 1 month 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-heap.cc ('k') | test/cctest/test-serialize.cc » ('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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 "// Empty first line\n" 631 "// Empty first line\n"
632 "function bar_at_the_second_line() {\n" 632 "function bar_at_the_second_line() {\n"
633 " foo_at_the_first_line();\n" 633 " foo_at_the_first_line();\n"
634 "}\n" 634 "}\n"
635 "bar_at_the_second_line();\n" 635 "bar_at_the_second_line();\n"
636 "function lazy_func_at_6th_line() {}"; 636 "function lazy_func_at_6th_line() {}";
637 637
638 int GetFunctionLineNumber(LocalContext* env, const char* name) { 638 int GetFunctionLineNumber(LocalContext* env, const char* name) {
639 CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler(); 639 CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler();
640 CodeMap* code_map = profiler->generator()->code_map(); 640 CodeMap* code_map = profiler->generator()->code_map();
641 i::Handle<i::JSFunction> func = 641 i::Handle<i::JSFunction> func = i::Handle<i::JSFunction>::cast(
642 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast( 642 v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
643 (*(*env)) 643 (*(*env))
644 ->Global() 644 ->Global()
645 ->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), 645 ->Get(v8::Isolate::GetCurrent()->GetCurrentContext(),
646 v8_str(name)) 646 v8_str(name))
647 .ToLocalChecked())); 647 .ToLocalChecked())));
648 CodeEntry* func_entry = code_map->FindEntry(func->code()->address()); 648 CodeEntry* func_entry = code_map->FindEntry(func->code()->address());
649 if (!func_entry) 649 if (!func_entry)
650 FATAL(name); 650 FATAL(name);
651 return func_entry->line_number(); 651 return func_entry->line_number();
652 } 652 }
653 653
654 654
655 TEST(LineNumber) { 655 TEST(LineNumber) {
656 i::FLAG_use_inlining = false; 656 i::FLAG_use_inlining = false;
657 657
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 CHECK(const_cast<v8::CpuProfileNode*>(current)); 717 CHECK(const_cast<v8::CpuProfileNode*>(current));
718 718
719 current = PickChild(current, "TryFinally"); 719 current = PickChild(current, "TryFinally");
720 CHECK(const_cast<v8::CpuProfileNode*>(current)); 720 CHECK(const_cast<v8::CpuProfileNode*>(current));
721 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason())); 721 CHECK(!strcmp("TryFinallyStatement", current->GetBailoutReason()));
722 722
723 current = PickChild(current, "Debugger"); 723 current = PickChild(current, "Debugger");
724 CHECK(const_cast<v8::CpuProfileNode*>(current)); 724 CHECK(const_cast<v8::CpuProfileNode*>(current));
725 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason())); 725 CHECK(!strcmp("DebuggerStatement", current->GetBailoutReason()));
726 } 726 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698