| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 311 |
| 312 private: | 312 private: |
| 313 static void ReportApiFailure(const char* location, const char* message); | 313 static void ReportApiFailure(const char* location, const char* message); |
| 314 }; | 314 }; |
| 315 | 315 |
| 316 | 316 |
| 317 template <class T> | 317 template <class T> |
| 318 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( | 318 v8::internal::Handle<T> v8::internal::Handle<T>::EscapeFrom( |
| 319 v8::EscapableHandleScope* scope) { | 319 v8::EscapableHandleScope* scope) { |
| 320 v8::internal::Handle<T> handle; | 320 v8::internal::Handle<T> handle; |
| 321 if (!is_null()) { | 321 if (!this->is_null()) handle = *this; |
| 322 handle = *this; | |
| 323 } | |
| 324 return Utils::OpenHandle(*scope->Escape(Utils::ToLocal(handle)), true); | 322 return Utils::OpenHandle(*scope->Escape(Utils::ToLocal(handle)), true); |
| 325 } | 323 } |
| 326 | 324 |
| 327 | 325 |
| 328 template <class T> | 326 template <class T> |
| 329 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { | 327 inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) { |
| 330 return reinterpret_cast<T*>(obj.location()); | 328 return reinterpret_cast<T*>(obj.location()); |
| 331 } | 329 } |
| 332 | 330 |
| 333 template <class T> | 331 template <class T> |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 stress_type_ = stress_type; | 707 stress_type_ = stress_type; |
| 710 } | 708 } |
| 711 | 709 |
| 712 private: | 710 private: |
| 713 static v8::Testing::StressType stress_type_; | 711 static v8::Testing::StressType stress_type_; |
| 714 }; | 712 }; |
| 715 | 713 |
| 716 } } // namespace v8::internal | 714 } } // namespace v8::internal |
| 717 | 715 |
| 718 #endif // V8_API_H_ | 716 #endif // V8_API_H_ |
| OLD | NEW |