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

Side by Side Diff: src/debug.cc

Issue 1118007: LiveEdit: implement frame dropping (Closed)
Patch Set: adding rule to mjsunit.status Created 10 years, 8 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-debugger.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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 807
808 void Debug::Iterate(ObjectVisitor* v) { 808 void Debug::Iterate(ObjectVisitor* v) {
809 v->VisitPointer(BitCast<Object**, Code**>(&(debug_break_return_))); 809 v->VisitPointer(BitCast<Object**, Code**>(&(debug_break_return_)));
810 } 810 }
811 811
812 812
813 Object* Debug::Break(Arguments args) { 813 Object* Debug::Break(Arguments args) {
814 HandleScope scope; 814 HandleScope scope;
815 ASSERT(args.length() == 0); 815 ASSERT(args.length() == 0);
816 816
817 thread_local_.frames_are_dropped_ = false;
818
817 // Get the top-most JavaScript frame. 819 // Get the top-most JavaScript frame.
818 JavaScriptFrameIterator it; 820 JavaScriptFrameIterator it;
819 JavaScriptFrame* frame = it.frame(); 821 JavaScriptFrame* frame = it.frame();
820 822
821 // Just continue if breaks are disabled or debugger cannot be loaded. 823 // Just continue if breaks are disabled or debugger cannot be loaded.
822 if (disable_break() || !Load()) { 824 if (disable_break() || !Load()) {
823 SetAfterBreakTarget(frame); 825 SetAfterBreakTarget(frame);
824 return Heap::undefined_value(); 826 return Heap::undefined_value();
825 } 827 }
826 828
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 StepAction step_action = thread_local_.last_step_action_; 885 StepAction step_action = thread_local_.last_step_action_;
884 int step_count = thread_local_.step_count_; 886 int step_count = thread_local_.step_count_;
885 887
886 // Clear all current stepping setup. 888 // Clear all current stepping setup.
887 ClearStepping(); 889 ClearStepping();
888 890
889 // Set up for the remaining steps. 891 // Set up for the remaining steps.
890 PrepareStep(step_action, step_count); 892 PrepareStep(step_action, step_count);
891 } 893 }
892 894
893 // Install jump to the call address which was overwritten. 895 if (thread_local_.frames_are_dropped_) {
894 SetAfterBreakTarget(frame); 896 // We must have been calling IC stub. Do not return there anymore.
897 Code* plain_return = Builtins::builtin(Builtins::PlainReturn_LiveEdit);
898 thread_local_.after_break_target_ = plain_return->entry();
899 } else {
900 SetAfterBreakTarget(frame);
901 }
895 902
896 return Heap::undefined_value(); 903 return Heap::undefined_value();
897 } 904 }
898 905
899 906
900 // Check the break point objects for whether one or more are actually 907 // Check the break point objects for whether one or more are actually
901 // triggered. This function returns a JSArray with the break point objects 908 // triggered. This function returns a JSArray with the break point objects
902 // which is triggered. 909 // which is triggered.
903 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) { 910 Handle<Object> Debug::CheckBreakPoints(Handle<Object> break_point_objects) {
904 int break_points_hit_count = 0; 911 int break_points_hit_count = 0;
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 addr += original_code->instruction_start() - code->instruction_start(); 1655 addr += original_code->instruction_start() - code->instruction_start();
1649 } 1656 }
1650 1657
1651 // Install jump to the call address in the original code. This will be the 1658 // Install jump to the call address in the original code. This will be the
1652 // call which was overwritten by the call to DebugBreakXXX. 1659 // call which was overwritten by the call to DebugBreakXXX.
1653 thread_local_.after_break_target_ = Assembler::target_address_at(addr); 1660 thread_local_.after_break_target_ = Assembler::target_address_at(addr);
1654 } 1661 }
1655 } 1662 }
1656 1663
1657 1664
1665 void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id) {
1666 thread_local_.frames_are_dropped_ = true;
1667 thread_local_.break_frame_id_ = new_break_frame_id;
1668 }
1669
1670
1658 bool Debug::IsDebugGlobal(GlobalObject* global) { 1671 bool Debug::IsDebugGlobal(GlobalObject* global) {
1659 return IsLoaded() && global == Debug::debug_context()->global(); 1672 return IsLoaded() && global == Debug::debug_context()->global();
1660 } 1673 }
1661 1674
1662 1675
1663 void Debug::ClearMirrorCache() { 1676 void Debug::ClearMirrorCache() {
1664 HandleScope scope; 1677 HandleScope scope;
1665 ASSERT(Top::context() == *Debug::debug_context()); 1678 ASSERT(Top::context() == *Debug::debug_context());
1666 1679
1667 // Clear the mirror cache. 1680 // Clear the mirror cache.
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2782 { 2795 {
2783 Locker locker; 2796 Locker locker;
2784 Debugger::CallMessageDispatchHandler(); 2797 Debugger::CallMessageDispatchHandler();
2785 } 2798 }
2786 } 2799 }
2787 } 2800 }
2788 2801
2789 #endif // ENABLE_DEBUGGER_SUPPORT 2802 #endif // ENABLE_DEBUGGER_SUPPORT
2790 2803
2791 } } // namespace v8::internal 2804 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698