| 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); | |
| 143 __ cmp(r5, Operand(0)); | 141 __ cmp(r5, Operand(0)); |
| 144 __ b(eq, &ok); | 142 __ b(eq, &ok); |
| 145 int receiver_offset = scope()->num_parameters() * kPointerSize; | 143 int receiver_offset = scope()->num_parameters() * kPointerSize; |
| 146 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 144 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
| 147 __ str(r2, MemOperand(sp, receiver_offset)); | 145 __ str(r2, MemOperand(sp, receiver_offset)); |
| 148 __ bind(&ok); | 146 __ bind(&ok); |
| 149 ASSERT_EQ(kSizeOfOptimizedStrictModePrologue, ok.pos() - begin.pos()); | |
| 150 } | 147 } |
| 151 | 148 |
| 149 |
| 150 info()->set_prologue_offset(masm_->pc_offset()); |
| 152 // The following three instructions must remain together and unmodified for | 151 // The following three instructions must remain together and unmodified for |
| 153 // code aging to work properly. | 152 // code aging to work properly. |
| 154 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); | 153 __ 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 | 154 // Add unused load of ip to ensure prologue sequence is identical for |
| 156 // full-codegen and lithium-codegen. | 155 // full-codegen and lithium-codegen. |
| 157 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 156 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
| 158 __ add(fp, sp, Operand(2 * kPointerSize)); // Adjust FP to point to saved FP. | 157 __ add(fp, sp, Operand(2 * kPointerSize)); // Adjust FP to point to saved FP. |
| 159 | 158 |
| 160 // Reserve space for the stack slots needed by the code. | 159 // Reserve space for the stack slots needed by the code. |
| 161 int slots = GetStackSlotCount(); | 160 int slots = GetStackSlotCount(); |
| (...skipping 5623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5785 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5784 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5786 __ ldr(result, FieldMemOperand(scratch, | 5785 __ ldr(result, FieldMemOperand(scratch, |
| 5787 FixedArray::kHeaderSize - kPointerSize)); | 5786 FixedArray::kHeaderSize - kPointerSize)); |
| 5788 __ bind(&done); | 5787 __ bind(&done); |
| 5789 } | 5788 } |
| 5790 | 5789 |
| 5791 | 5790 |
| 5792 #undef __ | 5791 #undef __ |
| 5793 | 5792 |
| 5794 } } // namespace v8::internal | 5793 } } // namespace v8::internal |
| OLD | NEW |