| 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()); |
| 318 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); | 314 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); |
| 319 if (handle.is_null()) { | 315 if (handle.is_null()) { |
| 320 raw_address_ = kEmptyHandleSentinel; | 316 raw_address_ = kEmptyHandleSentinel; |
| 321 } else { | 317 } else { |
| 322 raw_address_ = reinterpret_cast<Address>(*handle); | 318 raw_address_ = reinterpret_cast<Address>(*handle); |
| 323 ASSERT_NE(kEmptyHandleSentinel, raw_address_); | 319 ASSERT_NE(kEmptyHandleSentinel, raw_address_); |
| 324 } | 320 } |
| 325 ASSERT(IsInitialized()); | 321 ASSERT(IsInitialized()); |
| 326 } | 322 } |
| 327 | 323 |
| 328 bool IsInitialized() const { return raw_address_ != NULL; } | 324 bool IsInitialized() const { return raw_address_ != NULL; } |
| 329 | 325 |
| 330 bool operator==(const UniqueValueId& other) const { | 326 bool operator==(const UniqueValueId& other) const { |
| 331 ASSERT(IsInitialized() && other.IsInitialized()); | 327 ASSERT(IsInitialized() && other.IsInitialized()); |
| 332 return raw_address_ == other.raw_address_; | 328 return raw_address_ == other.raw_address_; |
| 333 } | 329 } |
| 334 | 330 |
| 335 bool operator!=(const UniqueValueId& other) const { | 331 bool operator!=(const UniqueValueId& other) const { |
| 336 ASSERT(IsInitialized() && other.IsInitialized()); | 332 ASSERT(IsInitialized() && other.IsInitialized()); |
| 337 return raw_address_ != other.raw_address_; | 333 return raw_address_ != other.raw_address_; |
| 338 } | 334 } |
| 339 | 335 |
| 340 intptr_t Hashcode() const { | 336 intptr_t Hashcode() const { |
| 341 ASSERT(IsInitialized()); | 337 ASSERT(IsInitialized()); |
| 342 return reinterpret_cast<intptr_t>(raw_address_); | 338 return reinterpret_cast<intptr_t>(raw_address_); |
| 343 } | 339 } |
| 344 | 340 |
| 341 #define IMMOVABLE_UNIQUE_VALUE_ID(name) \ |
| 342 static UniqueValueId name(Heap* heap) { return UniqueValueId(heap->name()); } |
| 343 |
| 344 IMMOVABLE_UNIQUE_VALUE_ID(free_space_map) |
| 345 IMMOVABLE_UNIQUE_VALUE_ID(minus_zero_value) |
| 346 IMMOVABLE_UNIQUE_VALUE_ID(nan_value) |
| 347 IMMOVABLE_UNIQUE_VALUE_ID(undefined_value) |
| 348 IMMOVABLE_UNIQUE_VALUE_ID(null_value) |
| 349 IMMOVABLE_UNIQUE_VALUE_ID(true_value) |
| 350 IMMOVABLE_UNIQUE_VALUE_ID(false_value) |
| 351 IMMOVABLE_UNIQUE_VALUE_ID(the_hole_value) |
| 352 IMMOVABLE_UNIQUE_VALUE_ID(empty_string) |
| 353 |
| 354 #undef IMMOVABLE_UNIQUE_VALUE_ID |
| 355 |
| 345 private: | 356 private: |
| 346 Address raw_address_; | 357 Address raw_address_; |
| 358 |
| 359 explicit UniqueValueId(Object* object) { |
| 360 raw_address_ = reinterpret_cast<Address>(object); |
| 361 ASSERT(IsInitialized()); |
| 362 } |
| 347 }; | 363 }; |
| 348 | 364 |
| 349 | 365 |
| 350 class HType V8_FINAL { | 366 class HType V8_FINAL { |
| 351 public: | 367 public: |
| 352 static HType None() { return HType(kNone); } | 368 static HType None() { return HType(kNone); } |
| 353 static HType Tagged() { return HType(kTagged); } | 369 static HType Tagged() { return HType(kTagged); } |
| 354 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } | 370 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } |
| 355 static HType TaggedNumber() { return HType(kTaggedNumber); } | 371 static HType TaggedNumber() { return HType(kTaggedNumber); } |
| 356 static HType Smi() { return HType(kSmi); } | 372 static HType Smi() { return HType(kSmi); } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 367 } | 383 } |
| 368 | 384 |
| 369 bool Equals(const HType& other) const { | 385 bool Equals(const HType& other) const { |
| 370 return type_ == other.type_; | 386 return type_ == other.type_; |
| 371 } | 387 } |
| 372 | 388 |
| 373 bool IsSubtypeOf(const HType& other) { | 389 bool IsSubtypeOf(const HType& other) { |
| 374 return Combine(other).Equals(other); | 390 return Combine(other).Equals(other); |
| 375 } | 391 } |
| 376 | 392 |
| 377 bool IsTagged() const { | |
| 378 return ((type_ & kTagged) == kTagged); | |
| 379 } | |
| 380 | |
| 381 bool IsTaggedPrimitive() const { | 393 bool IsTaggedPrimitive() const { |
| 382 return ((type_ & kTaggedPrimitive) == kTaggedPrimitive); | 394 return ((type_ & kTaggedPrimitive) == kTaggedPrimitive); |
| 383 } | 395 } |
| 384 | 396 |
| 385 bool IsTaggedNumber() const { | 397 bool IsTaggedNumber() const { |
| 386 return ((type_ & kTaggedNumber) == kTaggedNumber); | 398 return ((type_ & kTaggedNumber) == kTaggedNumber); |
| 387 } | 399 } |
| 388 | 400 |
| 389 bool IsSmi() const { | 401 bool IsSmi() const { |
| 390 return ((type_ & kSmi) == kSmi); | 402 return ((type_ & kSmi) == kSmi); |
| (...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3324 return true; | 3336 return true; |
| 3325 } | 3337 } |
| 3326 return false; | 3338 return false; |
| 3327 } | 3339 } |
| 3328 if (has_external_reference_value_) { | 3340 if (has_external_reference_value_) { |
| 3329 return false; | 3341 return false; |
| 3330 } | 3342 } |
| 3331 | 3343 |
| 3332 ASSERT(!handle_.is_null()); | 3344 ASSERT(!handle_.is_null()); |
| 3333 Heap* heap = isolate()->heap(); | 3345 Heap* heap = isolate()->heap(); |
| 3334 ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); | 3346 ASSERT(unique_id_ != UniqueValueId::minus_zero_value(heap)); |
| 3335 ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); | 3347 ASSERT(unique_id_ != UniqueValueId::nan_value(heap)); |
| 3336 return unique_id_ == UniqueValueId(heap->undefined_value()) || | 3348 return unique_id_ == UniqueValueId::undefined_value(heap) || |
| 3337 unique_id_ == UniqueValueId(heap->null_value()) || | 3349 unique_id_ == UniqueValueId::null_value(heap) || |
| 3338 unique_id_ == UniqueValueId(heap->true_value()) || | 3350 unique_id_ == UniqueValueId::true_value(heap) || |
| 3339 unique_id_ == UniqueValueId(heap->false_value()) || | 3351 unique_id_ == UniqueValueId::false_value(heap) || |
| 3340 unique_id_ == UniqueValueId(heap->the_hole_value()) || | 3352 unique_id_ == UniqueValueId::the_hole_value(heap) || |
| 3341 unique_id_ == UniqueValueId(heap->empty_string()); | 3353 unique_id_ == UniqueValueId::empty_string(heap); |
| 3342 } | 3354 } |
| 3343 | 3355 |
| 3344 bool IsCell() const { | 3356 bool IsCell() const { |
| 3345 return is_cell_; | 3357 return is_cell_; |
| 3346 } | 3358 } |
| 3347 | 3359 |
| 3348 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3360 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 3349 return Representation::None(); | 3361 return Representation::None(); |
| 3350 } | 3362 } |
| 3351 | 3363 |
| (...skipping 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6957 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6969 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6958 }; | 6970 }; |
| 6959 | 6971 |
| 6960 | 6972 |
| 6961 #undef DECLARE_INSTRUCTION | 6973 #undef DECLARE_INSTRUCTION |
| 6962 #undef DECLARE_CONCRETE_INSTRUCTION | 6974 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6963 | 6975 |
| 6964 } } // namespace v8::internal | 6976 } } // namespace v8::internal |
| 6965 | 6977 |
| 6966 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6978 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |