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 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2760 // Dereferencing to use the object's raw address for hashing is safe. | 2760 // Dereferencing to use the object's raw address for hashing is safe. |
2761 AllowHandleDereference allow_handle_deref; | 2761 AllowHandleDereference allow_handle_deref; |
2762 intptr_t hash = 0; | 2762 intptr_t hash = 0; |
2763 for (int i = 0; i < prototypes_.length(); i++) { | 2763 for (int i = 0; i < prototypes_.length(); i++) { |
2764 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]); | 2764 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]); |
2765 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]); | 2765 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]); |
2766 } | 2766 } |
2767 return hash; | 2767 return hash; |
2768 } | 2768 } |
2769 | 2769 |
| 2770 bool CanOmitPrototypeChecks() { |
| 2771 for (int i = 0; i < maps()->length(); i++) { |
| 2772 if (!maps()->at(i)->CanOmitPrototypeChecks()) return false; |
| 2773 } |
| 2774 return true; |
| 2775 } |
| 2776 |
2770 protected: | 2777 protected: |
2771 virtual bool DataEquals(HValue* other) { | 2778 virtual bool DataEquals(HValue* other) { |
2772 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); | 2779 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); |
2773 #ifdef DEBUG | 2780 #ifdef DEBUG |
2774 if (prototypes_.length() != b->prototypes()->length()) return false; | 2781 if (prototypes_.length() != b->prototypes()->length()) return false; |
2775 for (int i = 0; i < prototypes_.length(); i++) { | 2782 for (int i = 0; i < prototypes_.length(); i++) { |
2776 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false; | 2783 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false; |
2777 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false; | 2784 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false; |
2778 } | 2785 } |
2779 return true; | 2786 return true; |
(...skipping 3245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6025 virtual bool IsDeletable() const { return true; } | 6032 virtual bool IsDeletable() const { return true; } |
6026 }; | 6033 }; |
6027 | 6034 |
6028 | 6035 |
6029 #undef DECLARE_INSTRUCTION | 6036 #undef DECLARE_INSTRUCTION |
6030 #undef DECLARE_CONCRETE_INSTRUCTION | 6037 #undef DECLARE_CONCRETE_INSTRUCTION |
6031 | 6038 |
6032 } } // namespace v8::internal | 6039 } } // namespace v8::internal |
6033 | 6040 |
6034 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6041 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |