Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index aa2cdae0a83190b00c7dbdd132f9066e518f49ae..a6e5a23e062fc4062b65fdd7052dd58f1e90282a 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -309,12 +309,11 @@ class UniqueValueId V8_FINAL { |
| public: |
| UniqueValueId() : raw_address_(NULL) { } |
| - explicit UniqueValueId(Object* object) { |
| - raw_address_ = reinterpret_cast<Address>(object); |
| - ASSERT(IsInitialized()); |
| - } |
| - |
| explicit UniqueValueId(Handle<Object> handle) { |
| + ASSERT(!AllowHeapAllocation::IsAllowed() || |
| + handle->IsSmi() || |
| + HeapObject::cast(*handle)->GetHeap()->IsInRootsArray( |
|
Toon Verwaest
2013/09/11 11:43:57
IsInRootsArray is wrong, given that the values in
|
| + handle.location())); |
| static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); |
| if (handle.is_null()) { |
| raw_address_ = kEmptyHandleSentinel; |
| @@ -3326,15 +3325,15 @@ class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| } |
| ASSERT(!handle_.is_null()); |
| - Heap* heap = isolate()->heap(); |
| - ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); |
| - ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); |
| - return unique_id_ == UniqueValueId(heap->undefined_value()) || |
| - unique_id_ == UniqueValueId(heap->null_value()) || |
| - unique_id_ == UniqueValueId(heap->true_value()) || |
| - unique_id_ == UniqueValueId(heap->false_value()) || |
| - unique_id_ == UniqueValueId(heap->the_hole_value()) || |
| - unique_id_ == UniqueValueId(heap->empty_string()); |
| + Factory* factory = isolate()->factory(); |
| + ASSERT(unique_id_ != UniqueValueId(factory->minus_zero_value())); |
| + ASSERT(unique_id_ != UniqueValueId(factory->nan_value())); |
| + return unique_id_ == UniqueValueId(factory->undefined_value()) || |
| + unique_id_ == UniqueValueId(factory->null_value()) || |
| + unique_id_ == UniqueValueId(factory->true_value()) || |
| + unique_id_ == UniqueValueId(factory->false_value()) || |
| + unique_id_ == UniqueValueId(factory->the_hole_value()) || |
| + unique_id_ == UniqueValueId(factory->empty_string()); |
| } |
| bool IsCell() const { |