OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 5443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5454 } else { | 5454 } else { |
5455 *cmp1 = at; | 5455 *cmp1 = at; |
5456 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5456 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5457 __ Branch(false_label); | 5457 __ Branch(false_label); |
5458 } | 5458 } |
5459 | 5459 |
5460 return final_branch_condition; | 5460 return final_branch_condition; |
5461 } | 5461 } |
5462 | 5462 |
5463 | 5463 |
5464 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { | |
5465 Register temp1 = ToRegister(instr->temp()); | |
5466 | |
5467 EmitIsConstructCall(temp1, scratch0()); | |
5468 | |
5469 EmitBranch(instr, eq, temp1, | |
5470 Operand(Smi::FromInt(StackFrame::CONSTRUCT))); | |
5471 } | |
5472 | |
5473 | |
5474 void LCodeGen::EmitIsConstructCall(Register temp1, Register temp2) { | |
5475 DCHECK(!temp1.is(temp2)); | |
5476 // Get the frame pointer for the calling frame. | |
5477 __ lw(temp1, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
5478 | |
5479 // Skip the arguments adaptor frame if it exists. | |
5480 Label check_frame_marker; | |
5481 __ lw(temp2, MemOperand(temp1, StandardFrameConstants::kContextOffset)); | |
5482 __ Branch(&check_frame_marker, ne, temp2, | |
5483 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
5484 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); | |
5485 | |
5486 // Check the marker in the calling frame. | |
5487 __ bind(&check_frame_marker); | |
5488 __ lw(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); | |
5489 } | |
5490 | |
5491 | |
5492 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { | 5464 void LCodeGen::EnsureSpaceForLazyDeopt(int space_needed) { |
5493 if (info()->ShouldEnsureSpaceForLazyDeopt()) { | 5465 if (info()->ShouldEnsureSpaceForLazyDeopt()) { |
5494 // Ensure that we have enough space after the previous lazy-bailout | 5466 // Ensure that we have enough space after the previous lazy-bailout |
5495 // instruction for patching the code here. | 5467 // instruction for patching the code here. |
5496 int current_pc = masm()->pc_offset(); | 5468 int current_pc = masm()->pc_offset(); |
5497 if (current_pc < last_lazy_deopt_pc_ + space_needed) { | 5469 if (current_pc < last_lazy_deopt_pc_ + space_needed) { |
5498 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 5470 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
5499 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); | 5471 DCHECK_EQ(0, padding_size % Assembler::kInstrSize); |
5500 while (padding_size > 0) { | 5472 while (padding_size > 0) { |
5501 __ nop(); | 5473 __ nop(); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5762 __ Push(at, ToRegister(instr->function())); | 5734 __ Push(at, ToRegister(instr->function())); |
5763 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5735 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5764 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5736 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5765 } | 5737 } |
5766 | 5738 |
5767 | 5739 |
5768 #undef __ | 5740 #undef __ |
5769 | 5741 |
5770 } // namespace internal | 5742 } // namespace internal |
5771 } // namespace v8 | 5743 } // namespace v8 |
OLD | NEW |