OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 4294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4305 | 4305 |
4306 __ bind(&need_incremental_pop_scratch); | 4306 __ bind(&need_incremental_pop_scratch); |
4307 __ Pop(regs_.object(), regs_.address()); | 4307 __ Pop(regs_.object(), regs_.address()); |
4308 | 4308 |
4309 __ bind(&need_incremental); | 4309 __ bind(&need_incremental); |
4310 | 4310 |
4311 // Fall through when we need to inform the incremental marker. | 4311 // Fall through when we need to inform the incremental marker. |
4312 } | 4312 } |
4313 | 4313 |
4314 | 4314 |
4315 void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) { | |
4316 // ----------- S t a t e ------------- | |
4317 // -- a0 : element value to store | |
4318 // -- a3 : element index as smi | |
4319 // -- sp[0] : array literal index in function as smi | |
4320 // -- sp[4] : array literal | |
4321 // clobbers a1, a2, a4 | |
4322 // ----------------------------------- | |
4323 | |
4324 Label element_done; | |
4325 Label double_elements; | |
4326 Label smi_element; | |
4327 Label slow_elements; | |
4328 Label fast_elements; | |
4329 | |
4330 // Get array literal index, array literal and its map. | |
4331 __ ld(a4, MemOperand(sp, 0 * kPointerSize)); | |
4332 __ ld(a1, MemOperand(sp, 1 * kPointerSize)); | |
4333 __ ld(a2, FieldMemOperand(a1, JSObject::kMapOffset)); | |
4334 | |
4335 __ CheckFastElements(a2, a5, &double_elements); | |
4336 // Check for FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS elements | |
4337 __ JumpIfSmi(a0, &smi_element); | |
4338 __ CheckFastSmiElements(a2, a5, &fast_elements); | |
4339 | |
4340 // Store into the array literal requires a elements transition. Call into | |
4341 // the runtime. | |
4342 __ bind(&slow_elements); | |
4343 // call. | |
4344 __ Push(a1, a3, a0); | |
4345 __ ld(a5, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | |
4346 __ ld(a5, FieldMemOperand(a5, JSFunction::kLiteralsOffset)); | |
4347 __ Push(a5, a4); | |
4348 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); | |
4349 | |
4350 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object. | |
4351 __ bind(&fast_elements); | |
4352 __ ld(a5, FieldMemOperand(a1, JSObject::kElementsOffset)); | |
4353 __ SmiScale(a6, a3, kPointerSizeLog2); | |
4354 __ Daddu(a6, a5, a6); | |
4355 __ Daddu(a6, a6, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | |
4356 __ sd(a0, MemOperand(a6, 0)); | |
4357 // Update the write barrier for the array store. | |
4358 __ RecordWrite(a5, a6, a0, kRAHasNotBeenSaved, kDontSaveFPRegs, | |
4359 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | |
4360 __ Ret(USE_DELAY_SLOT); | |
4361 __ mov(v0, a0); | |
4362 | |
4363 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS, | |
4364 // and value is Smi. | |
4365 __ bind(&smi_element); | |
4366 __ ld(a5, FieldMemOperand(a1, JSObject::kElementsOffset)); | |
4367 __ SmiScale(a6, a3, kPointerSizeLog2); | |
4368 __ Daddu(a6, a5, a6); | |
4369 __ sd(a0, FieldMemOperand(a6, FixedArray::kHeaderSize)); | |
4370 __ Ret(USE_DELAY_SLOT); | |
4371 __ mov(v0, a0); | |
4372 | |
4373 // Array literal has ElementsKind of FAST_*_DOUBLE_ELEMENTS. | |
4374 __ bind(&double_elements); | |
4375 __ ld(a5, FieldMemOperand(a1, JSObject::kElementsOffset)); | |
4376 __ StoreNumberToDoubleElements(a0, a3, a5, a7, t1, &slow_elements); | |
4377 __ Ret(USE_DELAY_SLOT); | |
4378 __ mov(v0, a0); | |
4379 } | |
4380 | |
4381 | |
4382 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { | 4315 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { |
4383 CEntryStub ces(isolate(), 1, kSaveFPRegs); | 4316 CEntryStub ces(isolate(), 1, kSaveFPRegs); |
4384 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); | 4317 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); |
4385 int parameter_count_offset = | 4318 int parameter_count_offset = |
4386 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; | 4319 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; |
4387 __ ld(a1, MemOperand(fp, parameter_count_offset)); | 4320 __ ld(a1, MemOperand(fp, parameter_count_offset)); |
4388 if (function_mode() == JS_FUNCTION_STUB_MODE) { | 4321 if (function_mode() == JS_FUNCTION_STUB_MODE) { |
4389 __ Daddu(a1, a1, Operand(1)); | 4322 __ Daddu(a1, a1, Operand(1)); |
4390 } | 4323 } |
4391 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); | 4324 masm->LeaveFrame(StackFrame::STUB_FAILURE_TRAMPOLINE); |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5672 MemOperand(fp, 6 * kPointerSize), NULL); | 5605 MemOperand(fp, 6 * kPointerSize), NULL); |
5673 } | 5606 } |
5674 | 5607 |
5675 | 5608 |
5676 #undef __ | 5609 #undef __ |
5677 | 5610 |
5678 } // namespace internal | 5611 } // namespace internal |
5679 } // namespace v8 | 5612 } // namespace v8 |
5680 | 5613 |
5681 #endif // V8_TARGET_ARCH_MIPS64 | 5614 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |