| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 translation->BeginSetterStubFrame(closure_id); | 598 translation->BeginSetterStubFrame(closure_id); |
| 599 break; | 599 break; |
| 600 case STUB: | 600 case STUB: |
| 601 translation->BeginCompiledStubFrame(); | 601 translation->BeginCompiledStubFrame(); |
| 602 break; | 602 break; |
| 603 case ARGUMENTS_ADAPTOR: | 603 case ARGUMENTS_ADAPTOR: |
| 604 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); | 604 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
| 605 break; | 605 break; |
| 606 } | 606 } |
| 607 | 607 |
| 608 int object_index = 0; |
| 609 int dematerialized_index = 0; |
| 608 for (int i = 0; i < translation_size; ++i) { | 610 for (int i = 0; i < translation_size; ++i) { |
| 609 LOperand* value = environment->values()->at(i); | 611 LOperand* value = environment->values()->at(i); |
| 610 | 612 AddToTranslation(environment, |
| 611 // TODO(mstarzinger): Introduce marker operands to indicate that this value | 613 translation, |
| 612 // is not present and must be reconstructed from the deoptimizer. Currently | |
| 613 // this is only used for the arguments object. | |
| 614 if (value == NULL) { | |
| 615 int arguments_count = environment->values()->length() - translation_size; | |
| 616 translation->BeginArgumentsObject(arguments_count); | |
| 617 for (int i = 0; i < arguments_count; ++i) { | |
| 618 LOperand* value = environment->values()->at(translation_size + i); | |
| 619 AddToTranslation(translation, | |
| 620 value, | |
| 621 environment->HasTaggedValueAt(translation_size + i), | |
| 622 environment->HasUint32ValueAt(translation_size + i)); | |
| 623 } | |
| 624 continue; | |
| 625 } | |
| 626 | |
| 627 AddToTranslation(translation, | |
| 628 value, | 614 value, |
| 629 environment->HasTaggedValueAt(i), | 615 environment->HasTaggedValueAt(i), |
| 630 environment->HasUint32ValueAt(i)); | 616 environment->HasUint32ValueAt(i), |
| 617 &object_index, |
| 618 &dematerialized_index); |
| 631 } | 619 } |
| 632 } | 620 } |
| 633 | 621 |
| 634 | 622 |
| 635 void LCodeGen::AddToTranslation(Translation* translation, | 623 void LCodeGen::AddToTranslation(LEnvironment* environment, |
| 624 Translation* translation, |
| 636 LOperand* op, | 625 LOperand* op, |
| 637 bool is_tagged, | 626 bool is_tagged, |
| 638 bool is_uint32) { | 627 bool is_uint32, |
| 628 int* object_index_pointer, |
| 629 int* dematerialized_index_pointer) { |
| 630 if (op == LEnvironment::materialization_marker()) { |
| 631 int object_index = (*object_index_pointer)++; |
| 632 if (environment->ObjectIsDuplicateAt(object_index)) { |
| 633 int dupe_of = environment->ObjectDuplicateOfAt(object_index); |
| 634 translation->DuplicateObject(dupe_of); |
| 635 return; |
| 636 } |
| 637 int object_length = environment->ObjectLengthAt(object_index); |
| 638 if (environment->ObjectIsArgumentsAt(object_index)) { |
| 639 translation->BeginArgumentsObject(object_length); |
| 640 } else { |
| 641 translation->BeginCapturedObject(object_length); |
| 642 } |
| 643 int dematerialized_index = *dematerialized_index_pointer; |
| 644 int env_offset = environment->translation_size() + dematerialized_index; |
| 645 *dematerialized_index_pointer += object_length; |
| 646 for (int i = 0; i < object_length; ++i) { |
| 647 LOperand* value = environment->values()->at(env_offset + i); |
| 648 AddToTranslation(environment, |
| 649 translation, |
| 650 value, |
| 651 environment->HasTaggedValueAt(env_offset + i), |
| 652 environment->HasUint32ValueAt(env_offset + i), |
| 653 object_index_pointer, |
| 654 dematerialized_index_pointer); |
| 655 } |
| 656 return; |
| 657 } |
| 658 |
| 639 if (op->IsStackSlot()) { | 659 if (op->IsStackSlot()) { |
| 640 if (is_tagged) { | 660 if (is_tagged) { |
| 641 translation->StoreStackSlot(op->index()); | 661 translation->StoreStackSlot(op->index()); |
| 642 } else if (is_uint32) { | 662 } else if (is_uint32) { |
| 643 translation->StoreUint32StackSlot(op->index()); | 663 translation->StoreUint32StackSlot(op->index()); |
| 644 } else { | 664 } else { |
| 645 translation->StoreInt32StackSlot(op->index()); | 665 translation->StoreInt32StackSlot(op->index()); |
| 646 } | 666 } |
| 647 } else if (op->IsDoubleStackSlot()) { | 667 } else if (op->IsDoubleStackSlot()) { |
| 648 translation->StoreDoubleStackSlot(op->index()); | 668 translation->StoreDoubleStackSlot(op->index()); |
| (...skipping 5187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5836 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5856 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5837 __ ldr(result, FieldMemOperand(scratch, | 5857 __ ldr(result, FieldMemOperand(scratch, |
| 5838 FixedArray::kHeaderSize - kPointerSize)); | 5858 FixedArray::kHeaderSize - kPointerSize)); |
| 5839 __ bind(&done); | 5859 __ bind(&done); |
| 5840 } | 5860 } |
| 5841 | 5861 |
| 5842 | 5862 |
| 5843 #undef __ | 5863 #undef __ |
| 5844 | 5864 |
| 5845 } } // namespace v8::internal | 5865 } } // namespace v8::internal |
| OLD | NEW |