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) { |
|
Toon Verwaest
2013/09/11 12:51:25
Euh, shouldn't remove the useful new assert though
Yang
2013/09/11 12:54:44
Right. Forgot to add that assert in the second att
| |
| 318 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); | 313 static const Address kEmptyHandleSentinel = reinterpret_cast<Address>(1); |
| 319 if (handle.is_null()) { | 314 if (handle.is_null()) { |
| 320 raw_address_ = kEmptyHandleSentinel; | 315 raw_address_ = kEmptyHandleSentinel; |
| 321 } else { | 316 } else { |
| 322 raw_address_ = reinterpret_cast<Address>(*handle); | 317 raw_address_ = reinterpret_cast<Address>(*handle); |
| 323 ASSERT_NE(kEmptyHandleSentinel, raw_address_); | 318 ASSERT_NE(kEmptyHandleSentinel, raw_address_); |
| 324 } | 319 } |
| 325 ASSERT(IsInitialized()); | 320 ASSERT(IsInitialized()); |
| 326 } | 321 } |
| 327 | 322 |
| 328 bool IsInitialized() const { return raw_address_ != NULL; } | 323 bool IsInitialized() const { return raw_address_ != NULL; } |
| 329 | 324 |
| 330 bool operator==(const UniqueValueId& other) const { | 325 bool operator==(const UniqueValueId& other) const { |
| 331 ASSERT(IsInitialized() && other.IsInitialized()); | 326 ASSERT(IsInitialized() && other.IsInitialized()); |
| 332 return raw_address_ == other.raw_address_; | 327 return raw_address_ == other.raw_address_; |
| 333 } | 328 } |
| 334 | 329 |
| 335 bool operator!=(const UniqueValueId& other) const { | 330 bool operator!=(const UniqueValueId& other) const { |
| 336 ASSERT(IsInitialized() && other.IsInitialized()); | 331 ASSERT(IsInitialized() && other.IsInitialized()); |
| 337 return raw_address_ != other.raw_address_; | 332 return raw_address_ != other.raw_address_; |
| 338 } | 333 } |
| 339 | 334 |
| 340 intptr_t Hashcode() const { | 335 intptr_t Hashcode() const { |
| 341 ASSERT(IsInitialized()); | 336 ASSERT(IsInitialized()); |
| 342 return reinterpret_cast<intptr_t>(raw_address_); | 337 return reinterpret_cast<intptr_t>(raw_address_); |
| 343 } | 338 } |
| 344 | 339 |
| 340 #define IMMOVABLE_UNIQUE_VALUE_ID(name) \ | |
| 341 static UniqueValueId name(Heap* heap) { \ | |
| 342 return UniqueValueId(heap->name()); \ | |
| 343 } | |
| 344 | |
| 345 IMMOVABLE_UNIQUE_VALUE_ID(free_space_map) | |
| 346 IMMOVABLE_UNIQUE_VALUE_ID(minus_zero_value) | |
| 347 IMMOVABLE_UNIQUE_VALUE_ID(nan_value) | |
| 348 IMMOVABLE_UNIQUE_VALUE_ID(undefined_value) | |
| 349 IMMOVABLE_UNIQUE_VALUE_ID(null_value) | |
| 350 IMMOVABLE_UNIQUE_VALUE_ID(true_value) | |
| 351 IMMOVABLE_UNIQUE_VALUE_ID(false_value) | |
| 352 IMMOVABLE_UNIQUE_VALUE_ID(the_hole_value) | |
| 353 IMMOVABLE_UNIQUE_VALUE_ID(empty_string) | |
| 354 | |
| 355 #undef IMMOVABLE_UNIQUE_VALUE_ID | |
| 356 | |
| 345 private: | 357 private: |
| 346 Address raw_address_; | 358 Address raw_address_; |
| 359 | |
| 360 explicit UniqueValueId(Object* object) { | |
| 361 raw_address_ = reinterpret_cast<Address>(object); | |
| 362 ASSERT(IsInitialized()); | |
| 363 } | |
| 347 }; | 364 }; |
| 348 | 365 |
| 349 | 366 |
| 350 class HType V8_FINAL { | 367 class HType V8_FINAL { |
| 351 public: | 368 public: |
| 352 static HType None() { return HType(kNone); } | 369 static HType None() { return HType(kNone); } |
| 353 static HType Tagged() { return HType(kTagged); } | 370 static HType Tagged() { return HType(kTagged); } |
| 354 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } | 371 static HType TaggedPrimitive() { return HType(kTaggedPrimitive); } |
| 355 static HType TaggedNumber() { return HType(kTaggedNumber); } | 372 static HType TaggedNumber() { return HType(kTaggedNumber); } |
| 356 static HType Smi() { return HType(kSmi); } | 373 static HType Smi() { return HType(kSmi); } |
| (...skipping 2963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3320 return true; | 3337 return true; |
| 3321 } | 3338 } |
| 3322 return false; | 3339 return false; |
| 3323 } | 3340 } |
| 3324 if (has_external_reference_value_) { | 3341 if (has_external_reference_value_) { |
| 3325 return false; | 3342 return false; |
| 3326 } | 3343 } |
| 3327 | 3344 |
| 3328 ASSERT(!handle_.is_null()); | 3345 ASSERT(!handle_.is_null()); |
| 3329 Heap* heap = isolate()->heap(); | 3346 Heap* heap = isolate()->heap(); |
| 3330 ASSERT(unique_id_ != UniqueValueId(heap->minus_zero_value())); | 3347 ASSERT(unique_id_ != UniqueValueId::minus_zero_value(heap)); |
| 3331 ASSERT(unique_id_ != UniqueValueId(heap->nan_value())); | 3348 ASSERT(unique_id_ != UniqueValueId::nan_value(heap)); |
| 3332 return unique_id_ == UniqueValueId(heap->undefined_value()) || | 3349 return unique_id_ == UniqueValueId::undefined_value(heap) || |
| 3333 unique_id_ == UniqueValueId(heap->null_value()) || | 3350 unique_id_ == UniqueValueId::null_value(heap) || |
| 3334 unique_id_ == UniqueValueId(heap->true_value()) || | 3351 unique_id_ == UniqueValueId::true_value(heap) || |
| 3335 unique_id_ == UniqueValueId(heap->false_value()) || | 3352 unique_id_ == UniqueValueId::false_value(heap) || |
| 3336 unique_id_ == UniqueValueId(heap->the_hole_value()) || | 3353 unique_id_ == UniqueValueId::the_hole_value(heap) || |
| 3337 unique_id_ == UniqueValueId(heap->empty_string()); | 3354 unique_id_ == UniqueValueId::empty_string(heap); |
| 3338 } | 3355 } |
| 3339 | 3356 |
| 3340 bool IsCell() const { | 3357 bool IsCell() const { |
| 3341 return is_cell_; | 3358 return is_cell_; |
| 3342 } | 3359 } |
| 3343 | 3360 |
| 3344 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3361 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 3345 return Representation::None(); | 3362 return Representation::None(); |
| 3346 } | 3363 } |
| 3347 | 3364 |
| (...skipping 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6953 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 6970 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 6954 }; | 6971 }; |
| 6955 | 6972 |
| 6956 | 6973 |
| 6957 #undef DECLARE_INSTRUCTION | 6974 #undef DECLARE_INSTRUCTION |
| 6958 #undef DECLARE_CONCRETE_INSTRUCTION | 6975 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6959 | 6976 |
| 6960 } } // namespace v8::internal | 6977 } } // namespace v8::internal |
| 6961 | 6978 |
| 6962 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6979 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |