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

Side by Side Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 1098863003: Import Reversed adapter from Chromium and use it in v8. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed feedback. Rebased. Created 5 years, 8 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
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "src/base/adapters.h"
7 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 namespace compiler { 14 namespace compiler {
14 15
15 // Adds X64-specific methods for generating operands. 16 // Adds X64-specific methods for generating operands.
16 class X64OperandGenerator final : public OperandGenerator { 17 class X64OperandGenerator final : public OperandGenerator {
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 frame_state_descriptor = GetFrameStateDescriptor( 1028 frame_state_descriptor = GetFrameStateDescriptor(
1028 node->InputAt(static_cast<int>(descriptor->InputCount()))); 1029 node->InputAt(static_cast<int>(descriptor->InputCount())));
1029 } 1030 }
1030 1031
1031 CallBuffer buffer(zone(), descriptor, frame_state_descriptor); 1032 CallBuffer buffer(zone(), descriptor, frame_state_descriptor);
1032 1033
1033 // Compute InstructionOperands for inputs and outputs. 1034 // Compute InstructionOperands for inputs and outputs.
1034 InitializeCallBuffer(node, &buffer, true, true); 1035 InitializeCallBuffer(node, &buffer, true, true);
1035 1036
1036 // Push any stack arguments. 1037 // Push any stack arguments.
1037 for (auto i = buffer.pushed_nodes.rbegin(); i != buffer.pushed_nodes.rend(); 1038 for (Node* node : base::Reversed(buffer.pushed_nodes)) {
1038 ++i) {
1039 // TODO(titzer): handle pushing double parameters. 1039 // TODO(titzer): handle pushing double parameters.
1040 InstructionOperand value = 1040 InstructionOperand value =
1041 g.CanBeImmediate(*i) ? g.UseImmediate(*i) : IsSupported(ATOM) 1041 g.CanBeImmediate(node)
1042 ? g.UseRegister(*i) 1042 ? g.UseImmediate(node)
1043 : g.Use(*i); 1043 : IsSupported(ATOM) ? g.UseRegister(node) : g.Use(node);
1044 Emit(kX64Push, g.NoOutput(), value); 1044 Emit(kX64Push, g.NoOutput(), value);
1045 } 1045 }
1046 1046
1047 // Pass label of exception handler block. 1047 // Pass label of exception handler block.
1048 CallDescriptor::Flags flags = descriptor->flags(); 1048 CallDescriptor::Flags flags = descriptor->flags();
1049 if (handler != nullptr) { 1049 if (handler != nullptr) {
1050 flags |= CallDescriptor::kHasExceptionHandler; 1050 flags |= CallDescriptor::kHasExceptionHandler;
1051 buffer.instruction_args.push_back(g.Label(handler)); 1051 buffer.instruction_args.push_back(g.Label(handler));
1052 } 1052 }
1053 1053
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 if (CpuFeatures::IsSupported(SSE4_1)) { 1549 if (CpuFeatures::IsSupported(SSE4_1)) {
1550 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1550 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1551 MachineOperatorBuilder::kFloat64RoundTruncate; 1551 MachineOperatorBuilder::kFloat64RoundTruncate;
1552 } 1552 }
1553 return flags; 1553 return flags;
1554 } 1554 }
1555 1555
1556 } // namespace compiler 1556 } // namespace compiler
1557 } // namespace internal 1557 } // namespace internal
1558 } // namespace v8 1558 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698