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); | |
163 __ Branch(&ok, eq, t1, Operand(zero_reg)); | 161 __ Branch(&ok, eq, t1, Operand(zero_reg)); |
164 int receiver_offset = info->scope()->num_parameters() * kPointerSize; | 162 int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
165 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 163 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
166 __ sw(a2, MemOperand(sp, receiver_offset)); | 164 __ sw(a2, MemOperand(sp, receiver_offset)); |
167 __ bind(&ok); | 165 __ bind(&ok); |
168 ASSERT_EQ(kSizeOfFullCodegenStrictModePrologue, ok.pos() - begin.pos()); | |
169 } | 166 } |
170 | 167 |
171 // Open a frame scope to indicate that there is a frame on the stack. The | 168 // Open a frame scope to indicate that there is a frame on the stack. The |
172 // MANUAL indicates that the scope shouldn't actually generate code to set up | 169 // MANUAL indicates that the scope shouldn't actually generate code to set up |
173 // the frame (that is done below). | 170 // the frame (that is done below). |
174 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 171 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
175 | 172 |
176 int locals_count = info->scope()->num_stack_slots(); | 173 int locals_count = info->scope()->num_stack_slots(); |
177 | 174 |
| 175 info->set_prologue_offset(masm_->pc_offset()); |
178 // The following three instructions must remain together and unmodified for | 176 // The following three instructions must remain together and unmodified for |
179 // code aging to work properly. | 177 // code aging to work properly. |
180 __ Push(ra, fp, cp, a1); | 178 __ Push(ra, fp, cp, a1); |
181 // Load undefined value here, so the value is ready for the loop | 179 // Load undefined value here, so the value is ready for the loop |
182 // below. | 180 // below. |
183 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 181 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
184 // Adjust fp to point to caller's fp. | 182 // Adjust fp to point to caller's fp. |
185 __ Addu(fp, sp, Operand(2 * kPointerSize)); | 183 __ Addu(fp, sp, Operand(2 * kPointerSize)); |
186 | 184 |
187 { Comment cmnt(masm_, "[ Allocate locals"); | 185 { Comment cmnt(masm_, "[ Allocate locals"); |
(...skipping 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4557 *context_length = 0; | 4555 *context_length = 0; |
4558 return previous_; | 4556 return previous_; |
4559 } | 4557 } |
4560 | 4558 |
4561 | 4559 |
4562 #undef __ | 4560 #undef __ |
4563 | 4561 |
4564 } } // namespace v8::internal | 4562 } } // namespace v8::internal |
4565 | 4563 |
4566 #endif // V8_TARGET_ARCH_MIPS | 4564 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |