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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 } | 1531 } |
1532 __ popq(rbp); // Pop caller's frame pointer. | 1532 __ popq(rbp); // Pop caller's frame pointer. |
1533 __ ret(0); | 1533 __ ret(0); |
1534 } else { | 1534 } else { |
1535 // No saved registers. | 1535 // No saved registers. |
1536 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. | 1536 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. |
1537 __ popq(rbp); // Pop caller's frame pointer. | 1537 __ popq(rbp); // Pop caller's frame pointer. |
1538 __ ret(0); | 1538 __ ret(0); |
1539 } | 1539 } |
1540 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1540 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1541 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. | 1541 // Canonicalize JSFunction return sites for now. |
1542 __ popq(rbp); // Pop caller's frame pointer. | 1542 if (return_label_.is_bound()) { |
1543 int pop_count = descriptor->IsJSFunctionCall() | 1543 __ jmp(&return_label_); |
1544 ? static_cast<int>(descriptor->JSParameterCount()) | 1544 } else { |
1545 : 0; | 1545 __ bind(&return_label_); |
1546 __ Ret(pop_count * kPointerSize, rbx); | 1546 __ movq(rsp, rbp); // Move stack pointer back to frame pointer. |
| 1547 __ popq(rbp); // Pop caller's frame pointer. |
| 1548 int pop_count = descriptor->IsJSFunctionCall() |
| 1549 ? static_cast<int>(descriptor->JSParameterCount()) |
| 1550 : 0; |
| 1551 __ Ret(pop_count * kPointerSize, rbx); |
| 1552 } |
1547 } else { | 1553 } else { |
1548 __ ret(0); | 1554 __ ret(0); |
1549 } | 1555 } |
1550 } | 1556 } |
1551 | 1557 |
1552 | 1558 |
1553 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1559 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1554 InstructionOperand* destination) { | 1560 InstructionOperand* destination) { |
1555 X64OperandConverter g(this, NULL); | 1561 X64OperandConverter g(this, NULL); |
1556 // Dispatch on the source and destination operand kinds. Not all | 1562 // Dispatch on the source and destination operand kinds. Not all |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 __ Nop(padding_size); | 1743 __ Nop(padding_size); |
1738 } | 1744 } |
1739 } | 1745 } |
1740 } | 1746 } |
1741 | 1747 |
1742 #undef __ | 1748 #undef __ |
1743 | 1749 |
1744 } // namespace internal | 1750 } // namespace internal |
1745 } // namespace compiler | 1751 } // namespace compiler |
1746 } // namespace v8 | 1752 } // namespace v8 |
OLD | NEW |