| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 i::Handle<i::Context> env = Utils::OpenHandle(this); | 720 i::Handle<i::Context> env = Utils::OpenHandle(this); |
| 721 i::Isolate* isolate = env->GetIsolate(); | 721 i::Isolate* isolate = env->GetIsolate(); |
| 722 ENTER_V8(isolate); | 722 ENTER_V8(isolate); |
| 723 isolate->handle_scope_implementer()->EnterContext(env); | 723 isolate->handle_scope_implementer()->EnterContext(env); |
| 724 isolate->handle_scope_implementer()->SaveContext(isolate->context()); | 724 isolate->handle_scope_implementer()->SaveContext(isolate->context()); |
| 725 isolate->set_context(*env); | 725 isolate->set_context(*env); |
| 726 } | 726 } |
| 727 | 727 |
| 728 | 728 |
| 729 void Context::Exit() { | 729 void Context::Exit() { |
| 730 i::Handle<i::Context> context = Utils::OpenHandle(this); | 730 // TODO(dcarney): fix this once chrome is fixed. |
| 731 i::Isolate* isolate = context->GetIsolate(); | 731 i::Isolate* isolate = i::Isolate::Current(); |
| 732 i::Handle<i::Context> context = i::Handle<i::Context>::null(); |
| 732 ENTER_V8(isolate); | 733 ENTER_V8(isolate); |
| 733 if (!ApiCheck(isolate->handle_scope_implementer()->LeaveContext(context), | 734 if (!ApiCheck(isolate->handle_scope_implementer()->LeaveContext(context), |
| 734 "v8::Context::Exit()", | 735 "v8::Context::Exit()", |
| 735 "Cannot exit non-entered context")) { | 736 "Cannot exit non-entered context")) { |
| 736 return; | 737 return; |
| 737 } | 738 } |
| 738 // Content of 'last_context' could be NULL. | 739 // Content of 'last_context' could be NULL. |
| 739 i::Context* last_context = | 740 i::Context* last_context = |
| 740 isolate->handle_scope_implementer()->RestoreContext(); | 741 isolate->handle_scope_implementer()->RestoreContext(); |
| 741 isolate->set_context(last_context); | 742 isolate->set_context(last_context); |
| (...skipping 6786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7528 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7529 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7529 Address callback_address = | 7530 Address callback_address = |
| 7530 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7531 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7531 VMState<EXTERNAL> state(isolate); | 7532 VMState<EXTERNAL> state(isolate); |
| 7532 ExternalCallbackScope call_scope(isolate, callback_address); | 7533 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7533 callback(info); | 7534 callback(info); |
| 7534 } | 7535 } |
| 7535 | 7536 |
| 7536 | 7537 |
| 7537 } } // namespace v8::internal | 7538 } } // namespace v8::internal |
| OLD | NEW |