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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // cp: Callee's context. | 131 // cp: Callee's context. |
132 // fp: Caller's frame pointer. | 132 // fp: Caller's frame pointer. |
133 // lr: Caller's pc. | 133 // lr: Caller's pc. |
134 | 134 |
135 // Strict mode functions and builtins need to replace the receiver | 135 // Strict mode functions and builtins need to replace the receiver |
136 // with undefined when called as functions (without an explicit | 136 // with undefined when called as functions (without an explicit |
137 // receiver object). r5 is zero for method calls and non-zero for | 137 // receiver object). r5 is zero for method calls and non-zero for |
138 // function calls. | 138 // function calls. |
139 if (!info_->is_classic_mode() || info_->is_native()) { | 139 if (!info_->is_classic_mode() || info_->is_native()) { |
140 Label ok; | 140 Label ok; |
| 141 Label begin; |
| 142 __ bind(&begin); |
141 __ cmp(r5, Operand(0)); | 143 __ cmp(r5, Operand(0)); |
142 __ b(eq, &ok); | 144 __ b(eq, &ok); |
143 int receiver_offset = scope()->num_parameters() * kPointerSize; | 145 int receiver_offset = scope()->num_parameters() * kPointerSize; |
144 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 146 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
145 __ str(r2, MemOperand(sp, receiver_offset)); | 147 __ str(r2, MemOperand(sp, receiver_offset)); |
146 __ bind(&ok); | 148 __ bind(&ok); |
| 149 ASSERT_EQ(kSizeOfOptimizedStrictModePrologue, ok.pos() - begin.pos()); |
147 } | 150 } |
148 | 151 |
| 152 // The following three instructions must remain together and unmodified for |
| 153 // code aging to work properly. |
149 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 154 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); |
| 155 // Add unused load of ip to ensure prologue sequence is identical for |
| 156 // full-codegen and lithium-codegen. |
| 157 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
150 __ add(fp, sp, Operand(2 * kPointerSize)); // Adjust FP to point to saved FP. | 158 __ add(fp, sp, Operand(2 * kPointerSize)); // Adjust FP to point to saved FP. |
151 | 159 |
152 // Reserve space for the stack slots needed by the code. | 160 // Reserve space for the stack slots needed by the code. |
153 int slots = GetStackSlotCount(); | 161 int slots = GetStackSlotCount(); |
154 if (slots > 0) { | 162 if (slots > 0) { |
155 if (FLAG_debug_code) { | 163 if (FLAG_debug_code) { |
156 __ mov(r0, Operand(slots)); | 164 __ mov(r0, Operand(slots)); |
157 __ mov(r2, Operand(kSlotsZapValue)); | 165 __ mov(r2, Operand(kSlotsZapValue)); |
158 Label loop; | 166 Label loop; |
159 __ bind(&loop); | 167 __ bind(&loop); |
(...skipping 5547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5707 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5715 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5708 __ ldr(result, FieldMemOperand(scratch, | 5716 __ ldr(result, FieldMemOperand(scratch, |
5709 FixedArray::kHeaderSize - kPointerSize)); | 5717 FixedArray::kHeaderSize - kPointerSize)); |
5710 __ bind(&done); | 5718 __ bind(&done); |
5711 } | 5719 } |
5712 | 5720 |
5713 | 5721 |
5714 #undef __ | 5722 #undef __ |
5715 | 5723 |
5716 } } // namespace v8::internal | 5724 } } // namespace v8::internal |
OLD | NEW |