Fix misleading names and comments in mute local variables debugger helper
authorpeter.rybin@gmail.com <peter.rybin@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 26 Jun 2013 16:18:00 +0000 (16:18 +0000)
committerpeter.rybin@gmail.com <peter.rybin@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 26 Jun 2013 16:18:00 +0000 (16:18 +0000)
R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/17644013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/mirror-debugger.js
src/runtime.cc

index 91097ea70163224cc34610a91fba50a56c26000a..28b8fc81baa2c067022dfeb67c03303ee3767c29 100644 (file)
@@ -1707,18 +1707,18 @@ FrameMirror.prototype.evaluate = function(source, disable_break,
                                     opt_context_object);
   // Silently ignore local variables changes if the frame is optimized.
   if (!this.isOptimizedFrame()) {
-    var local_scope_before = result_array[1];
-    var local_scope_after = result_array[2];
-    for (var n in local_scope_after) {
-      var value_before = local_scope_before[n];
-      var value_after = local_scope_after[n];
-      if (value_before !== value_after) {
+    var local_scope_on_stack = result_array[1];
+    var local_scope_modifed = result_array[2];
+    for (var n in local_scope_modifed) {
+      var value_on_stack = local_scope_on_stack[n];
+      var value_modifed = local_scope_modifed[n];
+      if (value_on_stack !== value_modifed) {
         %SetScopeVariableValue(this.break_id_,
                                this.details_.frameId(),
                                this.details_.inlinedFrameIndex(),
                                0,
                                n,
-                               value_after);
+                               value_modifed);
       }
     }
   }
index c932773a5fdf75bd248a97523ee30ce3e04a1df1..081774f21a614d5ea61234735c7789098aa7da2c 100644 (file)
@@ -12422,8 +12422,10 @@ static MaybeObject* DebugEvaluate(Isolate* isolate,
 // stack frame is currently stopped when we compile and run the (direct) eval.
 // Returns array of
 // #0: evaluate result
-// #1: local variables scope materizalized as object before evaluation
-// #2: local variables scope materizalized as object after evaluation
+// #1: local variables materizalized again as object after evaluation, contain
+//     original variable values as they remained on stack
+// #2: local variables materizalized as object before evaluation (and possibly
+//     modified by expression having been executed)
 // Since user expression only reaches (and modifies) copies of local variables,
 // those copies are returned to the caller to allow tracking the changes and
 // manually updating the actual variables.
@@ -12533,14 +12535,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluate) {
   }
   Handle<Object> evaluate_result(evaluate_result_object, isolate);
 
-  Handle<JSObject> local_scope_after = MaterializeLocalScopeWithFrameInspector(
-      isolate, frame, &frame_inspector);
+  Handle<JSObject> local_scope_control_copy =
+      MaterializeLocalScopeWithFrameInspector(isolate, frame,
+                                              &frame_inspector);
 
-  Handle<FixedArray> resultArray =
-      isolate->factory()->NewFixedArray(3);
+  Handle<FixedArray> resultArray = isolate->factory()->NewFixedArray(3);
   resultArray->set(0, *evaluate_result);
+  resultArray->set(1, *local_scope_control_copy);
   resultArray->set(2, *local_scope);
-  resultArray->set(1, *local_scope_after);
 
   return *(isolate->factory()->NewJSArrayWithElements(resultArray));
 }