| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // r1: Callee's JS function. | 114 // r1: Callee's JS function. |
| 115 // cp: Callee's context. | 115 // cp: Callee's context. |
| 116 // fp: Caller's frame pointer. | 116 // fp: Caller's frame pointer. |
| 117 // lr: Caller's pc. | 117 // lr: Caller's pc. |
| 118 | 118 |
| 119 // Strict mode functions and builtins need to replace the receiver | 119 // Strict mode functions and builtins need to replace the receiver |
| 120 // with undefined when called as functions (without an explicit | 120 // with undefined when called as functions (without an explicit |
| 121 // receiver object). r5 is zero for method calls and non-zero for | 121 // receiver object). r5 is zero for method calls and non-zero for |
| 122 // function calls. | 122 // function calls. |
| 123 if (!info_->is_classic_mode() || info_->is_native()) { | 123 if (!info_->is_classic_mode() || info_->is_native()) { |
| 124 Label ok; | |
| 125 __ cmp(r5, Operand::Zero()); | 124 __ cmp(r5, Operand::Zero()); |
| 126 __ b(eq, &ok); | |
| 127 int receiver_offset = scope()->num_parameters() * kPointerSize; | 125 int receiver_offset = scope()->num_parameters() * kPointerSize; |
| 128 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 126 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
| 129 __ str(r2, MemOperand(sp, receiver_offset)); | 127 __ str(r2, MemOperand(sp, receiver_offset), ne); |
| 130 __ bind(&ok); | |
| 131 } | 128 } |
| 132 } | 129 } |
| 133 | 130 |
| 134 info()->set_prologue_offset(masm_->pc_offset()); | 131 info()->set_prologue_offset(masm_->pc_offset()); |
| 135 if (NeedsEagerFrame()) { | 132 if (NeedsEagerFrame()) { |
| 136 __ Prologue(info()->IsStub() ? BUILD_STUB_FRAME : BUILD_FUNCTION_FRAME); | 133 __ Prologue(info()->IsStub() ? BUILD_STUB_FRAME : BUILD_FUNCTION_FRAME); |
| 137 frame_is_built_ = true; | 134 frame_is_built_ = true; |
| 138 info_->AddNoFrameRange(0, masm_->pc_offset()); | 135 info_->AddNoFrameRange(0, masm_->pc_offset()); |
| 139 } | 136 } |
| 140 | 137 |
| (...skipping 5678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5819 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5816 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5820 __ ldr(result, FieldMemOperand(scratch, | 5817 __ ldr(result, FieldMemOperand(scratch, |
| 5821 FixedArray::kHeaderSize - kPointerSize)); | 5818 FixedArray::kHeaderSize - kPointerSize)); |
| 5822 __ bind(&done); | 5819 __ bind(&done); |
| 5823 } | 5820 } |
| 5824 | 5821 |
| 5825 | 5822 |
| 5826 #undef __ | 5823 #undef __ |
| 5827 | 5824 |
| 5828 } } // namespace v8::internal | 5825 } } // namespace v8::internal |
| OLD | NEW |