Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 int32_t upper_; | 302 int32_t upper_; |
| 303 Range* next_; | 303 Range* next_; |
| 304 bool can_be_minus_zero_; | 304 bool can_be_minus_zero_; |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 | 307 |
| 308 class UniqueValueId V8_FINAL { | 308 class UniqueValueId V8_FINAL { |
| 309 public: | 309 public: |
| 310 UniqueValueId() : raw_address_(NULL) { } | 310 UniqueValueId() : raw_address_(NULL) { } |
| 311 | 311 |
| 312 explicit UniqueValueId(Object* object) { | |
| 313 raw_address_ = reinterpret_cast<Address>(object); | |
| 314 ASSERT(IsInitialized()); | |
| 315 } | |
| 316 | |
| 317 explicit UniqueValueId(Handle<Object> handle) { | 312 explicit UniqueValueId(Handle<Object> handle) { |
| 313 ASSERT(!AllowHeapAllocation::IsAllowed() || | |
| 314 handle->IsSmi() || | |
| 315 HeapObject::cast(*handle)->GetHeap()->IsInRootsArray( | |
|
Toon Verwaest
2013/09/11 11:43:57
IsInRootsArray is wrong, given that the values in
| |
| 316 handle.location())); | |
| 318 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); | 317 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); |
| 319 if (handle.is_null()) { | 318 if (handle.is_null()) { |
| 320 raw_address_ = kEmptyHandleSentinel; | 319 raw_address_ = kEmptyHandleSentinel; |
| 321 } else { | 320 } else { |
| 322 raw_address_ = reinterpret_cast<Address>(*handle); | 321 raw_address_ = reinterpret_cast<Address>(*handle); |
| 323 ASSERT_NE(kEmptyHandleSentinel, raw_address_); | 322 ASSERT_NE(kEmptyHandleSentinel, raw_address_); |
| 324 } | 323 } |
| 325 ASSERT(IsInitialized()); | 324 ASSERT(IsInitialized()); |
| 326 } | 325 } |
| 327 | 326 |
| (...skipping 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3319 if (IsSpecialDouble()) { | 3318 if (IsSpecialDouble()) { |
| 3320 return true; | 3319 return true; |
| 3321 } | 3320 } |
| 3322 return false; | 3321 return false; |
| 3323 } | 3322 } |
| 3324 if (has_external_reference_value_) { | 3323 if (has_external_reference_value_) { |
| 3325 return false; | 3324 return false; |
| 3326 } | 3325 } |
| 3327 | 3326 |
| 3328 ASSERT(!handle_.is_null()); | 3327 ASSERT(!handle_.is_null()); |
| 3329 Heap* heap = isolate()->heap(); | 3328 Factory* factory = isolate()->factory(); |
| 3330 ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); | 3329 ASSERT(unique_id_ != UniqueValueId(factory->minus_zero_value())); |
| 3331 ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); | 3330 ASSERT(unique_id_ != UniqueValueId(factory->nan_value())); |
| 3332 return unique_id_ == UniqueValueId(heap->undefined_value()) || | 3331 return unique_id_ == UniqueValueId(factory->undefined_value()) || |
| 3333 unique_id_ == UniqueValueId(heap->null_value()) || | 3332 unique_id_ == UniqueValueId(factory->null_value()) || |
| 3334 unique_id_ == UniqueValueId(heap->true_value()) || | 3333 unique_id_ == UniqueValueId(factory->true_value()) || |
| 3335 unique_id_ == UniqueValueId(heap->false_value()) || | 3334 unique_id_ == UniqueValueId(factory->false_value()) || |
| 3336 unique_id_ == UniqueValueId(heap->the_hole_value()) || | 3335 unique_id_ == UniqueValueId(factory->the_hole_value()) || |
| 3337 unique_id_ == UniqueValueId(heap->empty_string()); | 3336 unique_id_ == UniqueValueId(factory->empty_string()); |
| 3338 } | 3337 } |
| 3339 | 3338 |
| 3340 bool IsCell() const { | 3339 bool IsCell() const { |
| 3341 return is_cell_; | 3340 return is_cell_; |
| 3342 } | 3341 } |
| 3343 | 3342 |
| 3344 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3343 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 3345 return Representation::None(); | 3344 return Representation::None(); |
| 3346 } | 3345 } |
| 3347 | 3346 |
| (...skipping 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6953 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6952 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6954 }; | 6953 }; |
| 6955 | 6954 |
| 6956 | 6955 |
| 6957 #undef DECLARE_INSTRUCTION | 6956 #undef DECLARE_INSTRUCTION |
| 6958 #undef DECLARE_CONCRETE_INSTRUCTION | 6957 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6959 | 6958 |
| 6960 } } // namespace v8::internal | 6959 } } // namespace v8::internal |
| 6961 | 6960 |
| 6962 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6961 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |