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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
751 case ARGUMENTS_ADAPTOR: | 751 case ARGUMENTS_ADAPTOR: |
752 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); | 752 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
753 break; | 753 break; |
754 case STUB: | 754 case STUB: |
755 translation->BeginCompiledStubFrame(); | 755 translation->BeginCompiledStubFrame(); |
756 break; | 756 break; |
757 default: | 757 default: |
758 UNREACHABLE(); | 758 UNREACHABLE(); |
759 } | 759 } |
760 | 760 |
761 int object_index = 0; | |
762 int dematerialized_index = 0; | |
761 for (int i = 0; i < translation_size; ++i) { | 763 for (int i = 0; i < translation_size; ++i) { |
762 LOperand* value = environment->values()->at(i); | 764 LOperand* value = environment->values()->at(i); |
763 | 765 AddToTranslation(environment, |
764 // TODO(mstarzinger): Introduce marker operands to indicate that this value | 766 translation, |
765 // is not present and must be reconstructed from the deoptimizer. Currently | |
766 // this is only used for the arguments object. | |
767 if (value == NULL) { | |
768 int arguments_count = environment->values()->length() - translation_size; | |
769 translation->BeginArgumentsObject(arguments_count); | |
770 for (int i = 0; i < arguments_count; ++i) { | |
771 LOperand* value = environment->values()->at(translation_size + i); | |
772 AddToTranslation(translation, | |
773 value, | |
774 environment->HasTaggedValueAt(translation_size + i), | |
775 environment->HasUint32ValueAt(translation_size + i)); | |
776 } | |
777 continue; | |
778 } | |
779 | |
780 AddToTranslation(translation, | |
781 value, | 767 value, |
782 environment->HasTaggedValueAt(i), | 768 environment->HasTaggedValueAt(i), |
783 environment->HasUint32ValueAt(i)); | 769 environment->HasUint32ValueAt(i), |
770 &object_index, | |
771 &dematerialized_index); | |
784 } | 772 } |
785 } | 773 } |
786 | 774 |
787 | 775 |
788 void LCodeGen::AddToTranslation(Translation* translation, | 776 void LCodeGen::AddToTranslation(LEnvironment* environment, |
777 Translation* translation, | |
789 LOperand* op, | 778 LOperand* op, |
790 bool is_tagged, | 779 bool is_tagged, |
791 bool is_uint32) { | 780 bool is_uint32, |
781 int* object_index_pointer, | |
782 int* dematerialized_index_pointer) { | |
783 if (op == LEnvironment::materialization_marker()) { | |
784 int object_index = (*object_index_pointer)++; | |
785 if (environment->ObjectIsDuplicateAt(object_index)) { | |
titzer
2013/08/01 17:11:50
ObjectDuplicate means...object reference?
Michael Starzinger
2013/08/05 15:13:00
Correct. It means that a previously translated obj
| |
786 int dupe_of = environment->ObjectDuplicateOfAt(object_index); | |
787 translation->DuplicateObject(dupe_of); | |
788 return; | |
789 } | |
790 int object_length = environment->ObjectLengthAt(object_index); | |
791 if (environment->ObjectIsArgumentsAt(object_index)) { | |
792 translation->BeginArgumentsObject(object_length); | |
793 } else { | |
794 translation->BeginCapturedObject(object_length); | |
795 } | |
796 int dematerialized_index = *dematerialized_index_pointer; | |
797 int env_offset = environment->translation_size() + dematerialized_index; | |
798 *dematerialized_index_pointer += object_length; | |
799 for (int i = 0; i < object_length; ++i) { | |
800 LOperand* value = environment->values()->at(env_offset + i); | |
801 AddToTranslation(environment, | |
802 translation, | |
803 value, | |
804 environment->HasTaggedValueAt(env_offset + i), | |
805 environment->HasUint32ValueAt(env_offset + i), | |
806 object_index_pointer, | |
807 dematerialized_index_pointer); | |
808 } | |
809 return; | |
810 } | |
811 | |
792 if (op->IsStackSlot()) { | 812 if (op->IsStackSlot()) { |
793 if (is_tagged) { | 813 if (is_tagged) { |
794 translation->StoreStackSlot(op->index()); | 814 translation->StoreStackSlot(op->index()); |
795 } else if (is_uint32) { | 815 } else if (is_uint32) { |
796 translation->StoreUint32StackSlot(op->index()); | 816 translation->StoreUint32StackSlot(op->index()); |
797 } else { | 817 } else { |
798 translation->StoreInt32StackSlot(op->index()); | 818 translation->StoreInt32StackSlot(op->index()); |
799 } | 819 } |
800 } else if (op->IsDoubleStackSlot()) { | 820 } else if (op->IsDoubleStackSlot()) { |
801 translation->StoreDoubleStackSlot(op->index()); | 821 translation->StoreDoubleStackSlot(op->index()); |
(...skipping 5727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6529 FixedArray::kHeaderSize - kPointerSize)); | 6549 FixedArray::kHeaderSize - kPointerSize)); |
6530 __ bind(&done); | 6550 __ bind(&done); |
6531 } | 6551 } |
6532 | 6552 |
6533 | 6553 |
6534 #undef __ | 6554 #undef __ |
6535 | 6555 |
6536 } } // namespace v8::internal | 6556 } } // namespace v8::internal |
6537 | 6557 |
6538 #endif // V8_TARGET_ARCH_IA32 | 6558 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |