OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 6867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6878 { r3, r1, r2, EMIT_REMEMBERED_SET }, | 6878 { r3, r1, r2, EMIT_REMEMBERED_SET }, |
6879 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 6879 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
6880 { r4, r2, r3, EMIT_REMEMBERED_SET }, | 6880 { r4, r2, r3, EMIT_REMEMBERED_SET }, |
6881 // ElementsTransitionGenerator::GenerateSmiOnlyToObject | 6881 // ElementsTransitionGenerator::GenerateSmiOnlyToObject |
6882 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble | 6882 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble |
6883 // and ElementsTransitionGenerator::GenerateDoubleToObject | 6883 // and ElementsTransitionGenerator::GenerateDoubleToObject |
6884 { r2, r3, r9, EMIT_REMEMBERED_SET }, | 6884 { r2, r3, r9, EMIT_REMEMBERED_SET }, |
6885 // ElementsTransitionGenerator::GenerateDoubleToObject | 6885 // ElementsTransitionGenerator::GenerateDoubleToObject |
6886 { r6, r2, r0, EMIT_REMEMBERED_SET }, | 6886 { r6, r2, r0, EMIT_REMEMBERED_SET }, |
6887 { r2, r6, r9, EMIT_REMEMBERED_SET }, | 6887 { r2, r6, r9, EMIT_REMEMBERED_SET }, |
| 6888 // StoreArrayLiteralElementStub::Generate |
| 6889 { r5, r0, r6, EMIT_REMEMBERED_SET }, |
6888 // Null termination. | 6890 // Null termination. |
6889 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} | 6891 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} |
6890 }; | 6892 }; |
6891 | 6893 |
6892 | 6894 |
6893 bool RecordWriteStub::IsPregenerated() { | 6895 bool RecordWriteStub::IsPregenerated() { |
6894 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 6896 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
6895 !entry->object.is(no_reg); | 6897 !entry->object.is(no_reg); |
6896 entry++) { | 6898 entry++) { |
6897 if (object_.is(entry->object) && | 6899 if (object_.is(entry->object) && |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7114 } | 7116 } |
7115 | 7117 |
7116 __ bind(&need_incremental_pop_scratch); | 7118 __ bind(&need_incremental_pop_scratch); |
7117 __ Pop(regs_.object(), regs_.address()); | 7119 __ Pop(regs_.object(), regs_.address()); |
7118 | 7120 |
7119 __ bind(&need_incremental); | 7121 __ bind(&need_incremental); |
7120 | 7122 |
7121 // Fall through when we need to inform the incremental marker. | 7123 // Fall through when we need to inform the incremental marker. |
7122 } | 7124 } |
7123 | 7125 |
| 7126 |
| 7127 void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) { |
| 7128 // ----------- S t a t e ------------- |
| 7129 // -- r0 : element value to store |
| 7130 // -- r1 : array literal |
| 7131 // -- r2 : map of array literal |
| 7132 // -- r3 : element index as smi |
| 7133 // -- r4 : array literal index in function as smi |
| 7134 // ----------------------------------- |
| 7135 |
| 7136 Label element_done; |
| 7137 Label double_elements; |
| 7138 Label smi_element; |
| 7139 Label slow_elements; |
| 7140 Label fast_elements; |
| 7141 |
| 7142 __ CheckFastElements(r2, r5, &double_elements); |
| 7143 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS |
| 7144 __ JumpIfSmi(r0, &smi_element); |
| 7145 __ CheckFastSmiOnlyElements(r2, r5, &fast_elements); |
| 7146 |
| 7147 // Store into the array literal requires a elements transition. Call into |
| 7148 // the runtime. |
| 7149 __ bind(&slow_elements); |
| 7150 // call. |
| 7151 __ Push(r1, r3, r0); |
| 7152 __ ldr(r5, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 7153 __ ldr(r5, FieldMemOperand(r5, JSFunction::kLiteralsOffset)); |
| 7154 __ Push(r5, r4); |
| 7155 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); |
| 7156 |
| 7157 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. |
| 7158 __ bind(&fast_elements); |
| 7159 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
| 7160 __ add(r6, r5, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 7161 __ add(r6, r6, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 7162 __ str(r0, MemOperand(r6, 0)); |
| 7163 // Update the write barrier for the array store. |
| 7164 __ RecordWrite(r5, r6, r0, kLRHasNotBeenSaved, kDontSaveFPRegs, |
| 7165 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 7166 __ Ret(); |
| 7167 |
| 7168 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or |
| 7169 // FAST_ELEMENTS, and value is Smi. |
| 7170 __ bind(&smi_element); |
| 7171 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
| 7172 __ add(r6, r5, Operand(r3, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 7173 __ str(r0, FieldMemOperand(r6, FixedArray::kHeaderSize)); |
| 7174 __ Ret(); |
| 7175 |
| 7176 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
| 7177 __ bind(&double_elements); |
| 7178 __ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset)); |
| 7179 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, |
| 7180 &slow_elements); |
| 7181 __ Ret(); |
| 7182 } |
| 7183 |
7124 #undef __ | 7184 #undef __ |
7125 | 7185 |
7126 } } // namespace v8::internal | 7186 } } // namespace v8::internal |
7127 | 7187 |
7128 #endif // V8_TARGET_ARCH_ARM | 7188 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |