| 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 5670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5681 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 5681 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 5682 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 5682 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
| 5683 isolate); | 5683 isolate); |
| 5684 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 5684 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
| 5685 isolate); | 5685 isolate); |
| 5686 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( | 5686 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
| 5687 isolate); | 5687 isolate); |
| 5688 } | 5688 } |
| 5689 | 5689 |
| 5690 | 5690 |
| 5691 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( | |
| 5692 Isolate* isolate) { | |
| 5693 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; | |
| 5694 for (int i = 0; i < 2; i++) { | |
| 5695 // For internal arrays we only need a few things | |
| 5696 InternalArrayNoArgumentConstructorStub stubh1(kinds[i]); | |
| 5697 stubh1.GetCode(isolate)->set_is_pregenerated(true); | |
| 5698 InternalArraySingleArgumentConstructorStub stubh2(kinds[i]); | |
| 5699 stubh2.GetCode(isolate)->set_is_pregenerated(true); | |
| 5700 InternalArrayNArgumentsConstructorStub stubh3(kinds[i]); | |
| 5701 stubh3.GetCode(isolate)->set_is_pregenerated(true); | |
| 5702 } | |
| 5703 } | |
| 5704 | |
| 5705 | |
| 5706 void ArrayConstructorStub::GenerateDispatchToArrayStub( | 5691 void ArrayConstructorStub::GenerateDispatchToArrayStub( |
| 5707 MacroAssembler* masm, | 5692 MacroAssembler* masm, |
| 5708 AllocationSiteOverrideMode mode) { | 5693 AllocationSiteOverrideMode mode) { |
| 5709 if (argument_count_ == ANY) { | 5694 if (argument_count_ == ANY) { |
| 5710 Label not_zero_case, not_one_case; | 5695 Label not_zero_case, not_one_case; |
| 5711 __ testq(rax, rax); | 5696 __ testq(rax, rax); |
| 5712 __ j(not_zero, ¬_zero_case); | 5697 __ j(not_zero, ¬_zero_case); |
| 5713 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); | 5698 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); |
| 5714 | 5699 |
| 5715 __ bind(¬_zero_case); | 5700 __ bind(¬_zero_case); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5856 __ movzxbq(rcx, FieldOperand(rcx, Map::kBitField2Offset)); | 5841 __ movzxbq(rcx, FieldOperand(rcx, Map::kBitField2Offset)); |
| 5857 // Retrieve elements_kind from bit field 2. | 5842 // Retrieve elements_kind from bit field 2. |
| 5858 __ and_(rcx, Immediate(Map::kElementsKindMask)); | 5843 __ and_(rcx, Immediate(Map::kElementsKindMask)); |
| 5859 __ shr(rcx, Immediate(Map::kElementsKindShift)); | 5844 __ shr(rcx, Immediate(Map::kElementsKindShift)); |
| 5860 | 5845 |
| 5861 if (FLAG_debug_code) { | 5846 if (FLAG_debug_code) { |
| 5862 Label done; | 5847 Label done; |
| 5863 __ cmpl(rcx, Immediate(FAST_ELEMENTS)); | 5848 __ cmpl(rcx, Immediate(FAST_ELEMENTS)); |
| 5864 __ j(equal, &done); | 5849 __ j(equal, &done); |
| 5865 __ cmpl(rcx, Immediate(FAST_HOLEY_ELEMENTS)); | 5850 __ cmpl(rcx, Immediate(FAST_HOLEY_ELEMENTS)); |
| 5851 __ j(equal, &done); |
| 5852 __ cmpl(rcx, Immediate(FAST_DOUBLE_ELEMENTS)); |
| 5866 __ Assert(equal, | 5853 __ Assert(equal, |
| 5867 kInvalidElementsKindForInternalArrayOrInternalPackedArray); | 5854 kInvalidElementsKindForInternalArrayOrInternalPackedArray); |
| 5868 __ bind(&done); | 5855 __ bind(&done); |
| 5869 } | 5856 } |
| 5870 | 5857 |
| 5871 Label fast_elements_case; | 5858 Label fast_elements_case, fast_holey_elements_case; |
| 5872 __ cmpl(rcx, Immediate(FAST_ELEMENTS)); | 5859 __ cmpl(rcx, Immediate(FAST_ELEMENTS)); |
| 5873 __ j(equal, &fast_elements_case); | 5860 __ j(equal, &fast_elements_case); |
| 5861 __ cmpl(rcx, Immediate(FAST_HOLEY_ELEMENTS)); |
| 5862 __ j(equal, &fast_holey_elements_case); |
| 5863 |
| 5864 GenerateCase(masm, FAST_DOUBLE_ELEMENTS); |
| 5865 |
| 5866 __ bind(&fast_holey_elements_case); |
| 5874 GenerateCase(masm, FAST_HOLEY_ELEMENTS); | 5867 GenerateCase(masm, FAST_HOLEY_ELEMENTS); |
| 5875 | 5868 |
| 5876 __ bind(&fast_elements_case); | 5869 __ bind(&fast_elements_case); |
| 5877 GenerateCase(masm, FAST_ELEMENTS); | 5870 GenerateCase(masm, FAST_ELEMENTS); |
| 5878 } | 5871 } |
| 5879 | 5872 |
| 5880 | 5873 |
| 5881 #undef __ | 5874 #undef __ |
| 5882 | 5875 |
| 5883 } } // namespace v8::internal | 5876 } } // namespace v8::internal |
| 5884 | 5877 |
| 5885 #endif // V8_TARGET_ARCH_X64 | 5878 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |