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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 784 } |
785 | 785 |
786 // If there is no arguments variable in the stack or we have an | 786 // If there is no arguments variable in the stack or we have an |
787 // optimized frame, we find the frame that holds the actual arguments | 787 // optimized frame, we find the frame that holds the actual arguments |
788 // passed to the function. | 788 // passed to the function. |
789 it.AdvanceToArgumentsFrame(); | 789 it.AdvanceToArgumentsFrame(); |
790 frame = it.frame(); | 790 frame = it.frame(); |
791 | 791 |
792 // Get the number of arguments and construct an arguments object | 792 // Get the number of arguments and construct an arguments object |
793 // mirror for the right frame. | 793 // mirror for the right frame. |
794 const int length = frame->GetProvidedParametersCount(); | 794 const int length = frame->ComputeParametersCount(); |
795 Handle<JSObject> arguments = Factory::NewArgumentsObject(function, | 795 Handle<JSObject> arguments = Factory::NewArgumentsObject(function, |
796 length); | 796 length); |
797 Handle<FixedArray> array = Factory::NewFixedArray(length); | 797 Handle<FixedArray> array = Factory::NewFixedArray(length); |
798 | 798 |
799 // Copy the parameters to the arguments object. | 799 // Copy the parameters to the arguments object. |
800 ASSERT(array->length() == length); | 800 ASSERT(array->length() == length); |
801 for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i)); | 801 for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i)); |
802 arguments->set_elements(*array); | 802 arguments->set_elements(*array); |
803 | 803 |
804 // Return the freshly allocated arguments object. | 804 // Return the freshly allocated arguments object. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 } | 898 } |
899 | 899 |
900 | 900 |
901 const AccessorDescriptor Accessors::ObjectPrototype = { | 901 const AccessorDescriptor Accessors::ObjectPrototype = { |
902 ObjectGetPrototype, | 902 ObjectGetPrototype, |
903 ObjectSetPrototype, | 903 ObjectSetPrototype, |
904 0 | 904 0 |
905 }; | 905 }; |
906 | 906 |
907 } } // namespace v8::internal | 907 } } // namespace v8::internal |
OLD | NEW |