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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 5837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5848 #undef SIMD128_TYPE | 5848 #undef SIMD128_TYPE |
5849 // clang-format on | 5849 // clang-format on |
5850 | 5850 |
5851 } else { | 5851 } else { |
5852 __ jmp(false_label, false_distance); | 5852 __ jmp(false_label, false_distance); |
5853 } | 5853 } |
5854 return final_branch_condition; | 5854 return final_branch_condition; |
5855 } | 5855 } |
5856 | 5856 |
5857 | 5857 |
5858 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | |
5859 Register temp = ToRegister(instr->temp()); | |
5860 | |
5861 EmitIsConstructCall(temp); | |
5862 EmitBranch(instr, equal); | |
5863 } | |
5864 | |
5865 | |
5866 void LCodeGen::EmitIsConstructCall(Register temp) { | |
5867 // Get the frame pointer for the calling frame. | |
5868 __ mov(temp, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | |
5869 | |
5870 // Skip the arguments adaptor frame if it exists. | |
5871 Label check_frame_marker; | |
5872 __ cmp(Operand(temp, StandardFrameConstants::kContextOffset), | |
5873 Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
5874 __ j(not_equal, &check_frame_marker, Label::kNear); | |
5875 __ mov(temp, Operand(temp, StandardFrameConstants::kCallerFPOffset)); | |
5876 | |
5877 // Check the marker in the calling frame. | |
5878 __ bind(&check_frame_marker); | |
5879 __ cmp(Operand(temp, StandardFrameConstants::kMarkerOffset), | |
5880 Immediate(Smi::FromInt(StackFrame::CONSTRUCT))); | |
5881 } | |
5882 | |
5883 | |
5884 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5858 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5885 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5859 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
5886 // Ensure that we have enough space after the previous lazy-bailout | 5860 // Ensure that we have enough space after the previous lazy-bailout |
5887 // instruction for patching the code here. | 5861 // instruction for patching the code here. |
5888 int current_pc = masm()->pc_offset(); | 5862 int current_pc = masm()->pc_offset(); |
5889 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5863 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
5890 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5864 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
5891 __ Nop(padding_size); | 5865 __ Nop(padding_size); |
5892 } | 5866 } |
5893 } | 5867 } |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6149 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6123 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6150 } | 6124 } |
6151 | 6125 |
6152 | 6126 |
6153 #undef __ | 6127 #undef __ |
6154 | 6128 |
6155 } // namespace internal | 6129 } // namespace internal |
6156 } // namespace v8 | 6130 } // namespace v8 |
6157 | 6131 |
6158 #endif // V8_TARGET_ARCH_X87 | 6132 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |