Make LinkageLocation getters public
This allows to reuse this logic in the wasm baseline compiler to determine the location of our parameters. R=mstarzinger@chromium.org CC=titzer@chromium.org Bug: v8:6600 Change-Id: I86e4d425d1c8aa35f0f722d311a2bd830b951d0a Reviewed-on: https://chromium-review.googlesource.com/647628 Reviewed-by: Ben Titzer <titzer@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#47784}
This commit is contained in:
parent
9eb3c7fb3b
commit
89df3ab84f
@ -101,25 +101,6 @@ class LinkageLocation {
|
||||
return caller_location;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class CallDescriptor;
|
||||
friend class OperandGenerator;
|
||||
|
||||
enum LocationType { REGISTER, STACK_SLOT };
|
||||
|
||||
class TypeField : public BitField<LocationType, 0, 1> {};
|
||||
class LocationField : public BitField<int32_t, TypeField::kNext, 31> {};
|
||||
|
||||
static const int32_t ANY_REGISTER = -1;
|
||||
static const int32_t MAX_STACK_SLOT = 32767;
|
||||
|
||||
LinkageLocation(LocationType type, int32_t location,
|
||||
MachineType machine_type) {
|
||||
bit_field_ = TypeField::encode(type) |
|
||||
((location << LocationField::kShift) & LocationField::kMask);
|
||||
machine_type_ = machine_type;
|
||||
}
|
||||
|
||||
MachineType GetType() const { return machine_type_; }
|
||||
|
||||
int GetSize() const {
|
||||
@ -156,6 +137,22 @@ class LinkageLocation {
|
||||
return GetLocation();
|
||||
}
|
||||
|
||||
private:
|
||||
enum LocationType { REGISTER, STACK_SLOT };
|
||||
|
||||
class TypeField : public BitField<LocationType, 0, 1> {};
|
||||
class LocationField : public BitField<int32_t, TypeField::kNext, 31> {};
|
||||
|
||||
static constexpr int32_t ANY_REGISTER = -1;
|
||||
static constexpr int32_t MAX_STACK_SLOT = 32767;
|
||||
|
||||
LinkageLocation(LocationType type, int32_t location,
|
||||
MachineType machine_type) {
|
||||
bit_field_ = TypeField::encode(type) |
|
||||
((location << LocationField::kShift) & LocationField::kMask);
|
||||
machine_type_ = machine_type;
|
||||
}
|
||||
|
||||
int32_t bit_field_;
|
||||
MachineType machine_type_;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user