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

Unified Diff: test/mjsunit/regress/regress-325676.js

Issue 107243006: Correctly resolve forcibly context allocated parameters in debug-evaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: reupload Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-325676.js
diff --git a/test/mjsunit/regress/regress-crbug-222893.js b/test/mjsunit/regress/regress-325676.js
similarity index 71%
copy from test/mjsunit/regress/regress-crbug-222893.js
copy to test/mjsunit/regress/regress-325676.js
index 39363bc91251d9b7c06eae0ab41bf674b9151ca4..427bbc38dcb3d909b3bfb1dc3a6008cec63cf9ab 100644
--- a/test/mjsunit/regress/regress-crbug-222893.js
+++ b/test/mjsunit/regress/regress-325676.js
@@ -27,37 +27,43 @@
// Flags: --expose-debug-as debug
-Debug = debug.Debug
+// If a function parameter is forced to be context allocated,
+// debug evaluate need to resolve it to a context slot instead of
+// parameter slot on the stack.
-var error = null;
-var array = ["a", "b", "c"];
+var Debug = debug.Debug;
+
+var expected;
+var exception = null;
function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
try {
- if (event == Debug.DebugEvent.Break) {
- assertArrayEquals(array,
- exec_state.frame(0).evaluate('arguments').value());
- }
+ assertEquals(expected, exec_state.frame(0).evaluate('arg').value());
+ exec_state.frame(0).evaluate('arg = "evaluated";');
} catch (e) {
- error = e;
+ exception = e;
}
-};
+}
Debug.setListener(listener);
+function f(arg) {
+ expected = arg;
+ debugger;
+ assertEquals("evaluated", arg);
-function f(a, b) {
- arguments;
- debugger; // Arguments object is already materialized.
+ arg = "value";
+ expected = arg;
+ debugger;
+ assertEquals("evaluated", arg);
+
+ // Forces arg to be context allocated even though a parameter.
+ function g() { arg; }
}
-f.apply(this, array);
-f("a", "b", "c");
-assertNull(error);
+f();
+f(1);
+f(1, 2);
-function g(a, b) {
- debugger; // Arguments object is not yet materialized.
-}
-g.apply(this, array);
-g("a", "b", "c");
-assertNull(error);
+assertNull(exception);
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698