| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 5683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5694 // clang-format on | 5694 // clang-format on |
| 5695 | 5695 |
| 5696 } else { | 5696 } else { |
| 5697 __ b(false_label); | 5697 __ b(false_label); |
| 5698 } | 5698 } |
| 5699 | 5699 |
| 5700 return final_branch_condition; | 5700 return final_branch_condition; |
| 5701 } | 5701 } |
| 5702 | 5702 |
| 5703 | 5703 |
| 5704 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | |
| 5705 Register temp1 = ToRegister(instr->temp()); | |
| 5706 | |
| 5707 EmitIsConstructCall(temp1, scratch0()); | |
| 5708 EmitBranch(instr, eq); | |
| 5709 } | |
| 5710 | |
| 5711 | |
| 5712 void LCodeGen::EmitIsConstructCall(Register temp1, Register temp2) { | |
| 5713 DCHECK(!temp1.is(temp2)); | |
| 5714 // Get the frame pointer for the calling frame. | |
| 5715 __ LoadP(temp1, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
| 5716 | |
| 5717 // Skip the arguments adaptor frame if it exists. | |
| 5718 Label check_frame_marker; | |
| 5719 __ LoadP(temp2, MemOperand(temp1, StandardFrameConstants::kContextOffset)); | |
| 5720 __ CmpSmiLiteral(temp2, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR), r0); | |
| 5721 __ bne(&check_frame_marker); | |
| 5722 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); | |
| 5723 | |
| 5724 // Check the marker in the calling frame. | |
| 5725 __ bind(&check_frame_marker); | |
| 5726 __ LoadP(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | |
| 5727 __ CmpSmiLiteral(temp1, Smi::FromInt(StackFrame::CONSTRUCT), r0); | |
| 5728 } | |
| 5729 | |
| 5730 | |
| 5731 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5704 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
| 5732 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5705 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
| 5733 // Ensure that we have enough space after the previous lazy-bailout | 5706 // Ensure that we have enough space after the previous lazy-bailout |
| 5734 // instruction for patching the code here. | 5707 // instruction for patching the code here. |
| 5735 int current_pc = masm()->pc_offset(); | 5708 int current_pc = masm()->pc_offset(); |
| 5736 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5709 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
| 5737 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5710 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 5738 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5711 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
| 5739 while (padding_size > 0) { | 5712 while (padding_size > 0) { |
| 5740 __ nop(); | 5713 __ nop(); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5993 __ Push(scope_info); | 5966 __ Push(scope_info); |
| 5994 __ push(ToRegister(instr->function())); | 5967 __ push(ToRegister(instr->function())); |
| 5995 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5968 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5996 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5969 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5997 } | 5970 } |
| 5998 | 5971 |
| 5999 | 5972 |
| 6000 #undef __ | 5973 #undef __ |
| 6001 } // namespace internal | 5974 } // namespace internal |
| 6002 } // namespace v8 | 5975 } // namespace v8 |
| OLD | NEW |