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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 void V8::ClearWeak(i::Object** obj) { | 646 void V8::ClearWeak(i::Object** obj) { |
647 i::GlobalHandles::ClearWeakness(obj); | 647 i::GlobalHandles::ClearWeakness(obj); |
648 } | 648 } |
649 | 649 |
650 | 650 |
651 void V8::DisposeGlobal(i::Object** obj) { | 651 void V8::DisposeGlobal(i::Object** obj) { |
652 i::GlobalHandles::Destroy(obj); | 652 i::GlobalHandles::Destroy(obj); |
653 } | 653 } |
654 | 654 |
655 | 655 |
656 int V8::Eternalize(i::Isolate* isolate, i::Object** handle) { | 656 void V8::Eternalize(Isolate* v8_isolate, Value* value, int* index) { |
657 return isolate->eternal_handles()->Create(isolate, *handle); | 657 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 658 i::Object* object = *Utils::OpenHandle(value); |
| 659 isolate->eternal_handles()->Create(isolate, object, index); |
658 } | 660 } |
659 | 661 |
660 | 662 |
661 i::Object** V8::GetEternal(i::Isolate* isolate, int index) { | 663 Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) { |
662 return isolate->eternal_handles()->Get(index).location(); | 664 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 665 return Utils::ToLocal(isolate->eternal_handles()->Get(index)); |
663 } | 666 } |
664 | 667 |
665 | 668 |
666 // --- H a n d l e s --- | 669 // --- H a n d l e s --- |
667 | 670 |
668 | 671 |
669 HandleScope::HandleScope() { | 672 HandleScope::HandleScope() { |
670 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); | 673 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); |
671 } | 674 } |
672 | 675 |
(...skipping 7477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8150 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8153 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
8151 Address callback_address = | 8154 Address callback_address = |
8152 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8155 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8153 VMState<EXTERNAL> state(isolate); | 8156 VMState<EXTERNAL> state(isolate); |
8154 ExternalCallbackScope call_scope(isolate, callback_address); | 8157 ExternalCallbackScope call_scope(isolate, callback_address); |
8155 return callback(info); | 8158 return callback(info); |
8156 } | 8159 } |
8157 | 8160 |
8158 | 8161 |
8159 } } // namespace v8::internal | 8162 } } // namespace v8::internal |
OLD | NEW |