Index: runtime/vm/assembler.h |
diff --git a/runtime/vm/assembler.h b/runtime/vm/assembler.h |
index 5d20c01b691cb3731f7ee60819f8bc36d21cf31c..65820fe916f17157282ee8b96758cecf777e8622 100644 |
--- a/runtime/vm/assembler.h |
+++ b/runtime/vm/assembler.h |
@@ -247,16 +247,8 @@ class ObjIndexPair { |
ObjIndexPair(Key key, Value value) : value_(value) { |
key_.type_ = key.type_; |
if (key.type_ == ObjectPool::kTaggedObject) { |
- if (key.obj_->IsNotTemporaryScopedHandle()) { |
- key_.obj_ = key.obj_; |
- } else { |
- key_.obj_ = &Object::ZoneHandle(key.obj_->raw()); |
- } |
- if (key.equivalence_->IsNotTemporaryScopedHandle()) { |
- key_.equivalence_ = key.equivalence_; |
- } else { |
- key_.equivalence_ = &Object::ZoneHandle(key.equivalence_->raw()); |
- } |
+ key_.obj_ = key.obj_; |
+ key_.equivalence_ = key.equivalence_; |
} else { |
key_.raw_value_ = key.raw_value_; |
} |
@@ -273,20 +265,12 @@ class ObjIndexPair { |
if (key.obj_->IsSmi()) { |
return Smi::Cast(*key.obj_).Value(); |
} |
- if (key.obj_->IsDouble()) { |
- return static_cast<intptr_t>( |
- bit_cast<int32_t, float>( |
- static_cast<float>(Double::Cast(*key.obj_).value()))); |
- } |
- if (key.obj_->IsMint()) { |
- return static_cast<intptr_t>(Mint::Cast(*key.obj_).value()); |
- } |
- if (key.obj_->IsString()) { |
- return String::Cast(*key.obj_).Hash(); |
- } |
- // TODO(fschneider): Add hash function for other classes commonly used as |
- // compile-time constants. |
- return key.obj_->GetClassId(); |
+ // TODO(asiva) For now we assert that the object is from Old space |
+ // and use the address of the raw object, once the weak_entry_table code |
+ // in heap allows for multiple thread access we should switch this code |
+ // to create a temporary raw obj => id mapping and use that. |
+ ASSERT(key.obj_->IsOld()); |
+ return reinterpret_cast<intptr_t>(key.obj_->raw()); |
} |
static inline bool IsKeyEqual(Pair kv, Key key) { |