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

Side by Side Diff: src/profiler/profile-generator.cc

Issue 1540953004: [runtime] Rewrite Function.prototype.toString in C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typos. Created 4 years, 12 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/profiler/profile-generator.h" 5 #include "src/profiler/profile-generator.h"
6 6
7 #include "src/ast/scopeinfo.h" 7 #include "src/ast/scopeinfo.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/global-handles.h" 10 #include "src/global-handles.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 if (pc_entry) { 612 if (pc_entry) {
613 int pc_offset = 613 int pc_offset =
614 static_cast<int>(sample.pc - pc_entry->instruction_start()); 614 static_cast<int>(sample.pc - pc_entry->instruction_start());
615 src_line = pc_entry->GetSourceLine(pc_offset); 615 src_line = pc_entry->GetSourceLine(pc_offset);
616 if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) { 616 if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) {
617 src_line = pc_entry->line_number(); 617 src_line = pc_entry->line_number();
618 } 618 }
619 src_line_not_found = false; 619 src_line_not_found = false;
620 *entry++ = pc_entry; 620 *entry++ = pc_entry;
621 621
622 if (pc_entry->builtin_id() == Builtins::kFunctionCall || 622 if (pc_entry->builtin_id() == Builtins::kFunctionPrototypeApply ||
623 pc_entry->builtin_id() == Builtins::kFunctionApply) { 623 pc_entry->builtin_id() == Builtins::kFunctionPrototypeCall) {
624 // When current function is FunctionCall or FunctionApply builtin the 624 // When current function is either the Function.prototype.apply or the
625 // top frame is either frame of the calling JS function or internal 625 // Function.prototype.call builtin the top frame is either frame of
626 // frame. In the latter case we know the caller for sure but in the 626 // the calling JS function or internal frame.
627 // In the latter case we know the caller for sure but in the
627 // former case we don't so we simply replace the frame with 628 // former case we don't so we simply replace the frame with
628 // 'unresolved' entry. 629 // 'unresolved' entry.
629 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) { 630 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) {
630 *entry++ = unresolved_entry_; 631 *entry++ = unresolved_entry_;
631 } 632 }
632 } 633 }
633 } 634 }
634 } 635 }
635 636
636 for (const Address* stack_pos = sample.stack, 637 for (const Address* stack_pos = sample.stack,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 case EXTERNAL: 687 case EXTERNAL:
687 return program_entry_; 688 return program_entry_;
688 case IDLE: 689 case IDLE:
689 return idle_entry_; 690 return idle_entry_;
690 default: return NULL; 691 default: return NULL;
691 } 692 }
692 } 693 }
693 694
694 } // namespace internal 695 } // namespace internal
695 } // namespace v8 696 } // namespace v8
OLDNEW
« src/debug/mirrors.js ('K') | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698