Index: src/ia32/codegen-ia32.cc |
=================================================================== |
--- src/ia32/codegen-ia32.cc (revision 2285) |
+++ src/ia32/codegen-ia32.cc (working copy) |
@@ -4987,6 +4987,29 @@ |
} |
+void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { |
+ ASSERT(args->length() == 0); |
+ |
+ // Get the frame pointer for the calling frame. |
+ Result fp = allocator()->Allocate(); |
+ __ mov(fp.reg(), Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
+ |
+ // Skip the arguments adaptor frame if it exists. |
+ Label check_frame_marker; |
+ __ cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset), |
+ Immediate(ArgumentsAdaptorFrame::SENTINEL)); |
+ __ j(not_equal, &check_frame_marker); |
+ __ mov(fp.reg(), Operand(fp.reg(), StandardFrameConstants::kCallerFPOffset)); |
+ |
+ // Check the marker in the calling frame. |
+ __ bind(&check_frame_marker); |
+ __ cmp(Operand(fp.reg(), StandardFrameConstants::kMarkerOffset), |
+ Immediate(Smi::FromInt(StackFrame::CONSTRUCT))); |
+ fp.Unuse(); |
+ destination()->Split(equal); |
+} |
+ |
+ |
void CodeGenerator::GenerateArgumentsLength(ZoneList<Expression*>* args) { |
ASSERT(args->length() == 0); |
// ArgumentsAccessStub takes the parameter count as an input argument |