| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 5481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5492 // clang-format on | 5492 // clang-format on |
| 5493 | 5493 |
| 5494 } else { | 5494 } else { |
| 5495 __ jmp(false_label, false_distance); | 5495 __ jmp(false_label, false_distance); |
| 5496 } | 5496 } |
| 5497 | 5497 |
| 5498 return final_branch_condition; | 5498 return final_branch_condition; |
| 5499 } | 5499 } |
| 5500 | 5500 |
| 5501 | 5501 |
| 5502 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | |
| 5503 Register temp = ToRegister(instr->temp()); | |
| 5504 | |
| 5505 EmitIsConstructCall(temp); | |
| 5506 EmitBranch(instr, equal); | |
| 5507 } | |
| 5508 | |
| 5509 | |
| 5510 void LCodeGen::EmitIsConstructCall(Register temp) { | |
| 5511 // Get the frame pointer for the calling frame. | |
| 5512 __ movp(temp, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | |
| 5513 | |
| 5514 // Skip the arguments adaptor frame if it exists. | |
| 5515 Label check_frame_marker; | |
| 5516 __ Cmp(Operand(temp, StandardFrameConstants::kContextOffset), | |
| 5517 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
| 5518 __ j(not_equal, &check_frame_marker, Label::kNear); | |
| 5519 __ movp(temp, Operand(temp, StandardFrameConstants::kCallerFPOffset)); | |
| 5520 | |
| 5521 // Check the marker in the calling frame. | |
| 5522 __ bind(&check_frame_marker); | |
| 5523 __ Cmp(Operand(temp, StandardFrameConstants::kMarkerOffset), | |
| 5524 Smi::FromInt(StackFrame::CONSTRUCT)); | |
| 5525 } | |
| 5526 | |
| 5527 | |
| 5528 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5502 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 5529 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5503 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 5530 // Ensure that we have enough space after the previous lazy-bailout | 5504 // Ensure that we have enough space after the previous lazy-bailout |
| 5531 // instruction for patching the code here. | 5505 // instruction for patching the code here. |
| 5532 int current_pc = masm()->pc_offset(); | 5506 int current_pc = masm()->pc_offset(); |
| 5533 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5507 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 5534 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5508 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 5535 __ Nop(padding_size); | 5509 __ Nop(padding_size); |
| 5536 } | 5510 } |
| 5537 } | 5511 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5788 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5762 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5789 } | 5763 } |
| 5790 | 5764 |
| 5791 | 5765 |
| 5792 #undef __ | 5766 #undef __ |
| 5793 | 5767 |
| 5794 } // namespace internal | 5768 } // namespace internal |
| 5795 } // namespace v8 | 5769 } // namespace v8 |
| 5796 | 5770 |
| 5797 #endif // V8_TARGET_ARCH_X64 | 5771 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |