Commit 89df3ab8 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

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/647628Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47784}
parent 9eb3c7fb
...@@ -101,25 +101,6 @@ class LinkageLocation { ...@@ -101,25 +101,6 @@ class LinkageLocation {
return caller_location; 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_; } MachineType GetType() const { return machine_type_; }
int GetSize() const { int GetSize() const {
...@@ -156,6 +137,22 @@ class LinkageLocation { ...@@ -156,6 +137,22 @@ class LinkageLocation {
return GetLocation(); 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_; int32_t bit_field_;
MachineType machine_type_; MachineType machine_type_;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment