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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // cp: Callee's context. | 129 // cp: Callee's context. |
130 // fp: Caller's frame pointer. | 130 // fp: Caller's frame pointer. |
131 // lr: Caller's pc. | 131 // lr: Caller's pc. |
132 | 132 |
133 // Strict mode functions and builtins need to replace the receiver | 133 // Strict mode functions and builtins need to replace the receiver |
134 // with undefined when called as functions (without an explicit | 134 // with undefined when called as functions (without an explicit |
135 // receiver object). r5 is zero for method calls and non-zero for | 135 // receiver object). r5 is zero for method calls and non-zero for |
136 // function calls. | 136 // function calls. |
137 if (!info_->is_classic_mode() || info_->is_native()) { | 137 if (!info_->is_classic_mode() || info_->is_native()) { |
138 Label ok; | 138 Label ok; |
| 139 Label begin; |
| 140 __ bind(&begin); |
139 __ Branch(&ok, eq, t1, Operand(zero_reg)); | 141 __ Branch(&ok, eq, t1, Operand(zero_reg)); |
140 | 142 |
141 int receiver_offset = scope()->num_parameters() * kPointerSize; | 143 int receiver_offset = scope()->num_parameters() * kPointerSize; |
142 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); | 144 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
143 __ sw(a2, MemOperand(sp, receiver_offset)); | 145 __ sw(a2, MemOperand(sp, receiver_offset)); |
144 __ bind(&ok); | 146 __ bind(&ok); |
| 147 ASSERT_EQ(kSizeOfOptimizedStrictModePrologue, ok.pos() - begin.pos()); |
145 } | 148 } |
146 | 149 |
| 150 // The following three instructions must remain together and unmodified for |
| 151 // code aging to work properly. |
147 __ Push(ra, fp, cp, a1); | 152 __ Push(ra, fp, cp, a1); |
| 153 // Add unused load of ip to ensure prologue sequence is identical for |
| 154 // full-codegen and lithium-codegen. |
| 155 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
148 __ Addu(fp, sp, Operand(2 * kPointerSize)); // Adj. FP to point to saved FP. | 156 __ Addu(fp, sp, Operand(2 * kPointerSize)); // Adj. FP to point to saved FP. |
149 | 157 |
150 // Reserve space for the stack slots needed by the code. | 158 // Reserve space for the stack slots needed by the code. |
151 int slots = GetStackSlotCount(); | 159 int slots = GetStackSlotCount(); |
152 if (slots > 0) { | 160 if (slots > 0) { |
153 if (FLAG_debug_code) { | 161 if (FLAG_debug_code) { |
154 __ li(a0, Operand(slots)); | 162 __ li(a0, Operand(slots)); |
155 __ li(a2, Operand(kSlotsZapValue)); | 163 __ li(a2, Operand(kSlotsZapValue)); |
156 Label loop; | 164 Label loop; |
157 __ bind(&loop); | 165 __ bind(&loop); |
(...skipping 5302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5460 __ Subu(scratch, result, scratch); | 5468 __ Subu(scratch, result, scratch); |
5461 __ lw(result, FieldMemOperand(scratch, | 5469 __ lw(result, FieldMemOperand(scratch, |
5462 FixedArray::kHeaderSize - kPointerSize)); | 5470 FixedArray::kHeaderSize - kPointerSize)); |
5463 __ bind(&done); | 5471 __ bind(&done); |
5464 } | 5472 } |
5465 | 5473 |
5466 | 5474 |
5467 #undef __ | 5475 #undef __ |
5468 | 5476 |
5469 } } // namespace v8::internal | 5477 } } // namespace v8::internal |
OLD | NEW |