summaryrefslogtreecommitdiff
path: root/compiler/optimizing/locations.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/locations.cc')
-rw-r--r--compiler/optimizing/locations.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/optimizing/locations.cc b/compiler/optimizing/locations.cc
index 5879c6fa07..f40b7f4f0c 100644
--- a/compiler/optimizing/locations.cc
+++ b/compiler/optimizing/locations.cc
@@ -21,7 +21,7 @@
#include "code_generator.h"
#include "nodes.h"
-namespace art {
+namespace art HIDDEN {
// Verify that Location is trivially copyable.
static_assert(std::is_trivially_copyable<Location>::value, "Location should be trivially copyable");
@@ -57,7 +57,7 @@ LocationSummary::LocationSummary(HInstruction* instruction,
Location Location::RegisterOrConstant(HInstruction* instruction) {
return instruction->IsConstant()
- ? Location::ConstantLocation(instruction->AsConstant())
+ ? Location::ConstantLocation(instruction)
: Location::RequiresRegister();
}
@@ -85,16 +85,23 @@ Location Location::FpuRegisterOrInt32Constant(HInstruction* instruction) {
Location Location::ByteRegisterOrConstant(int reg, HInstruction* instruction) {
return instruction->IsConstant()
- ? Location::ConstantLocation(instruction->AsConstant())
+ ? Location::ConstantLocation(instruction)
: Location::RegisterLocation(reg);
}
Location Location::FpuRegisterOrConstant(HInstruction* instruction) {
return instruction->IsConstant()
- ? Location::ConstantLocation(instruction->AsConstant())
+ ? Location::ConstantLocation(instruction)
: Location::RequiresFpuRegister();
}
+void Location::DCheckInstructionIsConstant(HInstruction* instruction) {
+ DCHECK(instruction != nullptr);
+ DCHECK(instruction->IsConstant());
+ DCHECK_EQ(reinterpret_cast<uintptr_t>(instruction),
+ reinterpret_cast<uintptr_t>(instruction->AsConstant()));
+}
+
std::ostream& operator<<(std::ostream& os, const Location& location) {
os << location.DebugString();
if (location.IsRegister() || location.IsFpuRegister()) {