OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3905 } | 3905 } |
3906 | 3906 |
3907 | 3907 |
3908 void LCodeGen::DoCallNew(LCallNew* instr) { | 3908 void LCodeGen::DoCallNew(LCallNew* instr) { |
3909 ASSERT(ToRegister(instr->context()).is(cp)); | 3909 ASSERT(ToRegister(instr->context()).is(cp)); |
3910 ASSERT(ToRegister(instr->constructor()).is(r1)); | 3910 ASSERT(ToRegister(instr->constructor()).is(r1)); |
3911 ASSERT(ToRegister(instr->result()).is(r0)); | 3911 ASSERT(ToRegister(instr->result()).is(r0)); |
3912 | 3912 |
3913 __ mov(r0, Operand(instr->arity())); | 3913 __ mov(r0, Operand(instr->arity())); |
3914 // No cell in r2 for construct type feedback in optimized code | 3914 // No cell in r2 for construct type feedback in optimized code |
3915 Handle<Object> megamorphic_symbol = | 3915 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
3916 TypeFeedbackInfo::MegamorphicSentinel(isolate()); | |
3917 __ mov(r2, Operand(megamorphic_symbol)); | |
3918 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 3916 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
3919 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3917 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3920 } | 3918 } |
3921 | 3919 |
3922 | 3920 |
3923 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3921 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3924 ASSERT(ToRegister(instr->context()).is(cp)); | 3922 ASSERT(ToRegister(instr->context()).is(cp)); |
3925 ASSERT(ToRegister(instr->constructor()).is(r1)); | 3923 ASSERT(ToRegister(instr->constructor()).is(r1)); |
3926 ASSERT(ToRegister(instr->result()).is(r0)); | 3924 ASSERT(ToRegister(instr->result()).is(r0)); |
3927 | 3925 |
3928 __ mov(r0, Operand(instr->arity())); | 3926 __ mov(r0, Operand(instr->arity())); |
3929 __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate()))); | 3927 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
3930 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3928 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3931 AllocationSiteOverrideMode override_mode = | 3929 AllocationSiteOverrideMode override_mode = |
3932 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3930 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3933 ? DISABLE_ALLOCATION_SITES | 3931 ? DISABLE_ALLOCATION_SITES |
3934 : DONT_OVERRIDE; | 3932 : DONT_OVERRIDE; |
3935 | 3933 |
3936 if (instr->arity() == 0) { | 3934 if (instr->arity() == 0) { |
3937 ArrayNoArgumentConstructorStub stub(kind, override_mode); | 3935 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
3938 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3936 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3939 } else if (instr->arity() == 1) { | 3937 } else if (instr->arity() == 1) { |
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5714 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5712 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5715 __ ldr(result, FieldMemOperand(scratch, | 5713 __ ldr(result, FieldMemOperand(scratch, |
5716 FixedArray::kHeaderSize - kPointerSize)); | 5714 FixedArray::kHeaderSize - kPointerSize)); |
5717 __ bind(&done); | 5715 __ bind(&done); |
5718 } | 5716 } |
5719 | 5717 |
5720 | 5718 |
5721 #undef __ | 5719 #undef __ |
5722 | 5720 |
5723 } } // namespace v8::internal | 5721 } } // namespace v8::internal |
OLD | NEW |