| OLD | NEW |
| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 | 348 |
| 349 if (FLAG_code_comments && instr->HasInterestingComment(this)) { | 349 if (FLAG_code_comments && instr->HasInterestingComment(this)) { |
| 350 Comment(";;; <@%d,#%d> %s", | 350 Comment(";;; <@%d,#%d> %s", |
| 351 current_instruction_, | 351 current_instruction_, |
| 352 instr->hydrogen_value()->id(), | 352 instr->hydrogen_value()->id(), |
| 353 instr->Mnemonic()); | 353 instr->Mnemonic()); |
| 354 } | 354 } |
| 355 | 355 |
| 356 if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr); | 356 if (!CpuFeatures::IsSupported(SSE2)) FlushX87StackIfNecessary(instr); |
| 357 | 357 |
| 358 RecordAndUpdatePosition(instr->position()); |
| 359 |
| 358 instr->CompileToNative(this); | 360 instr->CompileToNative(this); |
| 359 | 361 |
| 360 if (!CpuFeatures::IsSupported(SSE2)) { | 362 if (!CpuFeatures::IsSupported(SSE2)) { |
| 361 if (FLAG_debug_code && FLAG_enable_slow_asserts) { | 363 if (FLAG_debug_code && FLAG_enable_slow_asserts) { |
| 362 __ VerifyX87StackDepth(x87_stack_depth_); | 364 __ VerifyX87StackDepth(x87_stack_depth_); |
| 363 } | 365 } |
| 364 } | 366 } |
| 365 } | 367 } |
| 366 EnsureSpaceForLazyDeopt(); | 368 EnsureSpaceForLazyDeopt(); |
| 367 return !is_aborted(); | 369 return !is_aborted(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 417 } |
| 416 return !is_aborted(); | 418 return !is_aborted(); |
| 417 } | 419 } |
| 418 | 420 |
| 419 | 421 |
| 420 bool LCodeGen::GenerateDeferredCode() { | 422 bool LCodeGen::GenerateDeferredCode() { |
| 421 ASSERT(is_generating()); | 423 ASSERT(is_generating()); |
| 422 if (deferred_.length() > 0) { | 424 if (deferred_.length() > 0) { |
| 423 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 425 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| 424 LDeferredCode* code = deferred_[i]; | 426 LDeferredCode* code = deferred_[i]; |
| 427 |
| 428 int pos = instructions_->at(code->instruction_index())->position(); |
| 429 RecordAndUpdatePosition(pos); |
| 430 |
| 425 Comment(";;; <@%d,#%d> " | 431 Comment(";;; <@%d,#%d> " |
| 426 "-------------------- Deferred %s --------------------", | 432 "-------------------- Deferred %s --------------------", |
| 427 code->instruction_index(), | 433 code->instruction_index(), |
| 428 code->instr()->hydrogen_value()->id(), | 434 code->instr()->hydrogen_value()->id(), |
| 429 code->instr()->Mnemonic()); | 435 code->instr()->Mnemonic()); |
| 430 __ bind(code->entry()); | 436 __ bind(code->entry()); |
| 431 if (NeedsDeferredFrame()) { | 437 if (NeedsDeferredFrame()) { |
| 432 Comment(";;; Build frame"); | 438 Comment(";;; Build frame"); |
| 433 ASSERT(!frame_is_built_); | 439 ASSERT(!frame_is_built_); |
| 434 ASSERT(info()->IsStub()); | 440 ASSERT(info()->IsStub()); |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments, mode); | 1167 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments, mode); |
| 1162 } | 1168 } |
| 1163 | 1169 |
| 1164 | 1170 |
| 1165 void LCodeGen::RecordPosition(int position) { | 1171 void LCodeGen::RecordPosition(int position) { |
| 1166 if (position == RelocInfo::kNoPosition) return; | 1172 if (position == RelocInfo::kNoPosition) return; |
| 1167 masm()->positions_recorder()->RecordPosition(position); | 1173 masm()->positions_recorder()->RecordPosition(position); |
| 1168 } | 1174 } |
| 1169 | 1175 |
| 1170 | 1176 |
| 1177 void LCodeGen::RecordAndUpdatePosition(int position) { |
| 1178 if (position >= 0 && position != old_position_) { |
| 1179 masm()->positions_recorder()->RecordPosition(position); |
| 1180 old_position_ = position; |
| 1181 } |
| 1182 } |
| 1183 |
| 1184 |
| 1171 static const char* LabelType(LLabel* label) { | 1185 static const char* LabelType(LLabel* label) { |
| 1172 if (label->is_loop_header()) return " (loop header)"; | 1186 if (label->is_loop_header()) return " (loop header)"; |
| 1173 if (label->is_osr_entry()) return " (OSR entry)"; | 1187 if (label->is_osr_entry()) return " (OSR entry)"; |
| 1174 return ""; | 1188 return ""; |
| 1175 } | 1189 } |
| 1176 | 1190 |
| 1177 | 1191 |
| 1178 void LCodeGen::DoLabel(LLabel* label) { | 1192 void LCodeGen::DoLabel(LLabel* label) { |
| 1179 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------", | 1193 Comment(";;; <@%d,#%d> -------------------- B%d%s --------------------", |
| 1180 current_instruction_, | 1194 current_instruction_, |
| (...skipping 5351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6532 FixedArray::kHeaderSize - kPointerSize)); | 6546 FixedArray::kHeaderSize - kPointerSize)); |
| 6533 __ bind(&done); | 6547 __ bind(&done); |
| 6534 } | 6548 } |
| 6535 | 6549 |
| 6536 | 6550 |
| 6537 #undef __ | 6551 #undef __ |
| 6538 | 6552 |
| 6539 } } // namespace v8::internal | 6553 } } // namespace v8::internal |
| 6540 | 6554 |
| 6541 #endif // V8_TARGET_ARCH_IA32 | 6555 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |