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

Side by Side Diff: src/debug.cc

Issue 2943002: Reimplement stack manipulations for LiveEdit (Closed)
Patch Set: follow codereview Created 10 years, 5 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/factory.h » ('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 21 matching lines...) Expand all
32 #include "bootstrapper.h" 32 #include "bootstrapper.h"
33 #include "code-stubs.h" 33 #include "code-stubs.h"
34 #include "codegen.h" 34 #include "codegen.h"
35 #include "compilation-cache.h" 35 #include "compilation-cache.h"
36 #include "compiler.h" 36 #include "compiler.h"
37 #include "debug.h" 37 #include "debug.h"
38 #include "execution.h" 38 #include "execution.h"
39 #include "global-handles.h" 39 #include "global-handles.h"
40 #include "ic.h" 40 #include "ic.h"
41 #include "ic-inl.h" 41 #include "ic-inl.h"
42 #include "liveedit.h"
42 #include "messages.h" 43 #include "messages.h"
43 #include "natives.h" 44 #include "natives.h"
44 #include "stub-cache.h" 45 #include "stub-cache.h"
45 #include "log.h" 46 #include "log.h"
46 47
47 #include "../include/v8-debug.h" 48 #include "../include/v8-debug.h"
48 49
49 namespace v8 { 50 namespace v8 {
50 namespace internal { 51 namespace internal {
51 52
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 } 941 }
941 942
942 if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) { 943 if (thread_local_.frame_drop_mode_ == FRAMES_UNTOUCHED) {
943 SetAfterBreakTarget(frame); 944 SetAfterBreakTarget(frame);
944 } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_IC_CALL) { 945 } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_IC_CALL) {
945 // We must have been calling IC stub. Do not go there anymore. 946 // We must have been calling IC stub. Do not go there anymore.
946 Code* plain_return = Builtins::builtin(Builtins::PlainReturn_LiveEdit); 947 Code* plain_return = Builtins::builtin(Builtins::PlainReturn_LiveEdit);
947 thread_local_.after_break_target_ = plain_return->entry(); 948 thread_local_.after_break_target_ = plain_return->entry();
948 } else if (thread_local_.frame_drop_mode_ == 949 } else if (thread_local_.frame_drop_mode_ ==
949 FRAME_DROPPED_IN_DEBUG_SLOT_CALL) { 950 FRAME_DROPPED_IN_DEBUG_SLOT_CALL) {
951 // Update top frame.
952 JavaScriptFrameIterator updated_frame_it;
953 frame = updated_frame_it.frame();
954
950 // Debug break slot stub does not return normally, instead it manually 955 // Debug break slot stub does not return normally, instead it manually
951 // cleans the stack and jumps. We should patch the jump address. 956 // cleans the stack and jumps. We should patch the jump address.
952 Code* plain_return = Builtins::builtin(Builtins::FrameDropper_LiveEdit); 957 thread_local_.after_break_target_ =
953 thread_local_.after_break_target_ = plain_return->entry(); 958 LiveEdit::GetRestarterPatchEntryPoint(frame->code());
954 } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_DIRECT_CALL) { 959 } else if (thread_local_.frame_drop_mode_ == FRAME_DROPPED_IN_DIRECT_CALL) {
955 // Nothing to do, after_break_target is not used here. 960 // Nothing to do, after_break_target is not used here.
956 } else { 961 } else {
957 UNREACHABLE(); 962 UNREACHABLE();
958 } 963 }
959 964
960 return Heap::undefined_value(); 965 return Heap::undefined_value();
961 } 966 }
962 967
963 968
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) { 1764 if (RelocInfo::IsJSReturn(it.rinfo()->rmode())) {
1760 return (it.rinfo()->pc() == 1765 return (it.rinfo()->pc() ==
1761 addr - Assembler::kPatchReturnSequenceAddressOffset); 1766 addr - Assembler::kPatchReturnSequenceAddressOffset);
1762 } 1767 }
1763 it.next(); 1768 it.next();
1764 } 1769 }
1765 return false; 1770 return false;
1766 } 1771 }
1767 1772
1768 1773
1769 void Debug::FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, 1774 void Debug::FramesHaveBeenDropped(JavaScriptFrame* new_top_js_frame,
1770 FrameDropMode mode) { 1775 FrameDropMode mode) {
1771 thread_local_.frame_drop_mode_ = mode; 1776 thread_local_.frame_drop_mode_ = mode;
1772 thread_local_.break_frame_id_ = new_break_frame_id; 1777 thread_local_.break_frame_id_ = new_top_js_frame->id();
1778 thread_local_.restarted_frame_fp_ = new_top_js_frame->fp();
1773 } 1779 }
1774 1780
1775 1781
1782 Address Debug::GetRestartedFrameFp() {
1783 return thread_local_.restarted_frame_fp_;
1784 }
1785
1786
1776 bool Debug::IsDebugGlobal(GlobalObject* global) { 1787 bool Debug::IsDebugGlobal(GlobalObject* global) {
1777 return IsLoaded() && global == Debug::debug_context()->global(); 1788 return IsLoaded() && global == Debug::debug_context()->global();
1778 } 1789 }
1779 1790
1780 1791
1781 void Debug::ClearMirrorCache() { 1792 void Debug::ClearMirrorCache() {
1782 HandleScope scope; 1793 HandleScope scope;
1783 ASSERT(Top::context() == *Debug::debug_context()); 1794 ASSERT(Top::context() == *Debug::debug_context());
1784 1795
1785 // Clear the mirror cache. 1796 // Clear the mirror cache.
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2940 { 2951 {
2941 Locker locker; 2952 Locker locker;
2942 Debugger::CallMessageDispatchHandler(); 2953 Debugger::CallMessageDispatchHandler();
2943 } 2954 }
2944 } 2955 }
2945 } 2956 }
2946 2957
2947 #endif // ENABLE_DEBUGGER_SUPPORT 2958 #endif // ENABLE_DEBUGGER_SUPPORT
2948 2959
2949 } } // namespace v8::internal 2960 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.h ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698