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

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

Issue 22502006: MIPS: Patch to enhance the source code line information for profiler. (Closed) Base URL: https://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/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-mips.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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 261 }
262 if (!emit_instructions) continue; 262 if (!emit_instructions) continue;
263 263
264 if (FLAG_code_comments && instr->HasInterestingComment(this)) { 264 if (FLAG_code_comments && instr->HasInterestingComment(this)) {
265 Comment(";;; <@%d,#%d> %s", 265 Comment(";;; <@%d,#%d> %s",
266 current_instruction_, 266 current_instruction_,
267 instr->hydrogen_value()->id(), 267 instr->hydrogen_value()->id(),
268 instr->Mnemonic()); 268 instr->Mnemonic());
269 } 269 }
270 270
271 RecordAndUpdatePosition(instr->position());
272
271 instr->CompileToNative(this); 273 instr->CompileToNative(this);
272 } 274 }
273 EnsureSpaceForLazyDeopt(); 275 EnsureSpaceForLazyDeopt();
274 last_lazy_deopt_pc_ = masm()->pc_offset(); 276 last_lazy_deopt_pc_ = masm()->pc_offset();
275 return !is_aborted(); 277 return !is_aborted();
276 } 278 }
277 279
278 280
279 bool LCodeGen::GenerateDeferredCode() { 281 bool LCodeGen::GenerateDeferredCode() {
280 ASSERT(is_generating()); 282 ASSERT(is_generating());
281 if (deferred_.length() > 0) { 283 if (deferred_.length() > 0) {
282 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { 284 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) {
283 LDeferredCode* code = deferred_[i]; 285 LDeferredCode* code = deferred_[i];
286
287 int pos = instructions_->at(code->instruction_index())->position();
288 RecordAndUpdatePosition(pos);
289
284 Comment(";;; <@%d,#%d> " 290 Comment(";;; <@%d,#%d> "
285 "-------------------- Deferred %s --------------------", 291 "-------------------- Deferred %s --------------------",
286 code->instruction_index(), 292 code->instruction_index(),
287 code->instr()->hydrogen_value()->id(), 293 code->instr()->hydrogen_value()->id(),
288 code->instr()->Mnemonic()); 294 code->instr()->Mnemonic());
289 __ bind(code->entry()); 295 __ bind(code->entry());
290 if (NeedsDeferredFrame()) { 296 if (NeedsDeferredFrame()) {
291 Comment(";;; Build frame"); 297 Comment(";;; Build frame");
292 ASSERT(!frame_is_built_); 298 ASSERT(!frame_is_built_);
293 ASSERT(info()->IsStub()); 299 ASSERT(info()->IsStub());
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode); 979 pointers, Safepoint::kWithRegistersAndDoubles, arguments, deopt_mode);
974 } 980 }
975 981
976 982
977 void LCodeGen::RecordPosition(int position) { 983 void LCodeGen::RecordPosition(int position) {
978 if (position == RelocInfo::kNoPosition) return; 984 if (position == RelocInfo::kNoPosition) return;
979 masm()->positions_recorder()->RecordPosition(position); 985 masm()->positions_recorder()->RecordPosition(position);
980 } 986 }
981 987
982 988
989 void LCodeGen::RecordAndUpdatePosition(int position) {
990 if (position >= 0 && position != old_position_) {
991 masm()->positions_recorder()->RecordPosition(position);
992 old_position_ = position;
993 }
994 }
995
996
983 static const char* LabelType(LLabel* label) { 997 static const char* LabelType(LLabel* label) {
984 if (label->is_loop_header()) return " (loop header)"; 998 if (label->is_loop_header()) return " (loop header)";
985 if (label->is_osr_entry()) return " (OSR entry)"; 999 if (label->is_osr_entry()) return " (OSR entry)";
986 return ""; 1000 return "";
987 } 1001 }
988 1002
989 1003
990 void LCodeGen::DoLabel(LLabel* label) { 1004 void LCodeGen::DoLabel(LLabel* label) {
991 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------", 1005 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------",
992 current_instruction_, 1006 current_instruction_,
(...skipping 4872 matching lines...) Expand 10 before | Expand all | Expand 10 after
5865 __ Subu(scratch, result, scratch); 5879 __ Subu(scratch, result, scratch);
5866 __ lw(result, FieldMemOperand(scratch, 5880 __ lw(result, FieldMemOperand(scratch,
5867 FixedArray::kHeaderSize - kPointerSize)); 5881 FixedArray::kHeaderSize - kPointerSize));
5868 __ bind(&done); 5882 __ bind(&done);
5869 } 5883 }
5870 5884
5871 5885
5872 #undef __ 5886 #undef __
5873 5887
5874 } } // namespace v8::internal 5888 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.h ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698