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

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

Issue 10209027: Implement tracking and optimizations of packed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New upload Created 8 years, 8 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
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 7346 matching lines...) Expand 10 before | Expand all | Expand 10 after
7357 { REG(t0), REG(a1), REG(a2), OMIT_REMEMBERED_SET }, 7357 { REG(t0), REG(a1), REG(a2), OMIT_REMEMBERED_SET },
7358 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField. 7358 // Used in StoreStubCompiler::CompileStoreField via GenerateStoreField.
7359 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET }, 7359 { REG(a1), REG(a2), REG(a3), EMIT_REMEMBERED_SET },
7360 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET }, 7360 { REG(a3), REG(a2), REG(a1), EMIT_REMEMBERED_SET },
7361 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField. 7361 // Used in KeyedStoreStubCompiler::CompileStoreField via GenerateStoreField.
7362 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET }, 7362 { REG(a2), REG(a1), REG(a3), EMIT_REMEMBERED_SET },
7363 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET }, 7363 { REG(a3), REG(a1), REG(a2), EMIT_REMEMBERED_SET },
7364 // KeyedStoreStubCompiler::GenerateStoreFastElement. 7364 // KeyedStoreStubCompiler::GenerateStoreFastElement.
7365 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET }, 7365 { REG(a3), REG(a2), REG(t0), EMIT_REMEMBERED_SET },
7366 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET }, 7366 { REG(a2), REG(a3), REG(t0), EMIT_REMEMBERED_SET },
7367 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 7367 // ElementsTransitionGenerator::GenerateMapChangeElementTransition
7368 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble 7368 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble
7369 // and ElementsTransitionGenerator::GenerateDoubleToObject 7369 // and ElementsTransitionGenerator::GenerateDoubleToObject
7370 { REG(a2), REG(a3), REG(t5), EMIT_REMEMBERED_SET }, 7370 { REG(a2), REG(a3), REG(t5), EMIT_REMEMBERED_SET },
7371 { REG(a2), REG(a3), REG(t5), OMIT_REMEMBERED_SET }, 7371 { REG(a2), REG(a3), REG(t5), OMIT_REMEMBERED_SET },
7372 // ElementsTransitionGenerator::GenerateDoubleToObject 7372 // ElementsTransitionGenerator::GenerateDoubleToObject
7373 { REG(t2), REG(a2), REG(a0), EMIT_REMEMBERED_SET }, 7373 { REG(t2), REG(a2), REG(a0), EMIT_REMEMBERED_SET },
7374 { REG(a2), REG(t2), REG(t5), EMIT_REMEMBERED_SET }, 7374 { REG(a2), REG(t2), REG(t5), EMIT_REMEMBERED_SET },
7375 // StoreArrayLiteralElementStub::Generate 7375 // StoreArrayLiteralElementStub::Generate
7376 { REG(t1), REG(a0), REG(t2), EMIT_REMEMBERED_SET }, 7376 { REG(t1), REG(a0), REG(t2), EMIT_REMEMBERED_SET },
7377 // Null termination. 7377 // Null termination.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
7624 // -- t0 : array literal index in function as smi 7624 // -- t0 : array literal index in function as smi
7625 // ----------------------------------- 7625 // -----------------------------------
7626 7626
7627 Label element_done; 7627 Label element_done;
7628 Label double_elements; 7628 Label double_elements;
7629 Label smi_element; 7629 Label smi_element;
7630 Label slow_elements; 7630 Label slow_elements;
7631 Label fast_elements; 7631 Label fast_elements;
7632 7632
7633 __ CheckFastElements(a2, t1, &double_elements); 7633 __ CheckFastElements(a2, t1, &double_elements);
7634 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS 7634 // Check Smi or Object elements
7635 __ JumpIfSmi(a0, &smi_element); 7635 __ JumpIfSmi(a0, &smi_element);
7636 __ CheckFastSmiOnlyElements(a2, t1, &fast_elements); 7636 __ CheckFastSmiOnlyElements(a2, t1, &fast_elements);
7637 7637
7638 // Store into the array literal requires a elements transition. Call into 7638 // Store into the array literal requires a elements transition. Call into
7639 // the runtime. 7639 // the runtime.
7640 __ bind(&slow_elements); 7640 __ bind(&slow_elements);
7641 // call. 7641 // call.
7642 __ Push(a1, a3, a0); 7642 __ Push(a1, a3, a0);
7643 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 7643 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
7644 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset)); 7644 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset));
7645 __ Push(t1, t0); 7645 __ Push(t1, t0);
7646 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); 7646 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1);
7647 7647
7648 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. 7648 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object.
7649 __ bind(&fast_elements); 7649 __ bind(&fast_elements);
7650 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7650 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7651 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); 7651 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7652 __ Addu(t2, t1, t2); 7652 __ Addu(t2, t1, t2);
7653 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 7653 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
7654 __ sw(a0, MemOperand(t2, 0)); 7654 __ sw(a0, MemOperand(t2, 0));
7655 // Update the write barrier for the array store. 7655 // Update the write barrier for the array store.
7656 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs, 7656 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs,
7657 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 7657 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
7658 __ Ret(USE_DELAY_SLOT); 7658 __ Ret(USE_DELAY_SLOT);
7659 __ mov(v0, a0); 7659 __ mov(v0, a0);
7660 7660
7661 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or 7661 // Array literal has FAST_* elements and value is Smi.
7662 // FAST_ELEMENTS, and value is Smi.
7663 __ bind(&smi_element); 7662 __ bind(&smi_element);
7664 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7663 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7665 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize); 7664 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7666 __ Addu(t2, t1, t2); 7665 __ Addu(t2, t1, t2);
7667 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize)); 7666 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize));
7668 __ Ret(USE_DELAY_SLOT); 7667 __ Ret(USE_DELAY_SLOT);
7669 __ mov(v0, a0); 7668 __ mov(v0, a0);
7670 7669
7671 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. 7670 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
7672 __ bind(&double_elements); 7671 __ bind(&double_elements);
7673 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset)); 7672 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7674 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, a2, 7673 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, a2,
7675 &slow_elements); 7674 &slow_elements);
7676 __ Ret(USE_DELAY_SLOT); 7675 __ Ret(USE_DELAY_SLOT);
7677 __ mov(v0, a0); 7676 __ mov(v0, a0);
7678 } 7677 }
7679 7678
7680 7679
7681 #undef __ 7680 #undef __
7682 7681
7683 } } // namespace v8::internal 7682 } } // namespace v8::internal
7684 7683
7685 #endif // V8_TARGET_ARCH_MIPS 7684 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/lithium.cc ('k') | src/mips/codegen-mips.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698