OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 Label begin; | 143 Label begin; |
144 __ bind(&begin); | 144 __ bind(&begin); |
145 Label ok; | 145 Label ok; |
146 __ test(ecx, Operand(ecx)); | 146 __ test(ecx, Operand(ecx)); |
147 __ j(zero, &ok, Label::kNear); | 147 __ j(zero, &ok, Label::kNear); |
148 // +1 for return address. | 148 // +1 for return address. |
149 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; | 149 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; |
150 __ mov(Operand(esp, receiver_offset), | 150 __ mov(Operand(esp, receiver_offset), |
151 Immediate(isolate()->factory()->undefined_value())); | 151 Immediate(isolate()->factory()->undefined_value())); |
152 __ bind(&ok); | 152 __ bind(&ok); |
153 ASSERT_EQ(kSizeOfOptimizedStrictModePrologue, ok.pos() - begin.pos()); | 153 ASSERT(!FLAG_age_code || |
| 154 (kSizeOfOptimizedStrictModePrologue == ok.pos() - begin.pos())); |
154 } | 155 } |
155 | 156 |
156 | 157 |
157 if (dynamic_frame_alignment_) { | 158 if (dynamic_frame_alignment_) { |
158 Label begin; | 159 Label begin; |
159 __ bind(&begin); | 160 __ bind(&begin); |
160 // Move state of dynamic frame alignment into edx. | 161 // Move state of dynamic frame alignment into edx. |
161 __ mov(edx, Immediate(kNoAlignmentPadding)); | 162 __ mov(edx, Immediate(kNoAlignmentPadding)); |
162 | 163 |
163 Label do_not_pad, align_loop; | 164 Label do_not_pad, align_loop; |
164 STATIC_ASSERT(kDoubleSize == 2 * kPointerSize); | 165 STATIC_ASSERT(kDoubleSize == 2 * kPointerSize); |
165 // Align esp + 4 to a multiple of 2 * kPointerSize. | 166 // Align esp + 4 to a multiple of 2 * kPointerSize. |
166 __ test(esp, Immediate(kPointerSize)); | 167 __ test(esp, Immediate(kPointerSize)); |
167 __ j(not_zero, &do_not_pad, Label::kNear); | 168 __ j(not_zero, &do_not_pad, Label::kNear); |
168 __ push(Immediate(0)); | 169 __ push(Immediate(0)); |
169 __ mov(ebx, esp); | 170 __ mov(ebx, esp); |
170 __ mov(edx, Immediate(kAlignmentPaddingPushed)); | 171 __ mov(edx, Immediate(kAlignmentPaddingPushed)); |
171 // Copy arguments, receiver, and return address. | 172 // Copy arguments, receiver, and return address. |
172 __ mov(ecx, Immediate(scope()->num_parameters() + 2)); | 173 __ mov(ecx, Immediate(scope()->num_parameters() + 2)); |
173 | 174 |
174 __ bind(&align_loop); | 175 __ bind(&align_loop); |
175 __ mov(eax, Operand(ebx, 1 * kPointerSize)); | 176 __ mov(eax, Operand(ebx, 1 * kPointerSize)); |
176 __ mov(Operand(ebx, 0), eax); | 177 __ mov(Operand(ebx, 0), eax); |
177 __ add(Operand(ebx), Immediate(kPointerSize)); | 178 __ add(Operand(ebx), Immediate(kPointerSize)); |
178 __ dec(ecx); | 179 __ dec(ecx); |
179 __ j(not_zero, &align_loop, Label::kNear); | 180 __ j(not_zero, &align_loop, Label::kNear); |
180 __ mov(Operand(ebx, 0), Immediate(kAlignmentZapValue)); | 181 __ mov(Operand(ebx, 0), Immediate(kAlignmentZapValue)); |
181 __ bind(&do_not_pad); | 182 __ bind(&do_not_pad); |
182 ASSERT_EQ(kSizeOfOptimizedAlignStackPrologue, | 183 ASSERT(!FLAG_age_code || |
183 do_not_pad.pos() - begin.pos()); | 184 (kSizeOfOptimizedAlignStackPrologue == |
| 185 do_not_pad.pos() - begin.pos())); |
184 } | 186 } |
185 | 187 |
186 __ push(ebp); // Caller's frame pointer. | 188 __ push(ebp); // Caller's frame pointer. |
187 __ mov(ebp, esp); | 189 __ mov(ebp, esp); |
188 __ push(esi); // Callee's context. | 190 __ push(esi); // Callee's context. |
189 __ push(edi); // Callee's JS function. | 191 __ push(edi); // Callee's JS function. |
190 | 192 |
191 if (dynamic_frame_alignment_ && FLAG_debug_code) { | 193 if (dynamic_frame_alignment_ && FLAG_debug_code) { |
192 __ test(esp, Immediate(kPointerSize)); | 194 __ test(esp, Immediate(kPointerSize)); |
193 __ Assert(zero, "frame is expected to be aligned"); | 195 __ Assert(zero, "frame is expected to be aligned"); |
(...skipping 5379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5573 FixedArray::kHeaderSize - kPointerSize)); | 5575 FixedArray::kHeaderSize - kPointerSize)); |
5574 __ bind(&done); | 5576 __ bind(&done); |
5575 } | 5577 } |
5576 | 5578 |
5577 | 5579 |
5578 #undef __ | 5580 #undef __ |
5579 | 5581 |
5580 } } // namespace v8::internal | 5582 } } // namespace v8::internal |
5581 | 5583 |
5582 #endif // V8_TARGET_ARCH_IA32 | 5584 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |