| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3775 } | 3775 } |
| 3776 | 3776 |
| 3777 | 3777 |
| 3778 void LCodeGen::DoCallNew(LCallNew* instr) { | 3778 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 3779 ASSERT(ToRegister(instr->context()).is(rsi)); | 3779 ASSERT(ToRegister(instr->context()).is(rsi)); |
| 3780 ASSERT(ToRegister(instr->constructor()).is(rdi)); | 3780 ASSERT(ToRegister(instr->constructor()).is(rdi)); |
| 3781 ASSERT(ToRegister(instr->result()).is(rax)); | 3781 ASSERT(ToRegister(instr->result()).is(rax)); |
| 3782 | 3782 |
| 3783 __ Set(rax, instr->arity()); | 3783 __ Set(rax, instr->arity()); |
| 3784 // No cell in ebx for construct type feedback in optimized code | 3784 // No cell in ebx for construct type feedback in optimized code |
| 3785 Handle<Object> undefined_value(isolate()->factory()->undefined_value()); | 3785 Handle<Object> megamorphic_symbol = |
| 3786 __ Move(rbx, undefined_value); | 3786 TypeFeedbackInfo::MegamorphicSentinel(isolate()); |
| 3787 __ Move(rbx, megamorphic_symbol); |
| 3787 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 3788 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
| 3788 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3789 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3789 } | 3790 } |
| 3790 | 3791 |
| 3791 | 3792 |
| 3792 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3793 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3793 ASSERT(ToRegister(instr->context()).is(rsi)); | 3794 ASSERT(ToRegister(instr->context()).is(rsi)); |
| 3794 ASSERT(ToRegister(instr->constructor()).is(rdi)); | 3795 ASSERT(ToRegister(instr->constructor()).is(rdi)); |
| 3795 ASSERT(ToRegister(instr->result()).is(rax)); | 3796 ASSERT(ToRegister(instr->result()).is(rax)); |
| 3796 | 3797 |
| 3797 __ Set(rax, instr->arity()); | 3798 __ Set(rax, instr->arity()); |
| 3798 __ Move(rbx, factory()->undefined_value()); | 3799 __ Move(rbx, TypeFeedbackInfo::MegamorphicSentinel(isolate())); |
| 3799 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3800 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3800 AllocationSiteOverrideMode override_mode = | 3801 AllocationSiteOverrideMode override_mode = |
| 3801 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3802 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 3802 ? DISABLE_ALLOCATION_SITES | 3803 ? DISABLE_ALLOCATION_SITES |
| 3803 : DONT_OVERRIDE; | 3804 : DONT_OVERRIDE; |
| 3804 | 3805 |
| 3805 if (instr->arity() == 0) { | 3806 if (instr->arity() == 0) { |
| 3806 ArrayNoArgumentConstructorStub stub(kind, override_mode); | 3807 ArrayNoArgumentConstructorStub stub(kind, override_mode); |
| 3807 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3808 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3808 } else if (instr->arity() == 1) { | 3809 } else if (instr->arity() == 1) { |
| (...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5582 FixedArray::kHeaderSize - kPointerSize)); | 5583 FixedArray::kHeaderSize - kPointerSize)); |
| 5583 __ bind(&done); | 5584 __ bind(&done); |
| 5584 } | 5585 } |
| 5585 | 5586 |
| 5586 | 5587 |
| 5587 #undef __ | 5588 #undef __ |
| 5588 | 5589 |
| 5589 } } // namespace v8::internal | 5590 } } // namespace v8::internal |
| 5590 | 5591 |
| 5591 #endif // V8_TARGET_ARCH_X64 | 5592 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |