Lines Matching full:location
30 class Location;
32 std::ostream& operator<<(std::ostream& os, const Location& location);
35 * A Location is an abstraction over the potential location
38 class Location : public ValueObject {
65 // Unallocated location represents a location that is not fixed and can be
66 // allocated by a register allocator. Each unallocated location has
67 // a policy that specifies what kind of location is suitable. Payload
72 Location() : ValueObject(), value_(kInvalid) {
73 // Verify that non-constant location kinds do not interfere with kConstant.
87 Location(const Location& other) : value_(other.value_) {}
89 Location& operator=(const Location& other) {
98 static Location ConstantLocation(HConstant* constant) {
100 return Location(kConstant | reinterpret_cast<uintptr_t>(constant));
116 // Empty location. Used if there the location should be ignored.
117 static Location NoLocation() {
118 return Location();
122 static Location RegisterLocation(int reg) {
123 return Location(kRegister, reg);
126 static Location FpuRegisterLocation(int reg) {
127 return Location(kFpuRegister, reg);
130 static Location RegisterPairLocation(int low, int high) {
131 return Location(kRegisterPair, low << 16 | high);
134 static Location FpuRegisterPairLocation(int low, int high) {
135 return Location(kFpuRegisterPair, low << 16 | high);
213 Location ToLow() const {
215 return Location::RegisterLocation(low());
217 return Location::FpuRegisterLocation(low());
220 return Location::StackSlot(GetStackIndex());
224 Location ToHigh() const {
226 return Location::RegisterLocation(high());
228 return Location::FpuRegisterLocation(high());
231 return Location::StackSlot(GetHighStackIndex(4));
241 static Location StackSlot(intptr_t stack_index) {
243 Location loc(kStackSlot, payload);
253 static Location DoubleStackSlot(intptr_t stack_index) {
255 Location loc(kDoubleStackSlot, payload);
281 bool Equals(Location other) const {
285 bool Contains(Location other) const {
294 bool OverlapsWith(Location other) const {
321 LOG(FATAL) << "Should not use this location kind";
339 static Location UnallocatedLocation(Policy policy) {
340 return Location(kUnallocated, PolicyField::Encode(policy));
343 // Any free register is suitable to replace this unallocated location.
344 static Location Any() {
348 static Location RequiresRegister() {
352 static Location RequiresFpuRegister() {
356 static Location RegisterOrConstant(HInstruction* instruction);
357 static Location RegisterOrInt32Constant(HInstruction* instruction);
358 static Location ByteRegisterOrConstant(int reg, HInstruction* instruction);
359 static Location FpuRegisterOrConstant(HInstruction* instruction);
360 static Location FpuRegisterOrInt32Constant(HInstruction* instruction);
362 // The location of the first input to the instruction will be
363 // used to replace this unallocated location.
364 static Location SameAsFirstInput() {
383 explicit Location(uintptr_t value) : value_(value) {}
385 Location(Kind kind, uintptr_t payload)
402 // Location either contains kind and payload fields or a tagged handle for
407 std::ostream& operator<<(std::ostream& os, const Location::Kind& rhs);
408 std::ostream& operator<<(std::ostream& os, const Location::Policy& rhs);
414 void Add(Location loc) {
423 void Remove(Location loc) {
485 void SetInAt(uint32_t at, Location location) {
486 inputs_[at] = location;
489 Location InAt(uint32_t at) const {
497 void SetOut(Location location, Location::OutputOverlap overlaps = Location::kOutputOverlap) {
500 output_ = location;
503 void UpdateOut(Location location) {
507 // 2) Unallocated location.
509 output_ = location;
512 void AddTemp(Location location) {
513 temps_.push_back(location);
516 Location GetTemp(uint32_t at) const {
520 void SetTempAt(uint32_t at, Location location) {
522 temps_[at] = location;
531 Location Out() const { return output_; }
558 void AddLiveRegister(Location location) {
559 live_registers_.Add(location);
577 && (output_.GetPolicy() == Location::kSameAsFirstInput);
581 Location input = inputs_[input_index];
590 return output_overlaps_ == Location::kOutputOverlap;
602 ArenaVector<Location> inputs_;
603 ArenaVector<Location> temps_;
606 Location::OutputOverlap output_overlaps_;
607 Location output_;