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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 688 |
689 Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) { | 689 Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) { |
690 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 690 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
691 return Utils::ToLocal(isolate->eternal_handles()->Get(index)); | 691 return Utils::ToLocal(isolate->eternal_handles()->Get(index)); |
692 } | 692 } |
693 | 693 |
694 | 694 |
695 // --- H a n d l e s --- | 695 // --- H a n d l e s --- |
696 | 696 |
697 | 697 |
698 HandleScope::HandleScope() { | |
699 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); | |
700 } | |
701 | |
702 | |
703 HandleScope::HandleScope(Isolate* isolate) { | 698 HandleScope::HandleScope(Isolate* isolate) { |
704 Initialize(isolate); | 699 Initialize(isolate); |
705 } | 700 } |
706 | 701 |
707 | 702 |
708 void HandleScope::Initialize(Isolate* isolate) { | 703 void HandleScope::Initialize(Isolate* isolate) { |
709 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 704 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
710 API_ENTRY_CHECK(internal_isolate, "HandleScope::HandleScope"); | 705 API_ENTRY_CHECK(internal_isolate, "HandleScope::HandleScope"); |
711 v8::ImplementationUtilities::HandleScopeData* current = | 706 v8::ImplementationUtilities::HandleScopeData* current = |
712 internal_isolate->handle_scope_data(); | 707 internal_isolate->handle_scope_data(); |
(...skipping 7178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7891 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7886 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7892 Address callback_address = | 7887 Address callback_address = |
7893 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7888 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7894 VMState<EXTERNAL> state(isolate); | 7889 VMState<EXTERNAL> state(isolate); |
7895 ExternalCallbackScope call_scope(isolate, callback_address); | 7890 ExternalCallbackScope call_scope(isolate, callback_address); |
7896 return callback(info); | 7891 return callback(info); |
7897 } | 7892 } |
7898 | 7893 |
7899 | 7894 |
7900 } } // namespace v8::internal | 7895 } } // namespace v8::internal |
OLD | NEW |