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

Side by Side Diff: src/cpu-profiler.cc

Issue 701093003: Correctly compute line numbers in functions from the function constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/generator.js » ('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 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/cpu-profiler-inl.h" 7 #include "src/cpu-profiler-inl.h"
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 Script* script = Script::cast(shared->script()); 265 Script* script = Script::cast(shared->script());
266 JITLineInfoTable* line_table = NULL; 266 JITLineInfoTable* line_table = NULL;
267 if (script) { 267 if (script) {
268 line_table = new JITLineInfoTable(); 268 line_table = new JITLineInfoTable();
269 for (RelocIterator it(code); !it.done(); it.next()) { 269 for (RelocIterator it(code); !it.done(); it.next()) {
270 RelocInfo::Mode mode = it.rinfo()->rmode(); 270 RelocInfo::Mode mode = it.rinfo()->rmode();
271 if (RelocInfo::IsPosition(mode)) { 271 if (RelocInfo::IsPosition(mode)) {
272 int position = static_cast<int>(it.rinfo()->data()); 272 int position = static_cast<int>(it.rinfo()->data());
273 if (position >= 0) { 273 if (position >= 0) {
274 int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address()); 274 int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address());
275 int line_number = script->GetLineNumber(position) + 1; 275 int line_number = script->GetLineNumber(position);
276 line_table->SetPosition(pc_offset, line_number); 276 line_table->SetPosition(pc_offset, line_number + 1);
277 } 277 }
278 } 278 }
279 } 279 }
280 } 280 }
281 rec->entry = profiles_->NewCodeEntry( 281 rec->entry = profiles_->NewCodeEntry(
282 tag, profiles_->GetFunctionName(shared->DebugName()), 282 tag, profiles_->GetFunctionName(shared->DebugName()),
283 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, 283 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line,
284 column, line_table, code->instruction_start()); 284 column, line_table, code->instruction_start());
285 if (info) { 285 if (info) {
286 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); 286 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; 519 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_;
520 Builtins::Name id = static_cast<Builtins::Name>(i); 520 Builtins::Name id = static_cast<Builtins::Name>(i);
521 rec->start = builtins->builtin(id)->address(); 521 rec->start = builtins->builtin(id)->address();
522 rec->builtin_id = id; 522 rec->builtin_id = id;
523 processor_->Enqueue(evt_rec); 523 processor_->Enqueue(evt_rec);
524 } 524 }
525 } 525 }
526 526
527 527
528 } } // namespace v8::internal 528 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698