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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |