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