OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 | 1072 |
1073 // Get the length from the frame. | 1073 // Get the length from the frame. |
1074 __ mov(ecx, Operand(esp, 1 * kPointerSize)); | 1074 __ mov(ecx, Operand(esp, 1 * kPointerSize)); |
1075 __ jmp(&try_allocate, Label::kNear); | 1075 __ jmp(&try_allocate, Label::kNear); |
1076 | 1076 |
1077 // Patch the arguments.length and the parameters pointer. | 1077 // Patch the arguments.length and the parameters pointer. |
1078 __ bind(&adaptor_frame); | 1078 __ bind(&adaptor_frame); |
1079 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1079 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
1080 | 1080 |
1081 if (has_new_target()) { | 1081 if (has_new_target()) { |
| 1082 // If the constructor was [[Call]]ed, the call will not push a new.target |
| 1083 // onto the stack. In that case the arguments array we construct is bogus, |
| 1084 // bu we do not care as the constructor throws immediately. |
| 1085 __ cmp(ecx, Immediate(Smi::FromInt(0))); |
| 1086 Label skip_decrement; |
| 1087 __ j(equal, &skip_decrement); |
1082 // Subtract 1 from smi-tagged arguments count. | 1088 // Subtract 1 from smi-tagged arguments count. |
1083 __ sub(ecx, Immediate(2)); | 1089 __ sub(ecx, Immediate(2)); |
| 1090 __ bind(&skip_decrement); |
1084 } | 1091 } |
1085 | 1092 |
1086 __ lea(edx, Operand(edx, ecx, times_2, | 1093 __ lea(edx, Operand(edx, ecx, times_2, |
1087 StandardFrameConstants::kCallerSPOffset)); | 1094 StandardFrameConstants::kCallerSPOffset)); |
1088 __ mov(Operand(esp, 1 * kPointerSize), ecx); | 1095 __ mov(Operand(esp, 1 * kPointerSize), ecx); |
1089 __ mov(Operand(esp, 2 * kPointerSize), edx); | 1096 __ mov(Operand(esp, 2 * kPointerSize), edx); |
1090 | 1097 |
1091 // Try the new space allocation. Start out with computing the size of | 1098 // Try the new space allocation. Start out with computing the size of |
1092 // the arguments object and the elements array. | 1099 // the arguments object and the elements array. |
1093 Label add_arguments_object; | 1100 Label add_arguments_object; |
(...skipping 4317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5411 ApiParameterOperand(2), kStackSpace, nullptr, | 5418 ApiParameterOperand(2), kStackSpace, nullptr, |
5412 Operand(ebp, 7 * kPointerSize), NULL); | 5419 Operand(ebp, 7 * kPointerSize), NULL); |
5413 } | 5420 } |
5414 | 5421 |
5415 | 5422 |
5416 #undef __ | 5423 #undef __ |
5417 | 5424 |
5418 } } // namespace v8::internal | 5425 } } // namespace v8::internal |
5419 | 5426 |
5420 #endif // V8_TARGET_ARCH_IA32 | 5427 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |