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

Unified Diff: src/compiler/instruction-selector-impl.h

Issue 1262343002: [turbofan]: Add better encapsulation to LinkageLocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Really fix it this time Created 5 years, 5 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/c-linkage.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector-impl.h
diff --git a/src/compiler/instruction-selector-impl.h b/src/compiler/instruction-selector-impl.h
index b34a914efcca285a4a80aa6470be2b16a7d8893b..db9e100e018b429a8718475d348a795b51292035 100644
--- a/src/compiler/instruction-selector-impl.h
+++ b/src/compiler/instruction-selector-impl.h
@@ -208,30 +208,28 @@ class OperandGenerator {
UnallocatedOperand ToUnallocatedOperand(LinkageLocation location,
MachineType type,
int virtual_register) {
- if (location.location_ == LinkageLocation::ANY_REGISTER) {
+ if (location.IsAnyRegister()) {
// any machine register.
return UnallocatedOperand(UnallocatedOperand::MUST_HAVE_REGISTER,
virtual_register);
}
- if (location.location_ < 0) {
+ if (location.IsCallerFrameSlot()) {
// a location on the caller frame.
return UnallocatedOperand(UnallocatedOperand::FIXED_SLOT,
- location.location_, virtual_register);
+ location.AsCallerFrameSlot(), virtual_register);
}
- if (location.location_ > LinkageLocation::ANY_REGISTER) {
+ if (location.IsCalleeFrameSlot()) {
// a spill location on this (callee) frame.
- return UnallocatedOperand(
- UnallocatedOperand::FIXED_SLOT,
- location.location_ - LinkageLocation::ANY_REGISTER - 1,
- virtual_register);
+ return UnallocatedOperand(UnallocatedOperand::FIXED_SLOT,
+ location.AsCalleeFrameSlot(), virtual_register);
}
// a fixed register.
if (RepresentationOf(type) == kRepFloat64) {
return UnallocatedOperand(UnallocatedOperand::FIXED_DOUBLE_REGISTER,
- location.location_, virtual_register);
+ location.AsRegister(), virtual_register);
}
return UnallocatedOperand(UnallocatedOperand::FIXED_REGISTER,
- location.location_, virtual_register);
+ location.AsRegister(), virtual_register);
}
InstructionSelector* selector_;
« no previous file with comments | « src/compiler/c-linkage.cc ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698