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 7144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7155 { a3, a1, a2, EMIT_REMEMBERED_SET }, | 7155 { a3, a1, a2, EMIT_REMEMBERED_SET }, |
7156 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 7156 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
7157 { t0, a2, a3, EMIT_REMEMBERED_SET }, | 7157 { t0, a2, a3, EMIT_REMEMBERED_SET }, |
7158 // ElementsTransitionGenerator::GenerateSmiOnlyToObject | 7158 // ElementsTransitionGenerator::GenerateSmiOnlyToObject |
7159 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble | 7159 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble |
7160 // and ElementsTransitionGenerator::GenerateDoubleToObject | 7160 // and ElementsTransitionGenerator::GenerateDoubleToObject |
7161 { a2, a3, t5, EMIT_REMEMBERED_SET }, | 7161 { a2, a3, t5, EMIT_REMEMBERED_SET }, |
7162 // ElementsTransitionGenerator::GenerateDoubleToObject | 7162 // ElementsTransitionGenerator::GenerateDoubleToObject |
7163 { t2, a2, a0, EMIT_REMEMBERED_SET }, | 7163 { t2, a2, a0, EMIT_REMEMBERED_SET }, |
7164 { a2, t2, t5, EMIT_REMEMBERED_SET }, | 7164 { a2, t2, t5, EMIT_REMEMBERED_SET }, |
| 7165 // StoreArrayLiteralElementStub::Generate |
| 7166 { t1, a0, t2, EMIT_REMEMBERED_SET }, |
7165 // Null termination. | 7167 // Null termination. |
7166 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} | 7168 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} |
7167 }; | 7169 }; |
7168 | 7170 |
7169 | 7171 |
7170 bool RecordWriteStub::IsPregenerated() { | 7172 bool RecordWriteStub::IsPregenerated() { |
7171 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; | 7173 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; |
7172 !entry->object.is(no_reg); | 7174 !entry->object.is(no_reg); |
7173 entry++) { | 7175 entry++) { |
7174 if (object_.is(entry->object) && | 7176 if (object_.is(entry->object) && |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7394 | 7396 |
7395 __ bind(&need_incremental_pop_scratch); | 7397 __ bind(&need_incremental_pop_scratch); |
7396 __ Pop(regs_.object(), regs_.address()); | 7398 __ Pop(regs_.object(), regs_.address()); |
7397 | 7399 |
7398 __ bind(&need_incremental); | 7400 __ bind(&need_incremental); |
7399 | 7401 |
7400 // Fall through when we need to inform the incremental marker. | 7402 // Fall through when we need to inform the incremental marker. |
7401 } | 7403 } |
7402 | 7404 |
7403 | 7405 |
| 7406 void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) { |
| 7407 // ----------- S t a t e ------------- |
| 7408 // -- a0 : element value to store |
| 7409 // -- a1 : array literal |
| 7410 // -- a2 : map of array literal |
| 7411 // -- a3 : element index as smi |
| 7412 // -- t0 : array literal index in function as smi |
| 7413 // ----------------------------------- |
| 7414 |
| 7415 Label element_done; |
| 7416 Label double_elements; |
| 7417 Label smi_element; |
| 7418 Label slow_elements; |
| 7419 Label fast_elements; |
| 7420 |
| 7421 __ CheckFastElements(a2, t1, &double_elements); |
| 7422 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS |
| 7423 __ JumpIfSmi(a0, &smi_element); |
| 7424 __ CheckFastSmiOnlyElements(a2, t1, &fast_elements); |
| 7425 |
| 7426 // Store into the array literal requires a elements transition. Call into |
| 7427 // the runtime. |
| 7428 __ bind(&slow_elements); |
| 7429 // call. |
| 7430 __ Push(a1, a3, a0); |
| 7431 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 7432 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset)); |
| 7433 __ Push(t1, t0); |
| 7434 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); |
| 7435 |
| 7436 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. |
| 7437 __ bind(&fast_elements); |
| 7438 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); |
| 7439 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); |
| 7440 __ Addu(t2, t1, t2); |
| 7441 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 7442 __ sw(a0, MemOperand(t2, 0)); |
| 7443 // Update the write barrier for the array store. |
| 7444 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs, |
| 7445 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
| 7446 __ Ret(); |
| 7447 |
| 7448 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or |
| 7449 // FAST_ELEMENTS, and value is Smi. |
| 7450 __ bind(&smi_element); |
| 7451 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); |
| 7452 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); |
| 7453 __ Addu(t2, t1, t2); |
| 7454 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize)); |
| 7455 __ Ret(); |
| 7456 |
| 7457 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
| 7458 __ bind(&double_elements); |
| 7459 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); |
| 7460 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, t6, |
| 7461 &slow_elements); |
| 7462 __ Ret(); |
| 7463 } |
| 7464 |
| 7465 |
7404 #undef __ | 7466 #undef __ |
7405 | 7467 |
7406 } } // namespace v8::internal | 7468 } } // namespace v8::internal |
7407 | 7469 |
7408 #endif // V8_TARGET_ARCH_MIPS | 7470 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |