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

Side by Side Diff: include/v8.h

Issue 23914004: invert Eternal::IsEmpty logic (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | test/cctest/test-global-handles.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 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698