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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 template <class T> class Eternal { | 451 template <class T> class Eternal { |
452 public: | 452 public: |
453 V8_INLINE(Eternal()) : index_(kInitialValue) { } | 453 V8_INLINE(Eternal()) : index_(kInitialValue) { } |
454 template<class S> | 454 template<class S> |
455 V8_INLINE(Eternal(Isolate* isolate, Local<S> handle)) | 455 V8_INLINE(Eternal(Isolate* isolate, Local<S> handle)) |
456 : index_(kInitialValue) { | 456 : index_(kInitialValue) { |
457 Set(isolate, handle); | 457 Set(isolate, handle); |
458 } | 458 } |
459 // Can only be safely called if already set. | 459 // Can only be safely called if already set. |
460 V8_INLINE(Local<T> Get(Isolate* isolate)); | 460 V8_INLINE(Local<T> Get(Isolate* isolate)); |
461 V8_INLINE(bool IsEmpty()) { return index_ != kInitialValue; } | 461 V8_INLINE(bool IsEmpty()) { return index_ == kInitialValue; } |
462 template<class S> | 462 template<class S> |
463 V8_INLINE(void Set(Isolate* isolate, Local<S> handle)); | 463 V8_INLINE(void Set(Isolate* isolate, Local<S> handle)); |
464 | 464 |
465 private: | 465 private: |
466 static const int kInitialValue = -1; | 466 static const int kInitialValue = -1; |
467 int index_; | 467 int index_; |
468 }; | 468 }; |
469 | 469 |
470 | 470 |
471 /** | 471 /** |
(...skipping 6062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6534 */ | 6534 */ |
6535 | 6535 |
6536 | 6536 |
6537 } // namespace v8 | 6537 } // namespace v8 |
6538 | 6538 |
6539 | 6539 |
6540 #undef TYPE_CHECK | 6540 #undef TYPE_CHECK |
6541 | 6541 |
6542 | 6542 |
6543 #endif // V8_H_ | 6543 #endif // V8_H_ |
OLD | NEW |