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

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

Issue 1053563002: Revert of Correctly compute line numbers in functions from the function constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added regression test Created 5 years, 8 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 | 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/deoptimizer.h" 10 #include "src/deoptimizer.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 Script* script = Script::cast(shared->script()); 270 Script* script = Script::cast(shared->script());
271 JITLineInfoTable* line_table = NULL; 271 JITLineInfoTable* line_table = NULL;
272 if (script) { 272 if (script) {
273 line_table = new JITLineInfoTable(); 273 line_table = new JITLineInfoTable();
274 for (RelocIterator it(code); !it.done(); it.next()) { 274 for (RelocIterator it(code); !it.done(); it.next()) {
275 RelocInfo::Mode mode = it.rinfo()->rmode(); 275 RelocInfo::Mode mode = it.rinfo()->rmode();
276 if (RelocInfo::IsPosition(mode)) { 276 if (RelocInfo::IsPosition(mode)) {
277 int position = static_cast<int>(it.rinfo()->data()); 277 int position = static_cast<int>(it.rinfo()->data());
278 if (position >= 0) { 278 if (position >= 0) {
279 int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address()); 279 int pc_offset = static_cast<int>(it.rinfo()->pc() - code->address());
280 int line_number = script->GetLineNumber(position); 280 int line_number = script->GetLineNumber(position) + 1;
281 line_table->SetPosition(pc_offset, line_number + 1); 281 line_table->SetPosition(pc_offset, line_number);
282 } 282 }
283 } 283 }
284 } 284 }
285 } 285 }
286 rec->entry = profiles_->NewCodeEntry( 286 rec->entry = profiles_->NewCodeEntry(
287 tag, profiles_->GetFunctionName(shared->DebugName()), 287 tag, profiles_->GetFunctionName(shared->DebugName()),
288 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line, 288 CodeEntry::kEmptyNamePrefix, profiles_->GetName(script_name), line,
289 column, line_table, code->instruction_start()); 289 column, line_table, code->instruction_start());
290 if (info) { 290 if (info) {
291 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges()); 291 rec->entry->set_no_frame_ranges(info->ReleaseNoFrameRanges());
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_; 522 ReportBuiltinEventRecord* rec = &evt_rec.ReportBuiltinEventRecord_;
523 Builtins::Name id = static_cast<Builtins::Name>(i); 523 Builtins::Name id = static_cast<Builtins::Name>(i);
524 rec->start = builtins->builtin(id)->address(); 524 rec->start = builtins->builtin(id)->address();
525 rec->builtin_id = id; 525 rec->builtin_id = id;
526 processor_->Enqueue(evt_rec); 526 processor_->Enqueue(evt_rec);
527 } 527 }
528 } 528 }
529 529
530 530
531 } } // namespace v8::internal 531 } } // 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