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

Side by Side Diff: src/liveedit-debugger.js

Issue 10544151: Support 'restart call frame' debug command (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/liveedit.cc ('k') | src/mirror-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 2010 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
11 // with the distribution. 11 // with the distribution.
(...skipping 28 matching lines...) Expand all
40 // create a new instance of this function goes away. An old version of script 40 // create a new instance of this function goes away. An old version of script
41 // is created to back up this obsolete function. 41 // is created to back up this obsolete function.
42 // All unchanged functions have their positions updated accordingly. 42 // All unchanged functions have their positions updated accordingly.
43 // 43 //
44 // LiveEdit namespace is declared inside a single function constructor. 44 // LiveEdit namespace is declared inside a single function constructor.
45 Debug.LiveEdit = new function() { 45 Debug.LiveEdit = new function() {
46 46
47 // Forward declaration for minifier. 47 // Forward declaration for minifier.
48 var FunctionStatus; 48 var FunctionStatus;
49 49
50 var NEEDS_STEP_IN_PROPERTY_NAME = "stack_update_needs_step_in";
51
50 // Applies the change to the script. 52 // Applies the change to the script.
51 // The change is in form of list of chunks encoded in a single array as 53 // The change is in form of list of chunks encoded in a single array as
52 // a series of triplets (pos1_start, pos1_end, pos2_end) 54 // a series of triplets (pos1_start, pos1_end, pos2_end)
53 function ApplyPatchMultiChunk(script, diff_array, new_source, preview_only, 55 function ApplyPatchMultiChunk(script, diff_array, new_source, preview_only,
54 change_log) { 56 change_log) {
55 57
56 var old_source = script.source; 58 var old_source = script.source;
57 59
58 // Gather compile information about old version of script. 60 // Gather compile information about old version of script.
59 var old_compile_info = GatherCompileInfo(old_source, script); 61 var old_compile_info = GatherCompileInfo(old_source, script);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Committing all changes. 156 // Committing all changes.
155 157
156 // Check that function being patched is not currently on stack or drop them. 158 // Check that function being patched is not currently on stack or drop them.
157 var dropped_functions_number = 159 var dropped_functions_number =
158 CheckStackActivations(replaced_function_infos, change_log); 160 CheckStackActivations(replaced_function_infos, change_log);
159 161
160 preview_description.stack_modified = dropped_functions_number != 0; 162 preview_description.stack_modified = dropped_functions_number != 0;
161 163
162 // Our current implementation requires client to manually issue "step in" 164 // Our current implementation requires client to manually issue "step in"
163 // command for correct stack state. 165 // command for correct stack state.
164 preview_description.stack_update_needs_step_in = 166 preview_description[NEEDS_STEP_IN_PROPERTY_NAME] =
165 preview_description.stack_modified; 167 preview_description.stack_modified;
166 168
167 // Start with breakpoints. Convert their line/column positions and 169 // Start with breakpoints. Convert their line/column positions and
168 // temporary remove. 170 // temporary remove.
169 var break_points_restorer = TemporaryRemoveBreakPoints(script, change_log); 171 var break_points_restorer = TemporaryRemoveBreakPoints(script, change_log);
170 172
171 var old_script; 173 var old_script;
172 174
173 // Create an old script only if there are function that should be linked 175 // Create an old script only if there are function that should be linked
174 // to old version. 176 // to old version.
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 function DescribePositions(node) { 1073 function DescribePositions(node) {
1072 return { 1074 return {
1073 start_position: node.info.start_position, 1075 start_position: node.info.start_position,
1074 end_position: node.info.end_position 1076 end_position: node.info.end_position
1075 }; 1077 };
1076 } 1078 }
1077 1079
1078 return ProcessOldNode(old_code_tree); 1080 return ProcessOldNode(old_code_tree);
1079 } 1081 }
1080 1082
1083 // Restarts call frame and returns value similar to what LiveEdit returns.
1084 function RestartFrame(frame_mirror) {
1085 var result = frame_mirror.restart();
1086 if (IS_STRING(result)) {
1087 throw new Failure("Failed to restart frame: " + result);
1088 }
1089 var result = {};
1090 result[NEEDS_STEP_IN_PROPERTY_NAME] = true;
1091 return result;
1092 }
1093 // Function is public.
1094 this.RestartFrame = RestartFrame;
1081 1095
1082 // Functions are public for tests. 1096 // Functions are public for tests.
1083 this.TestApi = { 1097 this.TestApi = {
1084 PosTranslator: PosTranslator, 1098 PosTranslator: PosTranslator,
1085 CompareStrings: CompareStrings, 1099 CompareStrings: CompareStrings,
1086 ApplySingleChunkPatch: ApplySingleChunkPatch 1100 ApplySingleChunkPatch: ApplySingleChunkPatch
1087 }; 1101 };
1088 }; 1102 };
OLDNEW
« no previous file with comments | « src/liveedit.cc ('k') | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698