Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index b370c5520dd6b11d29a105dfde921d7416463bb2..9b4f63d259d75247cc3a751d0253b87dcc98b513 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -2249,6 +2249,54 @@ void LCodeGen::DoTypeofIs(LTypeofIs* instr) { |
} |
+void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) { |
+ Register result = ToRegister(instr->result()); |
+ Label true_label; |
Mads Ager (chromium)
2011/02/08 07:09:44
NearLabel?
|
+ Label false_label; |
+ NearLabel done; |
+ |
+ EmitIsConstructCall(result); |
+ __ j(equal, &true_label); |
+ |
+ __ LoadRoot(result, Heap::kFalseValueRootIndex); |
+ __ jmp(&done); |
+ |
+ __ bind(&true_label); |
+ __ LoadRoot(result, Heap::kTrueValueRootIndex); |
+ |
+ |
+ __ bind(&done); |
+} |
+ |
+ |
+void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) { |
+ Register temp = ToRegister(instr->TempAt(0)); |
+ int true_block = chunk_->LookupDestination(instr->true_block_id()); |
+ int false_block = chunk_->LookupDestination(instr->false_block_id()); |
+ |
+ EmitIsConstructCall(temp); |
+ EmitBranch(true_block, false_block, equal); |
+} |
+ |
+ |
+void LCodeGen::EmitIsConstructCall(Register temp) { |
+ // Get the frame pointer for the calling frame. |
+ __ movq(temp, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
+ |
+ // Skip the arguments adaptor frame if it exists. |
+ Label check_frame_marker; |
+ __ SmiCompare(Operand(temp, StandardFrameConstants::kContextOffset), |
+ Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
+ __ j(not_equal, &check_frame_marker); |
+ __ movq(temp, Operand(rax, StandardFrameConstants::kCallerFPOffset)); |
+ |
+ // Check the marker in the calling frame. |
+ __ bind(&check_frame_marker); |
+ __ SmiCompare(Operand(temp, StandardFrameConstants::kMarkerOffset), |
+ Smi::FromInt(StackFrame::CONSTRUCT)); |
+} |
+ |
+ |
void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
Register input = ToRegister(instr->InputAt(0)); |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |