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

Unified Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 1534593004: [turbofan] Pass type information of arguments to EmitPrepareArguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle float32 and float64 differently. Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ia32/instruction-scheduler-ia32.cc ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ia32/instruction-selector-ia32.cc
diff --git a/src/compiler/ia32/instruction-selector-ia32.cc b/src/compiler/ia32/instruction-selector-ia32.cc
index f96eb274d32a80d03fef8022269cd888f8d51dcc..857bb4d5785c19953981c74dfcd09d3fd9141552 100644
--- a/src/compiler/ia32/instruction-selector-ia32.cc
+++ b/src/compiler/ia32/instruction-selector-ia32.cc
@@ -896,9 +896,9 @@ void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) {
}
-void InstructionSelector::EmitPrepareArguments(NodeVector* arguments,
- const CallDescriptor* descriptor,
- Node* node) {
+void InstructionSelector::EmitPrepareArguments(
+ ZoneVector<PushParameter>* arguments, const CallDescriptor* descriptor,
+ Node* node) {
IA32OperandGenerator g(this);
// Prepare for C function call.
@@ -911,29 +911,34 @@ void InstructionSelector::EmitPrepareArguments(NodeVector* arguments,
// Poke any stack arguments.
for (size_t n = 0; n < arguments->size(); ++n) {
- if (Node* input = (*arguments)[n]) {
+ PushParameter input = (*arguments)[n];
+ if (input.node()) {
int const slot = static_cast<int>(n);
InstructionOperand value = g.CanBeImmediate(node)
- ? g.UseImmediate(input)
- : g.UseRegister(input);
+ ? g.UseImmediate(input.node())
+ : g.UseRegister(input.node());
Emit(kIA32Poke | MiscField::encode(slot), g.NoOutput(), value);
}
}
} else {
// Push any stack arguments.
- for (Node* input : base::Reversed(*arguments)) {
+ for (PushParameter input : base::Reversed(*arguments)) {
// Skip any alignment holes in pushed nodes.
- if (input == nullptr) continue;
- // TODO(titzer): IA32Push cannot handle stack->stack double moves
- // because there is no way to encode fixed double slots.
+ if (input.node() == nullptr) continue;
InstructionOperand value =
- g.CanBeImmediate(input)
- ? g.UseImmediate(input)
+ g.CanBeImmediate(input.node())
+ ? g.UseImmediate(input.node())
: IsSupported(ATOM) ||
- sequence()->IsFloat(GetVirtualRegister(input))
- ? g.UseRegister(input)
- : g.Use(input);
- Emit(kIA32Push, g.NoOutput(), value);
+ sequence()->IsFloat(GetVirtualRegister(input.node()))
+ ? g.UseRegister(input.node())
+ : g.Use(input.node());
+ if (input.type() == MachineType::Float32()) {
+ Emit(kIA32PushFloat32, g.NoOutput(), value);
+ } else if (input.type() == MachineType::Float64()) {
+ Emit(kIA32PushFloat64, g.NoOutput(), value);
+ } else {
+ Emit(kIA32Push, g.NoOutput(), value);
+ }
}
}
}
« no previous file with comments | « src/compiler/ia32/instruction-scheduler-ia32.cc ('k') | src/compiler/instruction-selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698