Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Side by Side Diff: src/objects.h

Issue 11475027: Flush out potential leaks of Failure objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comment Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 8297 matching lines...) Expand 10 before | Expand all | Expand 10 after
9084 } else { 9086 } else {
9085 value &= ~(1 << bit_position); 9087 value &= ~(1 << bit_position);
9086 } 9088 }
9087 return value; 9089 return value;
9088 } 9090 }
9089 }; 9091 };
9090 9092
9091 } } // namespace v8::internal 9093 } } // namespace v8::internal
9092 9094
9093 #endif // V8_OBJECTS_H_ 9095 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698