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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 inline bool ToObject(Object** obj) { | 766 inline bool ToObject(Object** obj) { |
767 if (IsFailure()) return false; | 767 if (IsFailure()) return false; |
768 *obj = reinterpret_cast<Object*>(this); | 768 *obj = reinterpret_cast<Object*>(this); |
769 return true; | 769 return true; |
770 } | 770 } |
771 inline Failure* ToFailureUnchecked() { | 771 inline Failure* ToFailureUnchecked() { |
772 ASSERT(IsFailure()); | 772 ASSERT(IsFailure()); |
773 return reinterpret_cast<Failure*>(this); | 773 return reinterpret_cast<Failure*>(this); |
774 } | 774 } |
775 inline Object* ToObjectUnchecked() { | 775 inline Object* ToObjectUnchecked() { |
776 ASSERT(!IsFailure()); | 776 // TODO(jkummerow): Turn this back into an ASSERT when we can be certain |
| 777 // that it never fires in Release mode in the wild. |
| 778 CHECK(!IsFailure()); |
777 return reinterpret_cast<Object*>(this); | 779 return reinterpret_cast<Object*>(this); |
778 } | 780 } |
779 inline Object* ToObjectChecked() { | 781 inline Object* ToObjectChecked() { |
780 CHECK(!IsFailure()); | 782 CHECK(!IsFailure()); |
781 return reinterpret_cast<Object*>(this); | 783 return reinterpret_cast<Object*>(this); |
782 } | 784 } |
783 | 785 |
784 template<typename T> | 786 template<typename T> |
785 inline bool To(T** obj) { | 787 inline bool To(T** obj) { |
786 if (IsFailure()) return false; | 788 if (IsFailure()) return false; |
(...skipping 8302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9089 } else { | 9091 } else { |
9090 value &= ~(1 << bit_position); | 9092 value &= ~(1 << bit_position); |
9091 } | 9093 } |
9092 return value; | 9094 return value; |
9093 } | 9095 } |
9094 }; | 9096 }; |
9095 | 9097 |
9096 } } // namespace v8::internal | 9098 } } // namespace v8::internal |
9097 | 9099 |
9098 #endif // V8_OBJECTS_H_ | 9100 #endif // V8_OBJECTS_H_ |
OLD | NEW |