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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 ? GetStackSlotCount() : arguments_index + arguments_count; | 638 ? GetStackSlotCount() : arguments_index + arguments_count; |
639 arguments_count = environment->entry()->arguments_count() + 1; | 639 arguments_count = environment->entry()->arguments_count() + 1; |
640 if (environment->entry()->arguments_pushed()) { | 640 if (environment->entry()->arguments_pushed()) { |
641 *pushed_arguments_index = arguments_index; | 641 *pushed_arguments_index = arguments_index; |
642 *pushed_arguments_count = arguments_count; | 642 *pushed_arguments_count = arguments_count; |
643 } | 643 } |
644 } | 644 } |
645 | 645 |
646 for (int i = 0; i < translation_size; ++i) { | 646 for (int i = 0; i < translation_size; ++i) { |
647 LOperand* value = environment->values()->at(i); | 647 LOperand* value = environment->values()->at(i); |
648 // spilled_registers_ and spilled_double_registers_ are either | |
649 // both NULL or both set. | |
650 if (environment->spilled_registers() != NULL && value != NULL) { | |
651 if (value->IsRegister() && | |
652 environment->spilled_registers()[value->index()] != NULL) { | |
653 translation->MarkDuplicate(); | |
654 AddToTranslation(translation, | |
655 environment->spilled_registers()[value->index()], | |
656 environment->HasTaggedValueAt(i), | |
657 environment->HasUint32ValueAt(i), | |
658 arguments_known, | |
659 arguments_index, | |
660 arguments_count); | |
661 } else if ( | |
662 value->IsDoubleRegister() && | |
663 environment->spilled_double_registers()[value->index()] != NULL) { | |
664 translation->MarkDuplicate(); | |
665 AddToTranslation( | |
666 translation, | |
667 environment->spilled_double_registers()[value->index()], | |
668 false, | |
669 false, | |
670 arguments_known, | |
671 arguments_index, | |
672 arguments_count); | |
673 } | |
674 } | |
675 | 648 |
676 AddToTranslation(translation, | 649 AddToTranslation(translation, |
677 value, | 650 value, |
678 environment->HasTaggedValueAt(i), | 651 environment->HasTaggedValueAt(i), |
679 environment->HasUint32ValueAt(i), | 652 environment->HasUint32ValueAt(i), |
680 arguments_known, | 653 arguments_known, |
681 arguments_index, | 654 arguments_index, |
682 arguments_count); | 655 arguments_count); |
683 } | 656 } |
684 } | 657 } |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1106 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
1134 break; | 1107 break; |
1135 } | 1108 } |
1136 default: | 1109 default: |
1137 UNREACHABLE(); | 1110 UNREACHABLE(); |
1138 } | 1111 } |
1139 } | 1112 } |
1140 | 1113 |
1141 | 1114 |
1142 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 1115 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
1143 // Nothing to do. | 1116 // Record the address of the first unknown OSR value as the place to enter. |
| 1117 if (osr_pc_offset_ == -1) osr_pc_offset_ = masm()->pc_offset(); |
1144 } | 1118 } |
1145 | 1119 |
1146 | 1120 |
1147 void LCodeGen::DoModI(LModI* instr) { | 1121 void LCodeGen::DoModI(LModI* instr) { |
1148 HMod* hmod = instr->hydrogen(); | 1122 HMod* hmod = instr->hydrogen(); |
1149 HValue* left = hmod->left(); | 1123 HValue* left = hmod->left(); |
1150 HValue* right = hmod->right(); | 1124 HValue* right = hmod->right(); |
1151 if (hmod->HasPowerOf2Divisor()) { | 1125 if (hmod->HasPowerOf2Divisor()) { |
1152 const Register scratch = scratch0(); | 1126 const Register scratch = scratch0(); |
1153 const Register left_reg = ToRegister(instr->left()); | 1127 const Register left_reg = ToRegister(instr->left()); |
(...skipping 4450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5604 // the deferred code. | 5578 // the deferred code. |
5605 } | 5579 } |
5606 } | 5580 } |
5607 | 5581 |
5608 | 5582 |
5609 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 5583 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
5610 // This is a pseudo-instruction that ensures that the environment here is | 5584 // This is a pseudo-instruction that ensures that the environment here is |
5611 // properly registered for deoptimization and records the assembler's PC | 5585 // properly registered for deoptimization and records the assembler's PC |
5612 // offset. | 5586 // offset. |
5613 LEnvironment* environment = instr->environment(); | 5587 LEnvironment* environment = instr->environment(); |
5614 environment->SetSpilledRegisters(instr->SpilledRegisterArray(), | |
5615 instr->SpilledDoubleRegisterArray()); | |
5616 | 5588 |
5617 // If the environment were already registered, we would have no way of | 5589 // If the environment were already registered, we would have no way of |
5618 // backpatching it with the spill slot operands. | 5590 // backpatching it with the spill slot operands. |
5619 ASSERT(!environment->HasBeenRegistered()); | 5591 ASSERT(!environment->HasBeenRegistered()); |
5620 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); | 5592 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); |
5621 ASSERT(osr_pc_offset_ == -1); | 5593 |
5622 osr_pc_offset_ = masm()->pc_offset(); | 5594 // Normally we record the first unknown OSR value as the entrypoint to the OSR |
| 5595 // code, but if there were none, record the entrypoint here. |
| 5596 if (osr_pc_offset_ == -1) osr_pc_offset_ = masm()->pc_offset(); |
5623 } | 5597 } |
5624 | 5598 |
5625 | 5599 |
5626 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { | 5600 void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { |
5627 Register result = ToRegister(instr->result()); | 5601 Register result = ToRegister(instr->result()); |
5628 Register object = ToRegister(instr->object()); | 5602 Register object = ToRegister(instr->object()); |
5629 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 5603 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
5630 DeoptimizeIf(eq, instr->environment(), object, Operand(at)); | 5604 DeoptimizeIf(eq, instr->environment(), object, Operand(at)); |
5631 | 5605 |
5632 Register null_value = t1; | 5606 Register null_value = t1; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5711 __ Subu(scratch, result, scratch); | 5685 __ Subu(scratch, result, scratch); |
5712 __ lw(result, FieldMemOperand(scratch, | 5686 __ lw(result, FieldMemOperand(scratch, |
5713 FixedArray::kHeaderSize - kPointerSize)); | 5687 FixedArray::kHeaderSize - kPointerSize)); |
5714 __ bind(&done); | 5688 __ bind(&done); |
5715 } | 5689 } |
5716 | 5690 |
5717 | 5691 |
5718 #undef __ | 5692 #undef __ |
5719 | 5693 |
5720 } } // namespace v8::internal | 5694 } } // namespace v8::internal |
OLD | NEW |