Reviewers: Yang,

Message:
Hi Yang

This is a follow-up change for updating local scope algorithm. Unfortunately, I
named my variables very misleading and stealthily swapped them.

This change does not alter behavior.

Peter

Description:
Fix misleading names and comments in mute local variables debugger helper

Please review this at https://codereview.chromium.org/17644013/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mirror-debugger.js
  M src/runtime.cc


Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index 91097ea70163224cc34610a91fba50a56c26000a..28b8fc81baa2c067022dfeb67c03303ee3767c29 100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -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: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 8917c585908bf89da27d23cf03d0c92d2130447d..89c6698a7246ffe33d2caf376720817e7e623c8c 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -12426,8 +12426,9 @@ 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 as object after evaluation
+// #2: local variables materizalized as object before evaluation (and possibly
+//     changed)
// 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.
@@ -12543,8 +12544,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugEvaluate) {
   Handle<FixedArray> resultArray =
       isolate->factory()->NewFixedArray(3);
   resultArray->set(0, *evaluate_result);
-  resultArray->set(2, *local_scope);
   resultArray->set(1, *local_scope_after);
+  resultArray->set(2, *local_scope);

   return *(isolate->factory()->NewJSArrayWithElements(resultArray));
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to