OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
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 4969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4980 Result temp = allocator()->Allocate(); | 4980 Result temp = allocator()->Allocate(); |
4981 ASSERT(temp.is_valid()); | 4981 ASSERT(temp.is_valid()); |
4982 // Check if the object is a JS array or not. | 4982 // Check if the object is a JS array or not. |
4983 __ CmpObjectType(value.reg(), JS_ARRAY_TYPE, temp.reg()); | 4983 __ CmpObjectType(value.reg(), JS_ARRAY_TYPE, temp.reg()); |
4984 value.Unuse(); | 4984 value.Unuse(); |
4985 temp.Unuse(); | 4985 temp.Unuse(); |
4986 destination()->Split(equal); | 4986 destination()->Split(equal); |
4987 } | 4987 } |
4988 | 4988 |
4989 | 4989 |
| 4990 void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { |
| 4991 ASSERT(args->length() == 0); |
| 4992 |
| 4993 // Get the frame pointer for the calling frame. |
| 4994 Result fp = allocator()->Allocate(); |
| 4995 __ mov(fp.reg(), Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 4996 |
| 4997 // Skip the arguments adaptor frame if it exists. |
| 4998 Label check_frame_marker; |
| 4999 __ cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset), |
| 5000 Immediate(ArgumentsAdaptorFrame::SENTINEL)); |
| 5001 __ j(not_equal, &check_frame_marker); |
| 5002 __ mov(fp.reg(), Operand(fp.reg(), StandardFrameConstants::kCallerFPOffset)); |
| 5003 |
| 5004 // Check the marker in the calling frame. |
| 5005 __ bind(&check_frame_marker); |
| 5006 __ cmp(Operand(fp.reg(), StandardFrameConstants::kMarkerOffset), |
| 5007 Immediate(Smi::FromInt(StackFrame::CONSTRUCT))); |
| 5008 fp.Unuse(); |
| 5009 destination()->Split(equal); |
| 5010 } |
| 5011 |
| 5012 |
4990 void CodeGenerator::GenerateArgumentsLength(ZoneList<Expression*>* args) { | 5013 void CodeGenerator::GenerateArgumentsLength(ZoneList<Expression*>* args) { |
4991 ASSERT(args->length() == 0); | 5014 ASSERT(args->length() == 0); |
4992 // ArgumentsAccessStub takes the parameter count as an input argument | 5015 // ArgumentsAccessStub takes the parameter count as an input argument |
4993 // in register eax. Create a constant result for it. | 5016 // in register eax. Create a constant result for it. |
4994 Result count(Handle<Smi>(Smi::FromInt(scope_->num_parameters()))); | 5017 Result count(Handle<Smi>(Smi::FromInt(scope_->num_parameters()))); |
4995 // Call the shared stub to get to the arguments.length. | 5018 // Call the shared stub to get to the arguments.length. |
4996 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_LENGTH); | 5019 ArgumentsAccessStub stub(ArgumentsAccessStub::READ_LENGTH); |
4997 Result result = frame_->CallStub(&stub, &count); | 5020 Result result = frame_->CallStub(&stub, &count); |
4998 frame_->Push(&result); | 5021 frame_->Push(&result); |
4999 } | 5022 } |
(...skipping 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7852 | 7875 |
7853 // Slow-case: Go through the JavaScript implementation. | 7876 // Slow-case: Go through the JavaScript implementation. |
7854 __ bind(&slow); | 7877 __ bind(&slow); |
7855 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7878 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
7856 } | 7879 } |
7857 | 7880 |
7858 | 7881 |
7859 #undef __ | 7882 #undef __ |
7860 | 7883 |
7861 } } // namespace v8::internal | 7884 } } // namespace v8::internal |
OLD | NEW |