OLD | NEW |
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 "src/crankshaft/arm64/lithium-codegen-arm64.h" | 5 #include "src/crankshaft/arm64/lithium-codegen-arm64.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 // When we are inside an inlined function, the arguments are the last things | 1559 // When we are inside an inlined function, the arguments are the last things |
1560 // that have been pushed on the stack. Therefore the arguments array can be | 1560 // that have been pushed on the stack. Therefore the arguments array can be |
1561 // accessed directly from jssp. | 1561 // accessed directly from jssp. |
1562 // However in the normal case, it is accessed via fp but there are two words | 1562 // However in the normal case, it is accessed via fp but there are two words |
1563 // on the stack between fp and the arguments (the saved lr and fp) and the | 1563 // on the stack between fp and the arguments (the saved lr and fp) and the |
1564 // LAccessArgumentsAt implementation take that into account. | 1564 // LAccessArgumentsAt implementation take that into account. |
1565 // In the inlined case we need to subtract the size of 2 words to jssp to | 1565 // In the inlined case we need to subtract the size of 2 words to jssp to |
1566 // get a pointer which will work well with LAccessArgumentsAt. | 1566 // get a pointer which will work well with LAccessArgumentsAt. |
1567 DCHECK(masm()->StackPointer().Is(jssp)); | 1567 DCHECK(masm()->StackPointer().Is(jssp)); |
1568 __ Sub(result, jssp, 2 * kPointerSize); | 1568 __ Sub(result, jssp, 2 * kPointerSize); |
1569 } else { | 1569 } else if (instr->hydrogen()->arguments_adaptor()) { |
1570 DCHECK(instr->temp() != NULL); | 1570 DCHECK(instr->temp() != NULL); |
1571 Register previous_fp = ToRegister(instr->temp()); | 1571 Register previous_fp = ToRegister(instr->temp()); |
1572 | 1572 |
1573 __ Ldr(previous_fp, | 1573 __ Ldr(previous_fp, |
1574 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 1574 MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
1575 __ Ldr(result, MemOperand(previous_fp, | 1575 __ Ldr(result, MemOperand(previous_fp, |
1576 CommonFrameConstants::kContextOrFrameTypeOffset)); | 1576 CommonFrameConstants::kContextOrFrameTypeOffset)); |
1577 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 1577 __ Cmp(result, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
1578 __ Csel(result, fp, previous_fp, ne); | 1578 __ Csel(result, fp, previous_fp, ne); |
| 1579 } else { |
| 1580 __ Mov(result, fp); |
1579 } | 1581 } |
1580 } | 1582 } |
1581 | 1583 |
1582 | 1584 |
1583 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { | 1585 void LCodeGen::DoArgumentsLength(LArgumentsLength* instr) { |
1584 Register elements = ToRegister(instr->elements()); | 1586 Register elements = ToRegister(instr->elements()); |
1585 Register result = ToRegister32(instr->result()); | 1587 Register result = ToRegister32(instr->result()); |
1586 Label done; | 1588 Label done; |
1587 | 1589 |
1588 // If no arguments adaptor frame the number of arguments is fixed. | 1590 // If no arguments adaptor frame the number of arguments is fixed. |
(...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5730 | 5732 |
5731 | 5733 |
5732 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5734 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5733 Register context = ToRegister(instr->context()); | 5735 Register context = ToRegister(instr->context()); |
5734 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5736 __ Str(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5735 } | 5737 } |
5736 | 5738 |
5737 | 5739 |
5738 } // namespace internal | 5740 } // namespace internal |
5739 } // namespace v8 | 5741 } // namespace v8 |
OLD | NEW |