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

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

Issue 255343004: ARM64: Use default-NaN mode to canonicalize NaNs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reset FPCR for cctest/test-assembler-a64.cc. Created 6 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 | « no previous file | src/arm64/ic-arm64.cc » ('j') | src/arm64/macro-assembler-arm64.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #include "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 __ Peek(target, 3 * kPointerSize); 1570 __ Peek(target, 3 * kPointerSize);
1571 1571
1572 __ LeaveExitFrame(save_doubles_, x10, true); 1572 __ LeaveExitFrame(save_doubles_, x10, true);
1573 ASSERT(jssp.Is(__ StackPointer())); 1573 ASSERT(jssp.Is(__ StackPointer()));
1574 // Pop or drop the remaining stack slots and return from the stub. 1574 // Pop or drop the remaining stack slots and return from the stub.
1575 // jssp[24]: Arguments array (of size argc), including receiver. 1575 // jssp[24]: Arguments array (of size argc), including receiver.
1576 // jssp[16]: Preserved x23 (used for target). 1576 // jssp[16]: Preserved x23 (used for target).
1577 // jssp[8]: Preserved x22 (used for argc). 1577 // jssp[8]: Preserved x22 (used for argc).
1578 // jssp[0]: Preserved x21 (used for argv). 1578 // jssp[0]: Preserved x21 (used for argv).
1579 __ Drop(x11); 1579 __ Drop(x11);
1580 __ AssertFPCRState();
1580 __ Ret(); 1581 __ Ret();
1581 1582
1582 // The stack pointer is still csp if we aren't returning, and the frame 1583 // The stack pointer is still csp if we aren't returning, and the frame
1583 // hasn't changed (except for the return address). 1584 // hasn't changed (except for the return address).
1584 __ SetStackPointer(csp); 1585 __ SetStackPointer(csp);
1585 1586
1586 // Handling of exception. 1587 // Handling of exception.
1587 __ Bind(&exception_returned); 1588 __ Bind(&exception_returned);
1588 1589
1589 // Retrieve the pending exception. 1590 // Retrieve the pending exception.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 // Push callee-saved registers and synchronize the system stack pointer (csp) 1654 // Push callee-saved registers and synchronize the system stack pointer (csp)
1654 // and the JavaScript stack pointer (jssp). 1655 // and the JavaScript stack pointer (jssp).
1655 // 1656 //
1656 // We must not write to jssp until after the PushCalleeSavedRegisters() 1657 // We must not write to jssp until after the PushCalleeSavedRegisters()
1657 // call, since jssp is itself a callee-saved register. 1658 // call, since jssp is itself a callee-saved register.
1658 __ SetStackPointer(csp); 1659 __ SetStackPointer(csp);
1659 __ PushCalleeSavedRegisters(); 1660 __ PushCalleeSavedRegisters();
1660 __ Mov(jssp, csp); 1661 __ Mov(jssp, csp);
1661 __ SetStackPointer(jssp); 1662 __ SetStackPointer(jssp);
1662 1663
1664 // Configure the FPCR. We don't restore it, so this is technically not allowed
1665 // according to AAPCS64. However, we only set default-NaN mode and this will
1666 // be harmless for most C code. Also, it works for ARM.
1667 __ ConfigureFPCR();
1668
1663 ProfileEntryHookStub::MaybeCallEntryHook(masm); 1669 ProfileEntryHookStub::MaybeCallEntryHook(masm);
1664 1670
1665 // Set up the reserved register for 0.0. 1671 // Set up the reserved register for 0.0.
1666 __ Fmov(fp_zero, 0.0); 1672 __ Fmov(fp_zero, 0.0);
1667 1673
1668 // Build an entry frame (see layout below). 1674 // Build an entry frame (see layout below).
1669 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 1675 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
1670 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used. 1676 int64_t bad_frame_pointer = -1L; // Bad frame pointer to fail if it is used.
1671 __ Mov(x13, bad_frame_pointer); 1677 __ Mov(x13, bad_frame_pointer);
1672 __ Mov(x12, Smi::FromInt(marker)); 1678 __ Mov(x12, Smi::FromInt(marker));
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
4512 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS, 4518 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS,
4513 // and value is Smi. 4519 // and value is Smi.
4514 __ Bind(&smi_element); 4520 __ Bind(&smi_element);
4515 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset)); 4521 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset));
4516 __ Add(x11, x10, Operand::UntagSmiAndScale(index_smi, kPointerSizeLog2)); 4522 __ Add(x11, x10, Operand::UntagSmiAndScale(index_smi, kPointerSizeLog2));
4517 __ Str(value, FieldMemOperand(x11, FixedArray::kHeaderSize)); 4523 __ Str(value, FieldMemOperand(x11, FixedArray::kHeaderSize));
4518 __ Ret(); 4524 __ Ret();
4519 4525
4520 __ Bind(&double_elements); 4526 __ Bind(&double_elements);
4521 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset)); 4527 __ Ldr(x10, FieldMemOperand(array, JSObject::kElementsOffset));
4522 __ StoreNumberToDoubleElements(value, index_smi, x10, x11, d0, d1, 4528 __ StoreNumberToDoubleElements(value, index_smi, x10, x11, d0,
4523 &slow_elements); 4529 &slow_elements);
4524 __ Ret(); 4530 __ Ret();
4525 } 4531 }
4526 4532
4527 4533
4528 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) { 4534 void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
4529 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs); 4535 CEntryStub ces(isolate(), 1, fp_registers_ ? kSaveFPRegs : kDontSaveFPRegs);
4530 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET); 4536 __ Call(ces.GetCode(), RelocInfo::CODE_TARGET);
4531 int parameter_count_offset = 4537 int parameter_count_offset =
4532 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset; 4538 StubFailureTrampolineFrame::kCallerStackParameterCountFrameOffset;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
4614 // and configure the stack pointer *before* doing the call. 4620 // and configure the stack pointer *before* doing the call.
4615 const Register old_stack_pointer = __ StackPointer(); 4621 const Register old_stack_pointer = __ StackPointer();
4616 __ SetStackPointer(csp); 4622 __ SetStackPointer(csp);
4617 4623
4618 // Put return address on the stack (accessible to GC through exit frame pc). 4624 // Put return address on the stack (accessible to GC through exit frame pc).
4619 __ Poke(lr, 0); 4625 __ Poke(lr, 0);
4620 // Call the C++ function. 4626 // Call the C++ function.
4621 __ Blr(x10); 4627 __ Blr(x10);
4622 // Return to calling code. 4628 // Return to calling code.
4623 __ Peek(lr, 0); 4629 __ Peek(lr, 0);
4630 __ AssertFPCRState();
4624 __ Ret(); 4631 __ Ret();
4625 4632
4626 __ SetStackPointer(old_stack_pointer); 4633 __ SetStackPointer(old_stack_pointer);
4627 } 4634 }
4628 4635
4629 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, 4636 void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
4630 Register target) { 4637 Register target) {
4631 // Make sure the caller configured the stack pointer (see comment in 4638 // Make sure the caller configured the stack pointer (see comment in
4632 // DirectCEntryStub::Generate). 4639 // DirectCEntryStub::Generate).
4633 ASSERT(csp.Is(__ StackPointer())); 4640 ASSERT(csp.Is(__ StackPointer()));
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 MemOperand(fp, 6 * kPointerSize), 5361 MemOperand(fp, 6 * kPointerSize),
5355 NULL); 5362 NULL);
5356 } 5363 }
5357 5364
5358 5365
5359 #undef __ 5366 #undef __
5360 5367
5361 } } // namespace v8::internal 5368 } } // namespace v8::internal
5362 5369
5363 #endif // V8_TARGET_ARCH_ARM64 5370 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « no previous file | src/arm64/ic-arm64.cc » ('j') | src/arm64/macro-assembler-arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698