Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
| index 855ed461b584e45c28256128a0d19c1da37dc0c2..da83b3686b96e016091acbccca468411fb15bd02 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -3778,6 +3778,55 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label, |
| } |
| +void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) { |
| + Register result = ToRegister(instr->result()); |
| + Register temp = ToRegister(instr->TempAt(0)); |
|
Mads Ager (chromium)
2011/02/08 07:09:44
Instead of allocating a temp here you could use sc
|
| + Label true_label; |
| + Label false_label; |
| + Label done; |
| + |
| + EmitIsConstructCall(result, temp); |
| + __ b(eq, &true_label); |
| + |
| + __ LoadRoot(result, Heap::kFalseValueRootIndex); |
| + __ b(&done); |
| + |
| + __ bind(&true_label); |
| + __ LoadRoot(result, Heap::kTrueValueRootIndex); |
| + |
| + __ bind(&done); |
| +} |
| + |
| + |
| +void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
| + Register temp1 = ToRegister(instr->TempAt(0)); |
| + Register temp2 = ToRegister(instr->TempAt(1)); |
|
Mads Ager (chromium)
2011/02/08 07:09:44
Could use scratch0().
|
| + int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| + int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| + |
| + EmitIsConstructCall(temp1, temp2); |
| + EmitBranch(true_block, false_block, eq); |
| +} |
| + |
| + |
| +void LCodeGen::EmitIsConstructCall(Register temp1, Register temp2) { |
| + // Get the frame pointer for the calling frame. |
| + __ ldr(temp1, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| + |
| + // Skip the arguments adaptor frame if it exists. |
| + Label check_frame_marker; |
| + __ ldr(temp2, MemOperand(temp1, StandardFrameConstants::kContextOffset)); |
| + __ cmp(temp2, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| + __ b(ne, &check_frame_marker); |
| + __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kCallerFPOffset)); |
| + |
| + // Check the marker in the calling frame. |
| + __ bind(&check_frame_marker); |
| + __ ldr(temp1, MemOperand(temp1, StandardFrameConstants::kMarkerOffset)); |
| + __ cmp(temp1, Operand(Smi::FromInt(StackFrame::CONSTRUCT))); |
| +} |
| + |
| + |
| void LCodeGen::DoLazyBailout(LLazyBailout* instr) { |
| // No code for lazy bailout instruction. Used to capture environment after a |
| // call for populating the safepoint data with deoptimization data. |