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

Unified Diff: test/cctest/compiler/test-gap-resolver.cc

Issue 1389373002: [turbofan] Create ExplicitOperands to specify operands without virtual registers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/register-allocator-verifier.cc ('k') | test/cctest/compiler/test-jump-threading.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-gap-resolver.cc
diff --git a/test/cctest/compiler/test-gap-resolver.cc b/test/cctest/compiler/test-gap-resolver.cc
index 42568961ce286f8074093ec4107a36a2d75ef8f2..9180f13afc11c353a1e5f734c9c63ca07de454a4 100644
--- a/test/cctest/compiler/test-gap-resolver.cc
+++ b/test/cctest/compiler/test-gap-resolver.cc
@@ -32,13 +32,17 @@ class InterpreterState {
private:
struct Key {
bool is_constant;
- AllocatedOperand::AllocatedKind kind;
+ bool is_float;
+ LocationOperand::LocationKind kind;
int index;
bool operator<(const Key& other) const {
if (this->is_constant != other.is_constant) {
return this->is_constant;
}
+ if (this->is_float != other.is_float) {
+ return this->is_float;
+ }
if (this->kind != other.kind) {
return this->kind < other.kind;
}
@@ -70,22 +74,24 @@ class InterpreterState {
static Key KeyFor(const InstructionOperand& op) {
bool is_constant = op.IsConstant();
- AllocatedOperand::AllocatedKind kind;
+ bool is_float = false;
+ LocationOperand::LocationKind kind;
int index;
if (!is_constant) {
if (op.IsRegister()) {
- index = AllocatedOperand::cast(op).GetRegister().code();
+ index = LocationOperand::cast(op).GetRegister().code();
} else if (op.IsDoubleRegister()) {
- index = AllocatedOperand::cast(op).GetDoubleRegister().code();
+ index = LocationOperand::cast(op).GetDoubleRegister().code();
} else {
- index = AllocatedOperand::cast(op).index();
+ index = LocationOperand::cast(op).index();
}
- kind = AllocatedOperand::cast(op).allocated_kind();
+ is_float = IsFloatingPoint(LocationOperand::cast(op).machine_type());
+ kind = LocationOperand::cast(op).location_kind();
} else {
index = ConstantOperand::cast(op).virtual_register();
- kind = AllocatedOperand::REGISTER;
+ kind = LocationOperand::REGISTER;
}
- Key key = {is_constant, kind, index};
+ Key key = {is_constant, is_float, kind, index};
return key;
}
@@ -192,18 +198,26 @@ class ParallelMoveCreator : public HandleAndZoneScope {
}
InstructionOperand CreateRandomOperand(bool is_source) {
- int index = rng_->NextInt(6);
+ int index = rng_->NextInt(7);
// destination can't be Constant.
- switch (rng_->NextInt(is_source ? 5 : 4)) {
+ switch (rng_->NextInt(is_source ? 7 : 6)) {
case 0:
- return StackSlotOperand(RandomType(), index);
+ return AllocatedOperand(LocationOperand::STACK_SLOT, RandomType(),
+ index);
case 1:
- return DoubleStackSlotOperand(RandomDoubleType(), index);
+ return AllocatedOperand(LocationOperand::STACK_SLOT, RandomDoubleType(),
+ index);
case 2:
- return RegisterOperand(RandomType(), index);
+ return AllocatedOperand(LocationOperand::REGISTER, RandomType(), index);
case 3:
- return DoubleRegisterOperand(RandomDoubleType(), index);
+ return AllocatedOperand(LocationOperand::REGISTER, RandomDoubleType(),
+ index);
case 4:
+ return ExplicitOperand(LocationOperand::REGISTER, RandomType(), 1);
+ case 5:
+ return ExplicitOperand(LocationOperand::STACK_SLOT, RandomType(),
+ index);
+ case 6:
return ConstantOperand(index);
}
UNREACHABLE();
« no previous file with comments | « src/compiler/register-allocator-verifier.cc ('k') | test/cctest/compiler/test-jump-threading.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698