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

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

Issue 8551006: Version 3.7.9. (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 1 month 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/ia32/lithium-ia32.cc ('k') | src/mips/deoptimizer-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 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 6008 matching lines...) Expand 10 before | Expand all | Expand 10 after
6019 __ jmp(&return_v0); 6019 __ jmp(&return_v0);
6020 6020
6021 if (FLAG_string_slices) { 6021 if (FLAG_string_slices) {
6022 __ bind(&create_slice); 6022 __ bind(&create_slice);
6023 // v0: original string 6023 // v0: original string
6024 // a1: instance type 6024 // a1: instance type
6025 // a2: length 6025 // a2: length
6026 // a3: from index (untagged smi) 6026 // a3: from index (untagged smi)
6027 // t2 (a.k.a. to): to (smi) 6027 // t2 (a.k.a. to): to (smi)
6028 // t3 (a.k.a. from): from offset (smi) 6028 // t3 (a.k.a. from): from offset (smi)
6029 Label allocate_slice, sliced_string, seq_string; 6029 Label allocate_slice, sliced_string, seq_or_external_string;
6030 STATIC_ASSERT(kSeqStringTag == 0); 6030 // If the string is not indirect, it can only be sequential or external.
6031 __ And(t4, a1, Operand(kStringRepresentationMask));
6032 __ Branch(&seq_string, eq, t4, Operand(zero_reg));
6033 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); 6031 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag));
6034 STATIC_ASSERT(kIsIndirectStringMask != 0); 6032 STATIC_ASSERT(kIsIndirectStringMask != 0);
6035 __ And(t4, a1, Operand(kIsIndirectStringMask)); 6033 __ And(t4, a1, Operand(kIsIndirectStringMask));
6036 // External string. Jump to runtime. 6034 // External string. Jump to runtime.
6037 __ Branch(&sub_string_runtime, eq, t4, Operand(zero_reg)); 6035 __ Branch(&seq_or_external_string, eq, t4, Operand(zero_reg));
6038 6036
6039 __ And(t4, a1, Operand(kSlicedNotConsMask)); 6037 __ And(t4, a1, Operand(kSlicedNotConsMask));
6040 __ Branch(&sliced_string, ne, t4, Operand(zero_reg)); 6038 __ Branch(&sliced_string, ne, t4, Operand(zero_reg));
6041 // Cons string. Check whether it is flat, then fetch first part. 6039 // Cons string. Check whether it is flat, then fetch first part.
6042 __ lw(t1, FieldMemOperand(v0, ConsString::kSecondOffset)); 6040 __ lw(t1, FieldMemOperand(v0, ConsString::kSecondOffset));
6043 __ LoadRoot(t5, Heap::kEmptyStringRootIndex); 6041 __ LoadRoot(t5, Heap::kEmptyStringRootIndex);
6044 __ Branch(&sub_string_runtime, ne, t1, Operand(t5)); 6042 __ Branch(&sub_string_runtime, ne, t1, Operand(t5));
6045 __ lw(t1, FieldMemOperand(v0, ConsString::kFirstOffset)); 6043 __ lw(t1, FieldMemOperand(v0, ConsString::kFirstOffset));
6046 __ jmp(&allocate_slice); 6044 __ jmp(&allocate_slice);
6047 6045
6048 __ bind(&sliced_string); 6046 __ bind(&sliced_string);
6049 // Sliced string. Fetch parent and correct start index by offset. 6047 // Sliced string. Fetch parent and correct start index by offset.
6050 __ lw(t1, FieldMemOperand(v0, SlicedString::kOffsetOffset)); 6048 __ lw(t1, FieldMemOperand(v0, SlicedString::kOffsetOffset));
6051 __ addu(t3, t3, t1); 6049 __ addu(t3, t3, t1);
6052 __ lw(t1, FieldMemOperand(v0, SlicedString::kParentOffset)); 6050 __ lw(t1, FieldMemOperand(v0, SlicedString::kParentOffset));
6053 __ jmp(&allocate_slice); 6051 __ jmp(&allocate_slice);
6054 6052
6055 __ bind(&seq_string); 6053 __ bind(&seq_or_external_string);
6056 // Sequential string. Just move string to the right register. 6054 // Sequential or external string. Just move string to the correct register.
6057 __ mov(t1, v0); 6055 __ mov(t1, v0);
6058 6056
6059 __ bind(&allocate_slice); 6057 __ bind(&allocate_slice);
6060 // a1: instance type of original string 6058 // a1: instance type of original string
6061 // a2: length 6059 // a2: length
6062 // t1: underlying subject string 6060 // t1: underlying subject string
6063 // t3 (a.k.a. from): from offset (smi) 6061 // t3 (a.k.a. from): from offset (smi)
6064 // Allocate new sliced string. At this point we do not reload the instance 6062 // Allocate new sliced string. At this point we do not reload the instance
6065 // type including the string encoding because we simply rely on the info 6063 // type including the string encoding because we simply rely on the info
6066 // provided by the original string. It does not matter if the original 6064 // provided by the original string. It does not matter if the original
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
7155 { a3, a1, a2, EMIT_REMEMBERED_SET }, 7153 { a3, a1, a2, EMIT_REMEMBERED_SET },
7156 // KeyedStoreStubCompiler::GenerateStoreFastElement. 7154 // KeyedStoreStubCompiler::GenerateStoreFastElement.
7157 { t0, a2, a3, EMIT_REMEMBERED_SET }, 7155 { t0, a2, a3, EMIT_REMEMBERED_SET },
7158 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 7156 // ElementsTransitionGenerator::GenerateSmiOnlyToObject
7159 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble 7157 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble
7160 // and ElementsTransitionGenerator::GenerateDoubleToObject 7158 // and ElementsTransitionGenerator::GenerateDoubleToObject
7161 { a2, a3, t5, EMIT_REMEMBERED_SET }, 7159 { a2, a3, t5, EMIT_REMEMBERED_SET },
7162 // ElementsTransitionGenerator::GenerateDoubleToObject 7160 // ElementsTransitionGenerator::GenerateDoubleToObject
7163 { t2, a2, a0, EMIT_REMEMBERED_SET }, 7161 { t2, a2, a0, EMIT_REMEMBERED_SET },
7164 { a2, t2, t5, EMIT_REMEMBERED_SET }, 7162 { a2, t2, t5, EMIT_REMEMBERED_SET },
7163 // StoreArrayLiteralElementStub::Generate
7164 { t1, a0, t2, EMIT_REMEMBERED_SET },
7165 // Null termination. 7165 // Null termination.
7166 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET} 7166 { no_reg, no_reg, no_reg, EMIT_REMEMBERED_SET}
7167 }; 7167 };
7168 7168
7169 7169
7170 bool RecordWriteStub::IsPregenerated() { 7170 bool RecordWriteStub::IsPregenerated() {
7171 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; 7171 for (AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
7172 !entry->object.is(no_reg); 7172 !entry->object.is(no_reg);
7173 entry++) { 7173 entry++) {
7174 if (object_.is(entry->object) && 7174 if (object_.is(entry->object) &&
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
7394 7394
7395 __ bind(&need_incremental_pop_scratch); 7395 __ bind(&need_incremental_pop_scratch);
7396 __ Pop(regs_.object(), regs_.address()); 7396 __ Pop(regs_.object(), regs_.address());
7397 7397
7398 __ bind(&need_incremental); 7398 __ bind(&need_incremental);
7399 7399
7400 // Fall through when we need to inform the incremental marker. 7400 // Fall through when we need to inform the incremental marker.
7401 } 7401 }
7402 7402
7403 7403
7404 void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
7405 // ----------- S t a t e -------------
7406 // -- a0 : element value to store
7407 // -- a1 : array literal
7408 // -- a2 : map of array literal
7409 // -- a3 : element index as smi
7410 // -- t0 : array literal index in function as smi
7411 // -----------------------------------
7412
7413 Label element_done;
7414 Label double_elements;
7415 Label smi_element;
7416 Label slow_elements;
7417 Label fast_elements;
7418
7419 __ CheckFastElements(a2, t1, &double_elements);
7420 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS
7421 __ JumpIfSmi(a0, &smi_element);
7422 __ CheckFastSmiOnlyElements(a2, t1, &fast_elements);
7423
7424 // Store into the array literal requires a elements transition. Call into
7425 // the runtime.
7426 __ bind(&slow_elements);
7427 // call.
7428 __ Push(a1, a3, a0);
7429 __ lw(t1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
7430 __ lw(t1, FieldMemOperand(t1, JSFunction::kLiteralsOffset));
7431 __ Push(t1, t0);
7432 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1);
7433
7434 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object.
7435 __ bind(&fast_elements);
7436 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7437 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7438 __ Addu(t2, t1, t2);
7439 __ Addu(t2, t2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
7440 __ sw(a0, MemOperand(t2, 0));
7441 // Update the write barrier for the array store.
7442 __ RecordWrite(t1, t2, a0, kRAHasNotBeenSaved, kDontSaveFPRegs,
7443 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
7444 __ Ret();
7445
7446 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or
7447 // FAST_ELEMENTS, and value is Smi.
7448 __ bind(&smi_element);
7449 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7450 __ sll(t2, a3, kPointerSizeLog2 - kSmiTagSize);
7451 __ Addu(t2, t1, t2);
7452 __ sw(a0, FieldMemOperand(t2, FixedArray::kHeaderSize));
7453 __ Ret();
7454
7455 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
7456 __ bind(&double_elements);
7457 __ lw(t1, FieldMemOperand(a1, JSObject::kElementsOffset));
7458 __ StoreNumberToDoubleElements(a0, a3, a1, t1, t2, t3, t5, t6,
7459 &slow_elements);
7460 __ Ret();
7461 }
7462
7463
7404 #undef __ 7464 #undef __
7405 7465
7406 } } // namespace v8::internal 7466 } } // namespace v8::internal
7407 7467
7408 #endif // V8_TARGET_ARCH_MIPS 7468 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/mips/deoptimizer-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698