OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/adapters.h" | 9 #include "src/base/adapters.h" |
10 #include "src/compiler/instruction-selector-impl.h" | 10 #include "src/compiler/instruction-selector-impl.h" |
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1537 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); | 1537 DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
1538 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); | 1538 IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
1539 if (hint == IfExceptionHint::kLocallyCaught) { | 1539 if (hint == IfExceptionHint::kLocallyCaught) { |
1540 flags |= CallDescriptor::kHasLocalCatchHandler; | 1540 flags |= CallDescriptor::kHasLocalCatchHandler; |
1541 } | 1541 } |
1542 flags |= CallDescriptor::kHasExceptionHandler; | 1542 flags |= CallDescriptor::kHasExceptionHandler; |
1543 buffer.instruction_args.push_back(g.Label(handler)); | 1543 buffer.instruction_args.push_back(g.Label(handler)); |
1544 } | 1544 } |
1545 | 1545 |
1546 // (arm64 only) caller uses JSSP but callee might destroy it. | 1546 // (arm64 only) caller uses JSSP but callee might destroy it. |
1547 if (descriptor->UseNativeStack() && | 1547 bool caller_native_stack = |
ahaas
2016/03/29 08:33:58
Similar to the code in the instruction-selector-ar
titzer
2016/03/29 09:10:53
Done.
| |
1548 !linkage()->GetIncomingDescriptor()->UseNativeStack()) { | 1548 linkage()->GetIncomingDescriptor()->UseNativeStack(); |
1549 flags |= CallDescriptor::kRestoreJSSP; | 1549 bool to_native_stack = descriptor->UseNativeStack(); |
1550 if (caller_native_stack != to_native_stack) { | |
1551 // Mismatch in the use of stack pointers. One or the other has to be | |
1552 // restored. | |
1553 flags |= to_native_stack ? CallDescriptor::kRestoreJSSP | |
1554 : CallDescriptor::kRestoreCSP; | |
1550 } | 1555 } |
1551 | 1556 |
1552 | 1557 |
1553 // Select the appropriate opcode based on the call type. | 1558 // Select the appropriate opcode based on the call type. |
1554 InstructionCode opcode = kArchNop; | 1559 InstructionCode opcode = kArchNop; |
1555 switch (descriptor->kind()) { | 1560 switch (descriptor->kind()) { |
1556 case CallDescriptor::kCallAddress: | 1561 case CallDescriptor::kCallAddress: |
1557 opcode = | 1562 opcode = |
1558 kArchCallCFunction | | 1563 kArchCallCFunction | |
1559 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); | 1564 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1785 return new (instruction_zone()) FrameStateDescriptor( | 1790 return new (instruction_zone()) FrameStateDescriptor( |
1786 instruction_zone(), state_info.type(), state_info.bailout_id(), | 1791 instruction_zone(), state_info.type(), state_info.bailout_id(), |
1787 state_info.state_combine(), parameters, locals, stack, | 1792 state_info.state_combine(), parameters, locals, stack, |
1788 state_info.shared_info(), outer_state); | 1793 state_info.shared_info(), outer_state); |
1789 } | 1794 } |
1790 | 1795 |
1791 | 1796 |
1792 } // namespace compiler | 1797 } // namespace compiler |
1793 } // namespace internal | 1798 } // namespace internal |
1794 } // namespace v8 | 1799 } // namespace v8 |
OLD | NEW |