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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 */ | 483 */ |
484 template <class T> class Persistent // NOLINT | 484 template <class T> class Persistent // NOLINT |
485 #ifdef V8_USE_UNSAFE_HANDLES | 485 #ifdef V8_USE_UNSAFE_HANDLES |
486 : public Handle<T> { | 486 : public Handle<T> { |
487 #else | 487 #else |
488 { // NOLINT | 488 { // NOLINT |
489 #endif | 489 #endif |
490 public: | 490 public: |
491 #ifndef V8_USE_UNSAFE_HANDLES | 491 #ifndef V8_USE_UNSAFE_HANDLES |
492 V8_INLINE(Persistent()) : val_(0) { } | 492 V8_INLINE(Persistent()) : val_(0) { } |
493 V8_INLINE(~Persistent()) { | 493 // TODO(dcarney): add this back before cutover. |
494 // TODO(dcarney): add this back before cutover. | 494 // V8_INLINE(~Persistent()) { |
495 // Dispose(); | 495 // Dispose(); |
496 } | 496 // } |
497 V8_INLINE(bool IsEmpty() const) { return val_ == 0; } | 497 V8_INLINE(bool IsEmpty() const) { return val_ == 0; } |
498 // TODO(dcarney): remove somehow before cutover | 498 // TODO(dcarney): remove somehow before cutover |
499 // The handle should either be 0, or a pointer to a live cell. | 499 // The handle should either be 0, or a pointer to a live cell. |
500 V8_INLINE(void Clear()) { val_ = 0; } | 500 V8_INLINE(void Clear()) { val_ = 0; } |
501 | 501 |
502 /** | 502 /** |
503 * A constructor that creates a new global cell pointing to that. In contrast | 503 * A constructor that creates a new global cell pointing to that. In contrast |
504 * to the copy constructor, this creates a new persistent handle which needs | 504 * to the copy constructor, this creates a new persistent handle which needs |
505 * to be separately disposed. | 505 * to be separately disposed. |
506 */ | 506 */ |
(...skipping 5858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6365 | 6365 |
6366 | 6366 |
6367 } // namespace v8 | 6367 } // namespace v8 |
6368 | 6368 |
6369 | 6369 |
6370 #undef V8EXPORT | 6370 #undef V8EXPORT |
6371 #undef TYPE_CHECK | 6371 #undef TYPE_CHECK |
6372 | 6372 |
6373 | 6373 |
6374 #endif // V8_H_ | 6374 #endif // V8_H_ |
OLD | NEW |