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

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: 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
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 (auto i : base::Reversed(buffer.pushed_nodes)) {
Michael Starzinger 2015/04/20 13:11:14 nit: s/auto i/Node* node/
Sven Panne 2015/04/20 14:38:35 Done.
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(i) ? g.UseImmediate(i)
1042 ? g.UseRegister(*i) 1042 : IsSupported(ATOM) ? g.UseRegister(i) : g.Use(i);
1043 : g.Use(*i);
1044 Emit(kX64Push, g.NoOutput(), value); 1043 Emit(kX64Push, g.NoOutput(), value);
1045 } 1044 }
1046 1045
1047 // Pass label of exception handler block. 1046 // Pass label of exception handler block.
1048 CallDescriptor::Flags flags = descriptor->flags(); 1047 CallDescriptor::Flags flags = descriptor->flags();
1049 if (handler != nullptr) { 1048 if (handler != nullptr) {
1050 flags |= CallDescriptor::kHasExceptionHandler; 1049 flags |= CallDescriptor::kHasExceptionHandler;
1051 buffer.instruction_args.push_back(g.Label(handler)); 1050 buffer.instruction_args.push_back(g.Label(handler));
1052 } 1051 }
1053 1052
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 if (CpuFeatures::IsSupported(SSE4_1)) { 1548 if (CpuFeatures::IsSupported(SSE4_1)) {
1550 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1549 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1551 MachineOperatorBuilder::kFloat64RoundTruncate; 1550 MachineOperatorBuilder::kFloat64RoundTruncate;
1552 } 1551 }
1553 return flags; 1552 return flags;
1554 } 1553 }
1555 1554
1556 } // namespace compiler 1555 } // namespace compiler
1557 } // namespace internal 1556 } // namespace internal
1558 } // namespace v8 1557 } // namespace v8
OLDNEW
« src/compiler/scheduler.cc ('K') | « src/compiler/scheduler.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698