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 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 | 867 |
868 debugger->set_compiling_natives(false); | 868 debugger->set_compiling_natives(false); |
869 | 869 |
870 // Make sure we mark the debugger as not loading before we might | 870 // Make sure we mark the debugger as not loading before we might |
871 // return. | 871 // return. |
872 debugger->set_loading_debugger(false); | 872 debugger->set_loading_debugger(false); |
873 | 873 |
874 // Check for caught exceptions. | 874 // Check for caught exceptions. |
875 if (caught_exception) return false; | 875 if (caught_exception) return false; |
876 | 876 |
877 // Debugger loaded. | 877 // Debugger loaded, create debugger context global handle. |
878 debug_context_ = context; | 878 debug_context_ = Handle<Context>::cast( |
| 879 isolate_->global_handles()->Create(*context)); |
879 | 880 |
880 return true; | 881 return true; |
881 } | 882 } |
882 | 883 |
883 | 884 |
884 void Debug::Unload() { | 885 void Debug::Unload() { |
885 // Return debugger is not loaded. | 886 // Return debugger is not loaded. |
886 if (!IsLoaded()) { | 887 if (!IsLoaded()) { |
887 return; | 888 return; |
888 } | 889 } |
889 | 890 |
890 // Clear the script cache. | 891 // Clear the script cache. |
891 DestroyScriptCache(); | 892 DestroyScriptCache(); |
892 | 893 |
893 // Clear debugger context global handle. | 894 // Clear debugger context global handle. |
894 Isolate::Current()->global_handles()->Destroy( | 895 isolate_->global_handles()->Destroy( |
895 reinterpret_cast<Object**>(debug_context_.location())); | 896 reinterpret_cast<Object**>(debug_context_.location())); |
896 debug_context_ = Handle<Context>(); | 897 debug_context_ = Handle<Context>(); |
897 } | 898 } |
898 | 899 |
899 | 900 |
900 // Set the flag indicating that preemption happened during debugging. | 901 // Set the flag indicating that preemption happened during debugging. |
901 void Debug::PreemptionWhileInDebugger() { | 902 void Debug::PreemptionWhileInDebugger() { |
902 ASSERT(InDebugger()); | 903 ASSERT(InDebugger()); |
903 Debug::set_interrupts_pending(PREEMPT); | 904 Debug::set_interrupts_pending(PREEMPT); |
904 } | 905 } |
(...skipping 2889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3794 { | 3795 { |
3795 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); | 3796 Locker locker(reinterpret_cast<v8::Isolate*>(isolate_)); |
3796 isolate_->debugger()->CallMessageDispatchHandler(); | 3797 isolate_->debugger()->CallMessageDispatchHandler(); |
3797 } | 3798 } |
3798 } | 3799 } |
3799 } | 3800 } |
3800 | 3801 |
3801 #endif // ENABLE_DEBUGGER_SUPPORT | 3802 #endif // ENABLE_DEBUGGER_SUPPORT |
3802 | 3803 |
3803 } } // namespace v8::internal | 3804 } } // namespace v8::internal |
OLD | NEW |