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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 const v8::Persistent<T>& persistent) { | 285 const v8::Persistent<T>& persistent) { |
286 return v8::internal::Handle<v8::internal::Object>( | 286 return v8::internal::Handle<v8::internal::Object>( |
287 reinterpret_cast<v8::internal::Object**>(persistent.val_)); | 287 reinterpret_cast<v8::internal::Object**>(persistent.val_)); |
288 } | 288 } |
289 | 289 |
290 template <class T> | 290 template <class T> |
291 static inline v8::internal::Handle<v8::internal::Object> OpenPersistent( | 291 static inline v8::internal::Handle<v8::internal::Object> OpenPersistent( |
292 v8::Persistent<T>* persistent) { | 292 v8::Persistent<T>* persistent) { |
293 return OpenPersistent(*persistent); | 293 return OpenPersistent(*persistent); |
294 } | 294 } |
| 295 |
| 296 template <class From, class To> |
| 297 static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) { |
| 298 return OpenHandle(*handle); |
| 299 } |
295 }; | 300 }; |
296 | 301 |
297 | 302 |
298 template <class T> | 303 template <class T> |
299 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( | 304 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( |
300 v8::HandleScope* scope) { | 305 v8::HandleScope* scope) { |
301 v8::internal::Handle<T> handle; | 306 v8::internal::Handle<T> handle; |
302 if (!is_null()) { | 307 if (!is_null()) { |
303 handle = *this; | 308 handle = *this; |
304 } | 309 } |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 stress_type_ = stress_type; | 687 stress_type_ = stress_type; |
683 } | 688 } |
684 | 689 |
685 private: | 690 private: |
686 static v8::Testing::StressType stress_type_; | 691 static v8::Testing::StressType stress_type_; |
687 }; | 692 }; |
688 | 693 |
689 } } // namespace v8::internal | 694 } } // namespace v8::internal |
690 | 695 |
691 #endif // V8_API_H_ | 696 #endif // V8_API_H_ |
OLD | NEW |