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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // building, install a special marker there instead. | 322 // building, install a special marker there instead. |
323 ASSERT(info()->IsStub()); | 323 ASSERT(info()->IsStub()); |
324 __ Move(rsi, Smi::FromInt(StackFrame::STUB)); | 324 __ Move(rsi, Smi::FromInt(StackFrame::STUB)); |
325 __ push(rsi); | 325 __ push(rsi); |
326 __ movq(rsi, MemOperand(rsp, kPointerSize)); | 326 __ movq(rsi, MemOperand(rsp, kPointerSize)); |
327 __ jmp(kScratchRegister); | 327 __ jmp(kScratchRegister); |
328 } | 328 } |
329 } | 329 } |
330 } else { | 330 } else { |
331 if (is_lazy_deopt) { | 331 if (is_lazy_deopt) { |
332 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 332 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
333 } else { | 333 } else { |
334 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 334 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
335 } | 335 } |
336 } | 336 } |
337 } | 337 } |
338 return !is_aborted(); | 338 return !is_aborted(); |
339 } | 339 } |
340 | 340 |
341 | 341 |
342 bool LCodeGen::GenerateDeferredCode() { | 342 bool LCodeGen::GenerateDeferredCode() { |
343 ASSERT(is_generating()); | 343 ASSERT(is_generating()); |
344 if (deferred_.length() > 0) { | 344 if (deferred_.length() > 0) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type); | 707 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type); |
708 if (entry == NULL) { | 708 if (entry == NULL) { |
709 Abort("bailout was not prepared"); | 709 Abort("bailout was not prepared"); |
710 return; | 710 return; |
711 } | 711 } |
712 | 712 |
713 ASSERT(info()->IsStub() || frame_is_built_); | 713 ASSERT(info()->IsStub() || frame_is_built_); |
714 bool lazy_deopt = info()->IsStub(); | 714 bool lazy_deopt = info()->IsStub(); |
715 if (cc == no_condition) { | 715 if (cc == no_condition) { |
716 if (lazy_deopt) { | 716 if (lazy_deopt) { |
717 __ Call(entry, RelocInfo::RUNTIME_ENTRY); | 717 __ call(entry, RelocInfo::RUNTIME_ENTRY); |
718 } else { | 718 } else { |
719 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 719 __ jmp(entry, RelocInfo::RUNTIME_ENTRY); |
720 } | 720 } |
721 } else { | 721 } else { |
722 // We often have several deopts to the same entry, reuse the last | 722 if (!lazy_deopt && frame_is_built_) { |
723 // jump entry if this is the case. | 723 __ j(cc, entry, RelocInfo::RUNTIME_ENTRY); |
724 if (jump_table_.is_empty() || | 724 } else { |
725 jump_table_.last().address != entry || | 725 // We often have several deopts to the same entry, reuse the last |
726 jump_table_.last().needs_frame != !frame_is_built_ || | 726 // jump entry if this is the case. |
727 jump_table_.last().is_lazy_deopt != lazy_deopt) { | 727 if (jump_table_.is_empty() || |
728 JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt); | 728 jump_table_.last().address != entry || |
729 jump_table_.Add(table_entry, zone()); | 729 jump_table_.last().needs_frame != !frame_is_built_ || |
| 730 jump_table_.last().is_lazy_deopt != lazy_deopt) { |
| 731 JumpTableEntry table_entry(entry, !frame_is_built_, lazy_deopt); |
| 732 jump_table_.Add(table_entry, zone()); |
| 733 } |
| 734 __ j(cc, &jump_table_.last().label); |
730 } | 735 } |
731 __ j(cc, &jump_table_.last().label); | |
732 } | 736 } |
733 } | 737 } |
734 | 738 |
735 | 739 |
736 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 740 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
737 int length = deoptimizations_.length(); | 741 int length = deoptimizations_.length(); |
738 if (length == 0) return; | 742 if (length == 0) return; |
739 Handle<DeoptimizationInputData> data = | 743 Handle<DeoptimizationInputData> data = |
740 factory()->NewDeoptimizationInputData(length, TENURED); | 744 factory()->NewDeoptimizationInputData(length, TENURED); |
741 | 745 |
(...skipping 4832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5574 FixedArray::kHeaderSize - kPointerSize)); | 5578 FixedArray::kHeaderSize - kPointerSize)); |
5575 __ bind(&done); | 5579 __ bind(&done); |
5576 } | 5580 } |
5577 | 5581 |
5578 | 5582 |
5579 #undef __ | 5583 #undef __ |
5580 | 5584 |
5581 } } // namespace v8::internal | 5585 } } // namespace v8::internal |
5582 | 5586 |
5583 #endif // V8_TARGET_ARCH_X64 | 5587 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |