| 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/base/adapters.h" |
| 5 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 7 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 8 | 9 |
| 9 namespace v8 { | 10 namespace v8 { |
| 10 namespace internal { | 11 namespace internal { |
| 11 namespace compiler { | 12 namespace compiler { |
| 12 | 13 |
| 13 // Adds IA32-specific methods for generating operands. | 14 // Adds IA32-specific methods for generating operands. |
| 14 class IA32OperandGenerator final : public OperandGenerator { | 15 class IA32OperandGenerator final : public OperandGenerator { |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 824 frame_state_descriptor = | 825 frame_state_descriptor = |
| 825 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); | 826 GetFrameStateDescriptor(node->InputAt(descriptor->InputCount())); |
| 826 } | 827 } |
| 827 | 828 |
| 828 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); | 829 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); |
| 829 | 830 |
| 830 // Compute InstructionOperands for inputs and outputs. | 831 // Compute InstructionOperands for inputs and outputs. |
| 831 InitializeCallBuffer(node, &buffer, true, true); | 832 InitializeCallBuffer(node, &buffer, true, true); |
| 832 | 833 |
| 833 // Push any stack arguments. | 834 // Push any stack arguments. |
| 834 for (auto i = buffer.pushed_nodes.rbegin(); i != buffer.pushed_nodes.rend(); | 835 for (Node* node : base::Reversed(buffer.pushed_nodes)) { |
| 835 ++i) { | |
| 836 // TODO(titzer): handle pushing double parameters. | 836 // TODO(titzer): handle pushing double parameters. |
| 837 InstructionOperand value = | 837 InstructionOperand value = |
| 838 g.CanBeImmediate(*i) ? g.UseImmediate(*i) : IsSupported(ATOM) | 838 g.CanBeImmediate(node) |
| 839 ? g.UseRegister(*i) | 839 ? g.UseImmediate(node) |
| 840 : g.Use(*i); | 840 : IsSupported(ATOM) ? g.UseRegister(node) : g.Use(node); |
| 841 Emit(kIA32Push, g.NoOutput(), value); | 841 Emit(kIA32Push, g.NoOutput(), value); |
| 842 } | 842 } |
| 843 | 843 |
| 844 // Pass label of exception handler block. | 844 // Pass label of exception handler block. |
| 845 CallDescriptor::Flags flags = descriptor->flags(); | 845 CallDescriptor::Flags flags = descriptor->flags(); |
| 846 if (handler != nullptr) { | 846 if (handler != nullptr) { |
| 847 flags |= CallDescriptor::kHasExceptionHandler; | 847 flags |= CallDescriptor::kHasExceptionHandler; |
| 848 buffer.instruction_args.push_back(g.Label(handler)); | 848 buffer.instruction_args.push_back(g.Label(handler)); |
| 849 } | 849 } |
| 850 | 850 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 if (CpuFeatures::IsSupported(SSE4_1)) { | 1236 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1237 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1237 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
| 1238 MachineOperatorBuilder::kFloat64RoundTruncate; | 1238 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1239 } | 1239 } |
| 1240 return flags; | 1240 return flags; |
| 1241 } | 1241 } |
| 1242 | 1242 |
| 1243 } // namespace compiler | 1243 } // namespace compiler |
| 1244 } // namespace internal | 1244 } // namespace internal |
| 1245 } // namespace v8 | 1245 } // namespace v8 |
| OLD | NEW |