OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 if (MustAllocate(var)) { | 765 if (MustAllocate(var)) { |
766 if (MustAllocateInContext(var)) { | 766 if (MustAllocateInContext(var)) { |
767 // It is ok to set this only now, because arguments is a local | 767 // It is ok to set this only now, because arguments is a local |
768 // variable that is allocated after the parameters have been | 768 // variable that is allocated after the parameters have been |
769 // allocated. | 769 // allocated. |
770 arguments_shadow->is_accessed_from_inner_scope_ = true; | 770 arguments_shadow->is_accessed_from_inner_scope_ = true; |
771 } | 771 } |
772 var->rewrite_ = | 772 var->rewrite_ = |
773 new Property(arguments_shadow_, | 773 new Property(arguments_shadow_, |
774 new Literal(Handle<Object>(Smi::FromInt(i))), | 774 new Literal(Handle<Object>(Smi::FromInt(i))), |
775 kNoPosition); | 775 RelocInfo::kNoPosition); |
776 arguments_shadow->var_uses()->RecordUses(var->var_uses()); | 776 arguments_shadow->var_uses()->RecordUses(var->var_uses()); |
777 } | 777 } |
778 } | 778 } |
779 | 779 |
780 } else { | 780 } else { |
781 // The arguments object is not used, so we can access parameters directly. | 781 // The arguments object is not used, so we can access parameters directly. |
782 // The same parameter may occur multiple times in the parameters_ list. | 782 // The same parameter may occur multiple times in the parameters_ list. |
783 // If it does, and if it is not copied into the context object, it must | 783 // If it does, and if it is not copied into the context object, it must |
784 // receive the highest parameter index for that parameter; thus iteration | 784 // receive the highest parameter index for that parameter; thus iteration |
785 // order is relevant! | 785 // order is relevant! |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 886 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
887 !must_have_local_context) { | 887 !must_have_local_context) { |
888 num_heap_slots_ = 0; | 888 num_heap_slots_ = 0; |
889 } | 889 } |
890 | 890 |
891 // Allocation done. | 891 // Allocation done. |
892 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 892 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
893 } | 893 } |
894 | 894 |
895 } } // namespace v8::internal | 895 } } // namespace v8::internal |
OLD | NEW |