Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 10170030: Implement tracking and optimizations of packed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7344 matching lines...) Expand 10 before | Expand all | Expand 10 after
7355 { REG(t0), REG(a1), REG(a2), OMIT_REMEMBERED_SET }, 7355 { REG(t0), REG(a1), REG(a2), OMIT_REMEMBERED_SET },
7356 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. 7356 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField.
7357 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET }, 7357 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET },
7358 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET }, 7358 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET },
7359 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. 7359 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField.
7360 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET }, 7360 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET },
7361 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET }, 7361 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET },
7362 // KeyedStoreStubCompiler::GenerateStoreFastElement. 7362 // KeyedStoreStubCompiler::GenerateStoreFastElement.
7363 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET }, 7363 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET },
7364 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET }, 7364 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET },
7365 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 7365 // ElementsTransitionGenerator::GenerateMapChangeElementTransition
7366 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble 7366 // and ElementsTransitionGenerator::GenerateSmiToDouble
7367 // and ElementsTransitionGenerator::GenerateDoubleToObject 7367 // and ElementsTransitionGenerator::GenerateDoubleToObject
7368 { REG(a2), REG(a3), REG(t5), EMIT_REMEMBERED_SET }, 7368 { REG(a2), REG(a3), REG(t5), EMIT_REMEMBERED_SET },
7369 { REG(a2), REG(a3), REG(t5), OMIT_REMEMBERED_SET }, 7369 { REG(a2), REG(a3), REG(t5), OMIT_REMEMBERED_SET },
7370 // ElementsTransitionGenerator::GenerateDoubleToObject 7370 // ElementsTransitionGenerator::GenerateDoubleToObject
7371 { REG(t2), REG(a2), REG(a0), EMIT_REMEMBERED_SET }, 7371 { REG(t2), REG(a2), REG(a0), EMIT_REMEMBERED_SET },
7372 { REG(a2), REG(t2), REG(t5), EMIT_REMEMBERED_SET }, 7372 { REG(a2), REG(t2), REG(t5), EMIT_REMEMBERED_SET },
7373 // StoreArrayLiteralElementStub::Generate 7373 // StoreArrayLiteralElementStub::Generate
7374 { REG(t1), REG(a0), REG(t2), EMIT_REMEMBERED_SET }, 7374 { REG(t1), REG(a0), REG(t2), EMIT_REMEMBERED_SET },
7375 // Null termination. 7375 // Null termination.
7376 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} 7376 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET}
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
7622 // -- t0 : array literal index in function as smi 7622 // -- t0 : array literal index in function as smi
7623 // ----------------------------------- 7623 // -----------------------------------
7624 7624
7625 Label element_done; 7625 Label element_done;
7626 Label double_elements; 7626 Label double_elements;
7627 Label smi_element; 7627 Label smi_element;
7628 Label slow_elements; 7628 Label slow_elements;
7629 Label fast_elements; 7629 Label fast_elements;
7630 7630
7631 __ CheckFastElements(a2, t1, &double_elements); 7631 __ CheckFastElements(a2, t1, &double_elements);
7632 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS 7632 // Check for FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS elements
7633 __ JumpIfSmi(a0, &smi_element); 7633 __ JumpIfSmi(a0, &smi_element);
7634 __ CheckFastSmiOnlyElements(a2, t1, &fast_elements); 7634 __ CheckFastSmiElements(a2, t1, &fast_elements);
7635 7635
7636 // Store into the array literal requires a elements transition. Call into 7636 // Store into the array literal requires a elements transition. Call into
7637 // the runtime. 7637 // the runtime.
7638 __ bind(&slow_elements); 7638 __ bind(&slow_elements);
7639 // call. 7639 // call.
7640 __ Push(a1, a3, a0); 7640 __ Push(a1, a3, a0);
7641 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 7641 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
7642 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset)); 7642 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset));
7643 __ Push(t1, t0); 7643 __ Push(t1, t0);
7644 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); 7644 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1);
7645 7645
7646 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. 7646 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object.
7647 __ bind(&fast_elements); 7647 __ bind(&fast_elements);
7648 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7648 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7649 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); 7649 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7650 __ Addu(t2, t1, t2); 7650 __ Addu(t2, t1, t2);
7651 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 7651 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
7652 __ sw(a0, MemOperand(t2, 0)); 7652 __ sw(a0, MemOperand(t2, 0));
7653 // Update the write barrier for the array store. 7653 // Update the write barrier for the array store.
7654 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs, 7654 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs,
7655 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 7655 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
7656 __ Ret(USE_DELAY_SLOT); 7656 __ Ret(USE_DELAY_SLOT);
7657 __ mov(v0, a0); 7657 __ mov(v0, a0);
7658 7658
7659 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or 7659 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS,
7660 // FAST_ELEMENTS, and value is Smi. 7660 // and value is Smi.
7661 __ bind(&smi_element); 7661 __ bind(&smi_element);
7662 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7662 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7663 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); 7663 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7664 __ Addu(t2, t1, t2); 7664 __ Addu(t2, t1, t2);
7665 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize)); 7665 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize));
7666 __ Ret(USE_DELAY_SLOT); 7666 __ Ret(USE_DELAY_SLOT);
7667 __ mov(v0, a0); 7667 __ mov(v0, a0);
7668 7668
7669 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. 7669 // Array literal has ElementsKind of FAST_*_DOUBLE_ELEMENTS.
7670 __ bind(&double_elements); 7670 __ bind(&double_elements);
7671 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7671 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7672 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, a2, 7672 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, a2,
7673 &slow_elements); 7673 &slow_elements);
7674 __ Ret(USE_DELAY_SLOT); 7674 __ Ret(USE_DELAY_SLOT);
7675 __ mov(v0, a0); 7675 __ mov(v0, a0);
7676 } 7676 }
7677 7677
7678 7678
7679 #undef __ 7679 #undef __
7680 7680
7681 } } // namespace v8::internal 7681 } } // namespace v8::internal
7682 7682
7683 #endif // V8_TARGET_ARCH_MIPS 7683 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698