| 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 5934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5945 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { | 5945 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { |
| 5946 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( | 5946 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( |
| 5947 isolate); | 5947 isolate); |
| 5948 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( | 5948 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( |
| 5949 isolate); | 5949 isolate); |
| 5950 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( | 5950 ArrayConstructorStubAheadOfTimeHelper<ArrayNArgumentsConstructorStub>( |
| 5951 isolate); | 5951 isolate); |
| 5952 } | 5952 } |
| 5953 | 5953 |
| 5954 | 5954 |
| 5955 void InternalArrayConstructorStubBase::GenerateStubsAheadOfTime( | |
| 5956 Isolate* isolate) { | |
| 5957 ElementsKind kinds[2] = { FAST_ELEMENTS, FAST_HOLEY_ELEMENTS }; | |
| 5958 for (int i = 0; i < 2; i++) { | |
| 5959 // For internal arrays we only need a few things | |
| 5960 InternalArrayNoArgumentConstructorStub stubh1(kinds[i]); | |
| 5961 stubh1.GetCode(isolate)->set_is_pregenerated(true); | |
| 5962 InternalArraySingleArgumentConstructorStub stubh2(kinds[i]); | |
| 5963 stubh2.GetCode(isolate)->set_is_pregenerated(true); | |
| 5964 InternalArrayNArgumentsConstructorStub stubh3(kinds[i]); | |
| 5965 stubh3.GetCode(isolate)->set_is_pregenerated(true); | |
| 5966 } | |
| 5967 } | |
| 5968 | |
| 5969 | |
| 5970 void ArrayConstructorStub::GenerateDispatchToArrayStub( | 5955 void ArrayConstructorStub::GenerateDispatchToArrayStub( |
| 5971 MacroAssembler* masm, | 5956 MacroAssembler* masm, |
| 5972 AllocationSiteOverrideMode mode) { | 5957 AllocationSiteOverrideMode mode) { |
| 5973 if (argument_count_ == ANY) { | 5958 if (argument_count_ == ANY) { |
| 5974 Label not_zero_case, not_one_case; | 5959 Label not_zero_case, not_one_case; |
| 5975 __ tst(r0, r0); | 5960 __ tst(r0, r0); |
| 5976 __ b(ne, ¬_zero_case); | 5961 __ b(ne, ¬_zero_case); |
| 5977 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); | 5962 CreateArrayDispatch<ArrayNoArgumentConstructorStub>(masm, mode); |
| 5978 | 5963 |
| 5979 __ bind(¬_zero_case); | 5964 __ bind(¬_zero_case); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6112 // but the following bit field extraction takes care of that anyway. | 6097 // but the following bit field extraction takes care of that anyway. |
| 6113 __ ldr(r3, FieldMemOperand(r3, Map::kBitField2Offset)); | 6098 __ ldr(r3, FieldMemOperand(r3, Map::kBitField2Offset)); |
| 6114 // Retrieve elements_kind from bit field 2. | 6099 // Retrieve elements_kind from bit field 2. |
| 6115 __ Ubfx(r3, r3, Map::kElementsKindShift, Map::kElementsKindBitCount); | 6100 __ Ubfx(r3, r3, Map::kElementsKindShift, Map::kElementsKindBitCount); |
| 6116 | 6101 |
| 6117 if (FLAG_debug_code) { | 6102 if (FLAG_debug_code) { |
| 6118 Label done; | 6103 Label done; |
| 6119 __ cmp(r3, Operand(FAST_ELEMENTS)); | 6104 __ cmp(r3, Operand(FAST_ELEMENTS)); |
| 6120 __ b(eq, &done); | 6105 __ b(eq, &done); |
| 6121 __ cmp(r3, Operand(FAST_HOLEY_ELEMENTS)); | 6106 __ cmp(r3, Operand(FAST_HOLEY_ELEMENTS)); |
| 6107 __ b(eq, &done); |
| 6108 __ cmp(r3, Operand(FAST_DOUBLE_ELEMENTS)); |
| 6122 __ Assert(eq, | 6109 __ Assert(eq, |
| 6123 kInvalidElementsKindForInternalArrayOrInternalPackedArray); | 6110 kInvalidElementsKindForInternalArrayOrInternalPackedArray); |
| 6124 __ bind(&done); | 6111 __ bind(&done); |
| 6125 } | 6112 } |
| 6126 | 6113 |
| 6127 Label fast_elements_case; | 6114 Label fast_elements_case, fast_holey_elements_case; |
| 6128 __ cmp(r3, Operand(FAST_ELEMENTS)); | 6115 __ cmp(r3, Operand(FAST_ELEMENTS)); |
| 6129 __ b(eq, &fast_elements_case); | 6116 __ b(eq, &fast_elements_case); |
| 6117 __ cmp(r3, Operand(FAST_HOLEY_ELEMENTS)); |
| 6118 __ b(eq, &fast_holey_elements_case); |
| 6119 |
| 6120 GenerateCase(masm, FAST_DOUBLE_ELEMENTS); |
| 6121 |
| 6122 __ bind(&fast_holey_elements_case); |
| 6130 GenerateCase(masm, FAST_HOLEY_ELEMENTS); | 6123 GenerateCase(masm, FAST_HOLEY_ELEMENTS); |
| 6131 | 6124 |
| 6132 __ bind(&fast_elements_case); | 6125 __ bind(&fast_elements_case); |
| 6133 GenerateCase(masm, FAST_ELEMENTS); | 6126 GenerateCase(masm, FAST_ELEMENTS); |
| 6134 } | 6127 } |
| 6135 | 6128 |
| 6136 | 6129 |
| 6137 #undef __ | 6130 #undef __ |
| 6138 | 6131 |
| 6139 } } // namespace v8::internal | 6132 } } // namespace v8::internal |
| 6140 | 6133 |
| 6141 #endif // V8_TARGET_ARCH_ARM | 6134 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |