| 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 5560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5571 internal::Object** p = reinterpret_cast<internal::Object**>(that_ptr); | 5571 internal::Object** p = reinterpret_cast<internal::Object**>(that_ptr); |
| 5572 return Local<T>(reinterpret_cast<T*>(HandleScope::CreateHandle( | 5572 return Local<T>(reinterpret_cast<T*>(HandleScope::CreateHandle( |
| 5573 reinterpret_cast<internal::Isolate*>(isolate), *p))); | 5573 reinterpret_cast<internal::Isolate*>(isolate), *p))); |
| 5574 } | 5574 } |
| 5575 | 5575 |
| 5576 | 5576 |
| 5577 template<class T> | 5577 template<class T> |
| 5578 template<class S> | 5578 template<class S> |
| 5579 void Eternal<T>::Set(Isolate* isolate, Local<S> handle) { | 5579 void Eternal<T>::Set(Isolate* isolate, Local<S> handle) { |
| 5580 TYPE_CHECK(T, S); | 5580 TYPE_CHECK(T, S); |
| 5581 V8::Eternalize(isolate, Value::Cast(*handle), &this->index_); | 5581 V8::Eternalize(isolate, reinterpret_cast<Value*>(*handle), &this->index_); |
| 5582 } | 5582 } |
| 5583 | 5583 |
| 5584 | 5584 |
| 5585 template<class T> | 5585 template<class T> |
| 5586 Local<T> Eternal<T>::Get(Isolate* isolate) { | 5586 Local<T> Eternal<T>::Get(Isolate* isolate) { |
| 5587 return Local<T>::Cast(V8::GetEternal(isolate, index_)); | 5587 return Local<T>(reinterpret_cast<T*>(*V8::GetEternal(isolate, index_))); |
| 5588 } | 5588 } |
| 5589 | 5589 |
| 5590 | 5590 |
| 5591 #ifdef V8_USE_UNSAFE_HANDLES | 5591 #ifdef V8_USE_UNSAFE_HANDLES |
| 5592 template <class T> | 5592 template <class T> |
| 5593 Persistent<T> Persistent<T>::New(Handle<T> that) { | 5593 Persistent<T> Persistent<T>::New(Handle<T> that) { |
| 5594 return New(Isolate::GetCurrent(), that.val_); | 5594 return New(Isolate::GetCurrent(), that.val_); |
| 5595 } | 5595 } |
| 5596 | 5596 |
| 5597 | 5597 |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6489 */ | 6489 */ |
| 6490 | 6490 |
| 6491 | 6491 |
| 6492 } // namespace v8 | 6492 } // namespace v8 |
| 6493 | 6493 |
| 6494 | 6494 |
| 6495 #undef TYPE_CHECK | 6495 #undef TYPE_CHECK |
| 6496 | 6496 |
| 6497 | 6497 |
| 6498 #endif // V8_H_ | 6498 #endif // V8_H_ |
| OLD | NEW |