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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 void V8::ClearWeak(i::Object** obj) { | 669 void V8::ClearWeak(i::Object** obj) { |
670 i::GlobalHandles::ClearWeakness(obj); | 670 i::GlobalHandles::ClearWeakness(obj); |
671 } | 671 } |
672 | 672 |
673 | 673 |
674 void V8::DisposeGlobal(i::Object** obj) { | 674 void V8::DisposeGlobal(i::Object** obj) { |
675 i::GlobalHandles::Destroy(obj); | 675 i::GlobalHandles::Destroy(obj); |
676 } | 676 } |
677 | 677 |
678 | 678 |
| 679 int V8::Eternalize(i::Isolate* isolate, i::Object** handle) { |
| 680 return isolate->eternal_handles()->Create(isolate, *handle); |
| 681 } |
| 682 |
| 683 |
| 684 i::Object** V8::GetEternal(i::Isolate* isolate, int index) { |
| 685 return isolate->eternal_handles()->Get(index).location(); |
| 686 } |
| 687 |
| 688 |
679 // --- H a n d l e s --- | 689 // --- H a n d l e s --- |
680 | 690 |
681 | 691 |
682 HandleScope::HandleScope() { | 692 HandleScope::HandleScope() { |
683 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); | 693 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); |
684 } | 694 } |
685 | 695 |
686 | 696 |
687 HandleScope::HandleScope(Isolate* isolate) { | 697 HandleScope::HandleScope(Isolate* isolate) { |
688 Initialize(isolate); | 698 Initialize(isolate); |
(...skipping 7471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8160 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8170 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
8161 Address callback_address = | 8171 Address callback_address = |
8162 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8172 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8163 VMState<EXTERNAL> state(isolate); | 8173 VMState<EXTERNAL> state(isolate); |
8164 ExternalCallbackScope call_scope(isolate, callback_address); | 8174 ExternalCallbackScope call_scope(isolate, callback_address); |
8165 return callback(info); | 8175 return callback(info); |
8166 } | 8176 } |
8167 | 8177 |
8168 | 8178 |
8169 } } // namespace v8::internal | 8179 } } // namespace v8::internal |
OLD | NEW |