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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 template <class From, class To> | 302 template <class From, class To> |
303 static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) { | 303 static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) { |
304 return OpenHandle(*handle); | 304 return OpenHandle(*handle); |
305 } | 305 } |
306 }; | 306 }; |
307 | 307 |
308 | 308 |
309 template <class T> | 309 template <class T> |
310 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( | 310 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( |
311 v8::HandleScope* scope) { | 311 v8::EscapableHandleScope* scope) { |
312 v8::internal::Handle<T> handle; | 312 v8::internal::Handle<T> handle; |
313 if (!is_null()) { | 313 if (!is_null()) { |
314 handle = *this; | 314 handle = *this; |
315 } | 315 } |
316 return Utils::OpenHandle(*scope->Close(Utils::ToLocal(handle)), true); | 316 return Utils::OpenHandle(*scope->Escape(Utils::ToLocal(handle)), true); |
317 } | 317 } |
318 | 318 |
319 | 319 |
320 template <class T> | 320 template <class T> |
321 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { | 321 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { |
322 return reinterpret_cast<T*>(obj.location()); | 322 return reinterpret_cast<T*>(obj.location()); |
323 } | 323 } |
324 | 324 |
325 template <class T> | 325 template <class T> |
326 inline v8::Local<T> ToApiHandle( | 326 inline v8::Local<T> ToApiHandle( |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 stress_type_ = stress_type; | 707 stress_type_ = stress_type; |
708 } | 708 } |
709 | 709 |
710 private: | 710 private: |
711 static v8::Testing::StressType stress_type_; | 711 static v8::Testing::StressType stress_type_; |
712 }; | 712 }; |
713 | 713 |
714 } } // namespace v8::internal | 714 } } // namespace v8::internal |
715 | 715 |
716 #endif // V8_API_H_ | 716 #endif // V8_API_H_ |
OLD | NEW |