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

Side by Side Diff: src/handles.h

Issue 223653003: Return MaybeHandle from NewExternalStringFrom*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months 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/factory.cc ('k') | test/cctest/test-api.cc » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 INLINE(bool ToHandle(Handle<T>* out)) { 75 INLINE(bool ToHandle(Handle<T>* out)) {
76 if (location_ == NULL) { 76 if (location_ == NULL) {
77 *out = Handle<T>::null(); 77 *out = Handle<T>::null();
78 return false; 78 return false;
79 } else { 79 } else {
80 *out = Handle<T>(location_); 80 *out = Handle<T>(location_);
81 return true; 81 return true;
82 } 82 }
83 } 83 }
84 84
85 bool is_null() const { return location_ == NULL; }
86
85 protected: 87 protected:
86 T** location_; 88 T** location_;
87 89
88 // MaybeHandles of different classes are allowed to access each 90 // MaybeHandles of different classes are allowed to access each
89 // other's location_. 91 // other's location_.
90 template<class S> friend class MaybeHandle; 92 template<class S> friend class MaybeHandle;
91 }; 93 };
92 94
93 // ---------------------------------------------------------------------------- 95 // ----------------------------------------------------------------------------
94 // A Handle provides a reference to an object that survives relocation by 96 // A Handle provides a reference to an object that survives relocation by
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 381
380 void Initialize() { 382 void Initialize() {
381 next = limit = NULL; 383 next = limit = NULL;
382 level = 0; 384 level = 0;
383 } 385 }
384 }; 386 };
385 387
386 } } // namespace v8::internal 388 } } // namespace v8::internal
387 389
388 #endif // V8_HANDLES_H_ 390 #endif // V8_HANDLES_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698