Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: src/debug.cc

Issue 652027: Basic implementation of liveedit feature (Closed)
Patch Set: add proper source headers Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 // Expose the builtins object in the debugger context. 750 // Expose the builtins object in the debugger context.
751 Handle<String> key = Factory::LookupAsciiSymbol("builtins"); 751 Handle<String> key = Factory::LookupAsciiSymbol("builtins");
752 Handle<GlobalObject> global = Handle<GlobalObject>(context->global()); 752 Handle<GlobalObject> global = Handle<GlobalObject>(context->global());
753 SetProperty(global, key, Handle<Object>(global->builtins()), NONE); 753 SetProperty(global, key, Handle<Object>(global->builtins()), NONE);
754 754
755 // Compile the JavaScript for the debugger in the debugger context. 755 // Compile the JavaScript for the debugger in the debugger context.
756 Debugger::set_compiling_natives(true); 756 Debugger::set_compiling_natives(true);
757 bool caught_exception = 757 bool caught_exception =
758 !CompileDebuggerScript(Natives::GetIndex("mirror")) || 758 !CompileDebuggerScript(Natives::GetIndex("mirror")) ||
759 !CompileDebuggerScript(Natives::GetIndex("debug")); 759 !CompileDebuggerScript(Natives::GetIndex("debug"));
760
761 if (FLAG_enable_liveedit) {
762 caught_exception = caught_exception ||
763 !CompileDebuggerScript(Natives::GetIndex("liveedit"));
764 }
765
760 Debugger::set_compiling_natives(false); 766 Debugger::set_compiling_natives(false);
761 767
762 // Make sure we mark the debugger as not loading before we might 768 // Make sure we mark the debugger as not loading before we might
763 // return. 769 // return.
764 Debugger::set_loading_debugger(false); 770 Debugger::set_loading_debugger(false);
765 771
766 // Check for caught exceptions. 772 // Check for caught exceptions.
767 if (caught_exception) return false; 773 if (caught_exception) return false;
768 774
769 // Debugger loaded. 775 // Debugger loaded.
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 } 1962 }
1957 1963
1958 // Process debug event. 1964 // Process debug event.
1959 ProcessDebugEvent(v8::BeforeCompile, 1965 ProcessDebugEvent(v8::BeforeCompile,
1960 Handle<JSObject>::cast(event_data), 1966 Handle<JSObject>::cast(event_data),
1961 true); 1967 true);
1962 } 1968 }
1963 1969
1964 1970
1965 // Handle debugger actions when a new script is compiled. 1971 // Handle debugger actions when a new script is compiled.
1966 void Debugger::OnAfterCompile(Handle<Script> script, Handle<JSFunction> fun) { 1972 void Debugger::OnAfterCompile(Handle<Script> script,
1973 AfterCompileFlags after_compile_flags) {
1967 HandleScope scope; 1974 HandleScope scope;
1968 1975
1969 // Add the newly compiled script to the script cache. 1976 // Add the newly compiled script to the script cache.
1970 Debug::AddScriptToScriptCache(script); 1977 Debug::AddScriptToScriptCache(script);
1971 1978
1972 // No more to do if not debugging. 1979 // No more to do if not debugging.
1973 if (!IsDebuggerActive()) return; 1980 if (!IsDebuggerActive()) return;
1974 1981
1975 // No compile events while compiling natives. 1982 // No compile events while compiling natives.
1976 if (compiling_natives()) return; 1983 if (compiling_natives()) return;
(...skipping 26 matching lines...) Expand all
2003 const int argc = 1; 2010 const int argc = 1;
2004 Object** argv[argc] = { reinterpret_cast<Object**>(wrapper.location()) }; 2011 Object** argv[argc] = { reinterpret_cast<Object**>(wrapper.location()) };
2005 Handle<Object> result = Execution::TryCall( 2012 Handle<Object> result = Execution::TryCall(
2006 Handle<JSFunction>::cast(update_script_break_points), 2013 Handle<JSFunction>::cast(update_script_break_points),
2007 Top::builtins(), argc, argv, 2014 Top::builtins(), argc, argv,
2008 &caught_exception); 2015 &caught_exception);
2009 if (caught_exception) { 2016 if (caught_exception) {
2010 return; 2017 return;
2011 } 2018 }
2012 // Bail out based on state or if there is no listener for this event 2019 // Bail out based on state or if there is no listener for this event
2013 if (in_debugger) return; 2020 if (in_debugger && (after_compile_flags & SEND_WHEN_DEBUGGING) == 0) return;
2014 if (!Debugger::EventActive(v8::AfterCompile)) return; 2021 if (!Debugger::EventActive(v8::AfterCompile)) return;
2015 2022
2016 // Create the compile state object. 2023 // Create the compile state object.
2017 Handle<Object> event_data = MakeCompileEvent(script, 2024 Handle<Object> event_data = MakeCompileEvent(script,
2018 false, 2025 false,
2019 &caught_exception); 2026 &caught_exception);
2020 // Bail out and don't call debugger if exception. 2027 // Bail out and don't call debugger if exception.
2021 if (caught_exception) { 2028 if (caught_exception) {
2022 return; 2029 return;
2023 } 2030 }
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 { 2799 {
2793 Locker locker; 2800 Locker locker;
2794 Debugger::CallMessageDispatchHandler(); 2801 Debugger::CallMessageDispatchHandler();
2795 } 2802 }
2796 } 2803 }
2797 } 2804 }
2798 2805
2799 #endif // ENABLE_DEBUGGER_SUPPORT 2806 #endif // ENABLE_DEBUGGER_SUPPORT
2800 2807
2801 } } // namespace v8::internal 2808 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | src/debug-delay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698