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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 21042003: Patch to enhance the source code line information for profiler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 4 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 | « src/arm/lithium-codegen-arm.h ('k') | src/ia32/lithium-codegen-ia32.h » ('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 // 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 if (!emit_instructions) continue; 268 if (!emit_instructions) continue;
269 269
270 if (FLAG_code_comments && instr->HasInterestingComment(this)) { 270 if (FLAG_code_comments && instr->HasInterestingComment(this)) {
271 Comment(";;; <@%d,#%d> %s", 271 Comment(";;; <@%d,#%d> %s",
272 current_instruction_, 272 current_instruction_,
273 instr->hydrogen_value()->id(), 273 instr->hydrogen_value()->id(),
274 instr->Mnemonic()); 274 instr->Mnemonic());
275 } 275 }
276 276
277 RecordAndUpdatePosition(instr->position());
278
277 instr->CompileToNative(this); 279 instr->CompileToNative(this);
278 } 280 }
279 EnsureSpaceForLazyDeopt(); 281 EnsureSpaceForLazyDeopt();
280 last_lazy_deopt_pc_ = masm()->pc_offset(); 282 last_lazy_deopt_pc_ = masm()->pc_offset();
281 return !is_aborted(); 283 return !is_aborted();
282 } 284 }
283 285
284 286
285 bool LCodeGen::GenerateDeferredCode() { 287 bool LCodeGen::GenerateDeferredCode() {
286 ASSERT(is_generating()); 288 ASSERT(is_generating());
287 if (deferred_.length() > 0) { 289 if (deferred_.length() > 0) {
288 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { 290 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
289 LDeferredCode* code = deferred_[i]; 291 LDeferredCode* code = deferred_[i];
292
293 int pos = instructions_->at(code->instruction_index())->position();
294 RecordAndUpdatePosition(pos);
295
290 Comment(";;; <@%d,#%d> " 296 Comment(";;; <@%d,#%d> "
291 "-------------------- Deferred %s --------------------", 297 "-------------------- Deferred %s --------------------",
292 code->instruction_index(), 298 code->instruction_index(),
293 code->instr()->hydrogen_value()->id(), 299 code->instr()->hydrogen_value()->id(),
294 code->instr()->Mnemonic()); 300 code->instr()->Mnemonic());
295 __ bind(code->entry()); 301 __ bind(code->entry());
296 if (NeedsDeferredFrame()) { 302 if (NeedsDeferredFrame()) {
297 Comment(";;; Build frame"); 303 Comment(";;; Build frame");
298 ASSERT(!frame_is_built_); 304 ASSERT(!frame_is_built_);
299 ASSERT(info()->IsStub()); 305 ASSERT(info()->IsStub());
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode); 976 pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode);
971 } 977 }
972 978
973 979
974 void LCodeGen::RecordPosition(int position) { 980 void LCodeGen::RecordPosition(int position) {
975 if (position == RelocInfo::kNoPosition) return; 981 if (position == RelocInfo::kNoPosition) return;
976 masm()->positions_recorder()->RecordPosition(position); 982 masm()->positions_recorder()->RecordPosition(position);
977 } 983 }
978 984
979 985
986 void LCodeGen::RecordAndUpdatePosition(int position) {
987 if (position >= 0 && position != old_position_) {
988 masm()->positions_recorder()->RecordPosition(position);
989 old_position_ = position;
990 }
991 }
992
993
980 static const char* LabelType(LLabel* label) { 994 static const char* LabelType(LLabel* label) {
981 if (label->is_loop_header()) return " (loop header)"; 995 if (label->is_loop_header()) return " (loop header)";
982 if (label->is_osr_entry()) return " (OSR entry)"; 996 if (label->is_osr_entry()) return " (OSR entry)";
983 return ""; 997 return "";
984 } 998 }
985 999
986 1000
987 void LCodeGen::DoLabel(LLabel* label) { 1001 void LCodeGen::DoLabel(LLabel* label) {
988 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------", 1002 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------",
989 current_instruction_, 1003 current_instruction_,
(...skipping 4849 matching lines...) Expand 10 before | Expand all | Expand 10 after
5839 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); 5853 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index));
5840 __ ldr(result, FieldMemOperand(scratch, 5854 __ ldr(result, FieldMemOperand(scratch,
5841 FixedArray::kHeaderSize - kPointerSize)); 5855 FixedArray::kHeaderSize - kPointerSize));
5842 __ bind(&done); 5856 __ bind(&done);
5843 } 5857 }
5844 5858
5845 5859
5846 #undef __ 5860 #undef __
5847 5861
5848 } } // namespace v8::internal 5862 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.h ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698