| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2928 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2928 __ cmp(Operand(ecx), Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 2929 __ j(not_equal, &runtime, Label::kNear); | 2929 __ j(not_equal, &runtime, Label::kNear); |
| 2930 | 2930 |
| 2931 // Patch the arguments.length and the parameters pointer. | 2931 // Patch the arguments.length and the parameters pointer. |
| 2932 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2932 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 2933 __ mov(Operand(esp, 1 * kPointerSize), ecx); | 2933 __ mov(Operand(esp, 1 * kPointerSize), ecx); |
| 2934 __ lea(edx, Operand(edx, ecx, times_2, | 2934 __ lea(edx, Operand(edx, ecx, times_2, |
| 2935 StandardFrameConstants::kCallerSPOffset)); | 2935 StandardFrameConstants::kCallerSPOffset)); |
| 2936 __ mov(Operand(esp, 2 * kPointerSize), edx); | 2936 __ mov(Operand(esp, 2 * kPointerSize), edx); |
| 2937 | 2937 |
| 2938 // Try the new space allocation. Start out with computing the size of | |
| 2939 // the arguments object and the elements array. | |
| 2940 __ bind(&runtime); | 2938 __ bind(&runtime); |
| 2941 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2939 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); |
| 2942 } | 2940 } |
| 2943 | 2941 |
| 2944 | 2942 |
| 2945 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { | 2943 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { |
| 2946 // esp[0] : return address | 2944 // esp[0] : return address |
| 2947 // esp[4] : number of parameters (tagged) | 2945 // esp[4] : number of parameters (tagged) |
| 2948 // esp[8] : receiver displacement | 2946 // esp[8] : receiver displacement |
| 2949 // esp[12] : function | 2947 // esp[12] : function |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3132 __ mov(FieldOperand(edi, FixedArray::kMapOffset), | 3130 __ mov(FieldOperand(edi, FixedArray::kMapOffset), |
| 3133 Immediate(FACTORY->fixed_array_map())); | 3131 Immediate(FACTORY->fixed_array_map())); |
| 3134 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx); | 3132 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx); |
| 3135 | 3133 |
| 3136 Label arguments_loop, arguments_test; | 3134 Label arguments_loop, arguments_test; |
| 3137 __ mov(ebx, Operand(esp, 1 * kPointerSize)); | 3135 __ mov(ebx, Operand(esp, 1 * kPointerSize)); |
| 3138 __ mov(edx, Operand(esp, 4 * kPointerSize)); | 3136 __ mov(edx, Operand(esp, 4 * kPointerSize)); |
| 3139 __ sub(Operand(edx), ebx); // Is there a smarter way to do negative scaling? | 3137 __ sub(Operand(edx), ebx); // Is there a smarter way to do negative scaling? |
| 3140 __ sub(Operand(edx), ebx); | 3138 __ sub(Operand(edx), ebx); |
| 3141 __ jmp(&arguments_test, Label::kNear); | 3139 __ jmp(&arguments_test, Label::kNear); |
| 3140 |
| 3142 __ bind(&arguments_loop); | 3141 __ bind(&arguments_loop); |
| 3143 __ sub(Operand(edx), Immediate(kPointerSize)); | 3142 __ sub(Operand(edx), Immediate(kPointerSize)); |
| 3144 __ mov(eax, Operand(edx, 0)); | 3143 __ mov(eax, Operand(edx, 0)); |
| 3145 __ mov(FieldOperand(edi, ebx, times_2, FixedArray::kHeaderSize), eax); | 3144 __ mov(FieldOperand(edi, ebx, times_2, FixedArray::kHeaderSize), eax); |
| 3146 __ add(Operand(ebx), Immediate(Smi::FromInt(1))); | 3145 __ add(Operand(ebx), Immediate(Smi::FromInt(1))); |
| 3146 |
| 3147 __ bind(&arguments_test); | 3147 __ bind(&arguments_test); |
| 3148 __ cmp(ebx, Operand(ecx)); | 3148 __ cmp(ebx, Operand(ecx)); |
| 3149 __ j(less, &arguments_loop, Label::kNear); | 3149 __ j(less, &arguments_loop, Label::kNear); |
| 3150 | 3150 |
| 3151 // Restore. | 3151 // Restore. |
| 3152 __ pop(eax); // Address of arguments object. | 3152 __ pop(eax); // Address of arguments object. |
| 3153 __ pop(ebx); // Parameter count. | 3153 __ pop(ebx); // Parameter count. |
| 3154 | 3154 |
| 3155 // Return and remove the on-stack parameters. | 3155 // Return and remove the on-stack parameters. |
| 3156 __ ret(3 * kPointerSize); | 3156 __ ret(3 * kPointerSize); |
| (...skipping 3272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6429 __ Drop(1); | 6429 __ Drop(1); |
| 6430 __ ret(2 * kPointerSize); | 6430 __ ret(2 * kPointerSize); |
| 6431 } | 6431 } |
| 6432 | 6432 |
| 6433 | 6433 |
| 6434 #undef __ | 6434 #undef __ |
| 6435 | 6435 |
| 6436 } } // namespace v8::internal | 6436 } } // namespace v8::internal |
| 6437 | 6437 |
| 6438 #endif // V8_TARGET_ARCH_IA32 | 6438 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |