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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 Label ok; | 139 Label ok; |
140 __ test(ecx, Operand(ecx)); | 140 __ test(ecx, Operand(ecx)); |
141 __ j(zero, &ok, Label::kNear); | 141 __ j(zero, &ok, Label::kNear); |
142 // +1 for return address. | 142 // +1 for return address. |
143 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; | 143 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; |
144 __ mov(Operand(esp, receiver_offset), | 144 __ mov(Operand(esp, receiver_offset), |
145 Immediate(isolate()->factory()->undefined_value())); | 145 Immediate(isolate()->factory()->undefined_value())); |
146 __ bind(&ok); | 146 __ bind(&ok); |
147 } | 147 } |
148 | 148 |
| 149 // Open a frame scope to indicate that there is a frame on the stack. The |
| 150 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 151 // the frame (that is done below). |
| 152 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 153 |
149 __ push(ebp); // Caller's frame pointer. | 154 __ push(ebp); // Caller's frame pointer. |
150 __ mov(ebp, esp); | 155 __ mov(ebp, esp); |
151 __ push(esi); // Callee's context. | 156 __ push(esi); // Callee's context. |
152 __ push(edi); // Callee's JS Function. | 157 __ push(edi); // Callee's JS Function. |
153 | 158 |
154 { Comment cmnt(masm_, "[ Allocate locals"); | 159 { Comment cmnt(masm_, "[ Allocate locals"); |
155 int locals_count = scope()->num_stack_slots(); | 160 int locals_count = scope()->num_stack_slots(); |
156 if (locals_count == 1) { | 161 if (locals_count == 1) { |
157 __ push(Immediate(isolate()->factory()->undefined_value())); | 162 __ push(Immediate(isolate()->factory()->undefined_value())); |
158 } else if (locals_count > 1) { | 163 } else if (locals_count > 1) { |
(...skipping 4171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4330 // And return. | 4335 // And return. |
4331 __ ret(0); | 4336 __ ret(0); |
4332 } | 4337 } |
4333 | 4338 |
4334 | 4339 |
4335 #undef __ | 4340 #undef __ |
4336 | 4341 |
4337 } } // namespace v8::internal | 4342 } } // namespace v8::internal |
4338 | 4343 |
4339 #endif // V8_TARGET_ARCH_IA32 | 4344 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |