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 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3951 } | 3951 } |
3952 | 3952 |
3953 | 3953 |
3954 void LCodeGen::DoCallNew(LCallNew* instr) { | 3954 void LCodeGen::DoCallNew(LCallNew* instr) { |
3955 ASSERT(ToRegister(instr->context()).is(cp)); | 3955 ASSERT(ToRegister(instr->context()).is(cp)); |
3956 ASSERT(ToRegister(instr->constructor()).is(r1)); | 3956 ASSERT(ToRegister(instr->constructor()).is(r1)); |
3957 ASSERT(ToRegister(instr->result()).is(r0)); | 3957 ASSERT(ToRegister(instr->result()).is(r0)); |
3958 | 3958 |
3959 __ mov(r0, Operand(instr->arity())); | 3959 __ mov(r0, Operand(instr->arity())); |
3960 // No cell in r2 for construct type feedback in optimized code | 3960 // No cell in r2 for construct type feedback in optimized code |
3961 Handle<Object> undefined_value(isolate()->factory()->undefined_value()); | 3961 Handle<Object> megamorphic_symbol = |
3962 __ mov(r2, Operand(undefined_value)); | 3962 TypeFeedbackInfo::MegamorphicSentinel(isolate()); |
| 3963 __ mov(r2, Operand(megamorphic_symbol)); |
3963 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 3964 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
3964 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3965 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3965 } | 3966 } |
3966 | 3967 |
3967 | 3968 |
3968 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3969 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3969 ASSERT(ToRegister(instr->context()).is(cp)); | 3970 ASSERT(ToRegister(instr->context()).is(cp)); |
3970 ASSERT(ToRegister(instr->constructor()).is(r1)); | 3971 ASSERT(ToRegister(instr->constructor()).is(r1)); |
3971 ASSERT(ToRegister(instr->result()).is(r0)); | 3972 ASSERT(ToRegister(instr->result()).is(r0)); |
3972 | 3973 |
3973 __ mov(r0, Operand(instr->arity())); | 3974 __ mov(r0, Operand(instr->arity())); |
3974 __ mov(r2, Operand(factory()->undefined_value())); | 3975 __ mov(r2, Operand(TypeFeedbackInfo::MegamorphicSentinel(isolate()))); |
3975 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3976 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3976 AllocationSiteOverrideMode override_mode = | 3977 AllocationSiteOverrideMode override_mode = |
3977 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3978 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3978 ? DISABLE_ALLOCATION_SITES | 3979 ? DISABLE_ALLOCATION_SITES |
3979 : DONT_OVERRIDE; | 3980 : DONT_OVERRIDE; |
3980 | 3981 |
3981 if (instr->arity() == 0) { | 3982 if (instr->arity() == 0) { |
3982 ArrayNoArgumentConstructorStub stub(kind, override_mode); | 3983 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
3983 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3984 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3984 } else if (instr->arity() == 1) { | 3985 } else if (instr->arity() == 1) { |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5746 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5747 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5747 __ ldr(result, FieldMemOperand(scratch, | 5748 __ ldr(result, FieldMemOperand(scratch, |
5748 FixedArray::kHeaderSize - kPointerSize)); | 5749 FixedArray::kHeaderSize - kPointerSize)); |
5749 __ bind(&done); | 5750 __ bind(&done); |
5750 } | 5751 } |
5751 | 5752 |
5752 | 5753 |
5753 #undef __ | 5754 #undef __ |
5754 | 5755 |
5755 } } // namespace v8::internal | 5756 } } // namespace v8::internal |
OLD | NEW |