| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (info()->IsOptimizing()) { | 131 if (info()->IsOptimizing()) { |
| 132 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 132 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 133 | 133 |
| 134 #ifdef DEBUG | 134 #ifdef DEBUG |
| 135 if (strlen(FLAG_stop_at) > 0 && | 135 if (strlen(FLAG_stop_at) > 0 && |
| 136 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 136 info_->literal()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 137 __ int3(); | 137 __ int3(); |
| 138 } | 138 } |
| 139 #endif | 139 #endif |
| 140 | 140 |
| 141 // Sloppy mode functions and builtins need to replace the receiver with the | |
| 142 // global proxy when called as functions (without an explicit receiver | |
| 143 // object). | |
| 144 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | |
| 145 Label ok; | |
| 146 // +1 for return address. | |
| 147 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; | |
| 148 __ mov(ecx, Operand(esp, receiver_offset)); | |
| 149 | |
| 150 __ cmp(ecx, isolate()->factory()->undefined_value()); | |
| 151 __ j(not_equal, &ok, Label::kNear); | |
| 152 | |
| 153 __ mov(ecx, GlobalObjectOperand()); | |
| 154 __ mov(ecx, FieldOperand(ecx, JSGlobalObject::kGlobalProxyOffset)); | |
| 155 | |
| 156 __ mov(Operand(esp, receiver_offset), ecx); | |
| 157 | |
| 158 __ bind(&ok); | |
| 159 } | |
| 160 | |
| 161 if (support_aligned_spilled_doubles_ && dynamic_frame_alignment_) { | 141 if (support_aligned_spilled_doubles_ && dynamic_frame_alignment_) { |
| 162 // Move state of dynamic frame alignment into edx. | 142 // Move state of dynamic frame alignment into edx. |
| 163 __ Move(edx, Immediate(kNoAlignmentPadding)); | 143 __ Move(edx, Immediate(kNoAlignmentPadding)); |
| 164 | 144 |
| 165 Label do_not_pad, align_loop; | 145 Label do_not_pad, align_loop; |
| 166 STATIC_ASSERT(kDoubleSize == 2 * kPointerSize); | 146 STATIC_ASSERT(kDoubleSize == 2 * kPointerSize); |
| 167 // Align esp + 4 to a multiple of 2 * kPointerSize. | 147 // Align esp + 4 to a multiple of 2 * kPointerSize. |
| 168 __ test(esp, Immediate(kPointerSize)); | 148 __ test(esp, Immediate(kPointerSize)); |
| 169 __ j(not_zero, &do_not_pad, Label::kNear); | 149 __ j(not_zero, &do_not_pad, Label::kNear); |
| 170 __ push(Immediate(0)); | 150 __ push(Immediate(0)); |
| (...skipping 5498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5669 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5649 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5670 } | 5650 } |
| 5671 | 5651 |
| 5672 | 5652 |
| 5673 #undef __ | 5653 #undef __ |
| 5674 | 5654 |
| 5675 } // namespace internal | 5655 } // namespace internal |
| 5676 } // namespace v8 | 5656 } // namespace v8 |
| 5677 | 5657 |
| 5678 #endif // V8_TARGET_ARCH_IA32 | 5658 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |