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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 __ stop("stop-at"); | 151 __ stop("stop-at"); |
152 } | 152 } |
153 #endif | 153 #endif |
154 | 154 |
155 // Strict mode functions and builtins need to replace the receiver | 155 // Strict mode functions and builtins need to replace the receiver |
156 // with undefined when called as functions (without an explicit | 156 // with undefined when called as functions (without an explicit |
157 // receiver object). t1 is zero for method calls and non-zero for | 157 // receiver object). t1 is zero for method calls and non-zero for |
158 // function calls. | 158 // function calls. |
159 if (!info->is_classic_mode() || info->is_native()) { | 159 if (!info->is_classic_mode() || info->is_native()) { |
160 Label ok; | 160 Label ok; |
| 161 Label begin; |
| 162 __ bind(&begin); |
161 __ Branch(&ok, eq, t1, Operand(zero_reg)); | 163 __ Branch(&ok, eq, t1, Operand(zero_reg)); |
162 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 164 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
163 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 165 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
164 __ sw(a2, MemOperand(sp, receiver_offset)); | 166 __ sw(a2, MemOperand(sp, receiver_offset)); |
165 __ bind(&ok); | 167 __ bind(&ok); |
| 168 ASSERT_EQ(kSizeOfFullCodegenStrictModePrologue, ok.pos() - begin.pos()); |
166 } | 169 } |
167 | 170 |
168 // Open a frame scope to indicate that there is a frame on the stack. The | 171 // Open a frame scope to indicate that there is a frame on the stack. The |
169 // MANUAL indicates that the scope shouldn't actually generate code to set up | 172 // MANUAL indicates that the scope shouldn't actually generate code to set up |
170 // the frame (that is done below). | 173 // the frame (that is done below). |
171 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 174 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
172 | 175 |
173 int locals_count = info->scope()->num_stack_slots(); | 176 int locals_count = info->scope()->num_stack_slots(); |
174 | 177 |
| 178 // The following three instructions must remain together and unmodified for |
| 179 // code aging to work properly. |
175 __ Push(ra, fp, cp, a1); | 180 __ Push(ra, fp, cp, a1); |
176 if (locals_count > 0) { | 181 // Load undefined value here, so the value is ready for the loop |
177 // Load undefined value here, so the value is ready for the loop | 182 // below. |
178 // below. | 183 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
179 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | |
180 } | |
181 // Adjust fp to point to caller's fp. | 184 // Adjust fp to point to caller's fp. |
182 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 185 __ Addu(fp, sp, Operand(2 * kPointerSize)); |
183 | 186 |
184 { Comment cmnt(masm_, "[ Allocate locals"); | 187 { Comment cmnt(masm_, "[ Allocate locals"); |
185 for (int i = 0; i < locals_count; i++) { | 188 for (int i = 0; i < locals_count; i++) { |
186 __ push(at); | 189 __ push(at); |
187 } | 190 } |
188 } | 191 } |
189 | 192 |
190 bool function_in_register = true; | 193 bool function_in_register = true; |
(...skipping 4377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4568 *context_length = 0; | 4571 *context_length = 0; |
4569 return previous_; | 4572 return previous_; |
4570 } | 4573 } |
4571 | 4574 |
4572 | 4575 |
4573 #undef __ | 4576 #undef __ |
4574 | 4577 |
4575 } } // namespace v8::internal | 4578 } } // namespace v8::internal |
4576 | 4579 |
4577 #endif // V8_TARGET_ARCH_MIPS | 4580 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |