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

Unified Diff: test/cctest/test-debug.cc

Issue 1917006: Inlined load of string.length and array.length.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
===================================================================
--- test/cctest/test-debug.cc (revision 4583)
+++ test/cctest/test-debug.cc (working copy)
@@ -2511,6 +2511,50 @@
}
+// Test of the stepping mechanism for named load in a loop.
+TEST(DebugStepNamedLoadLoop) {
+ v8::HandleScope scope;
+ DebugLocalContext env;
+
+ // Create a function for testing stepping of named load.
+ v8::Local<v8::Function> foo = CompileFunction(
+ &env,
+ "function foo() {\n"
+ " var a = [];\n"
+ " var s = \"\";\n"
+ " for (var i = 0; i < 10; i++) {\n"
+ " var v = new V(i, i + 1);\n"
+ " v.y;\n"
+ " a.length;\n" // Special case: array length.
+ " s.length;\n" // Special case: string length.
+ " }\n"
+ "}\n"
+ "function V(x, y) {\n"
+ " this.x = x;\n"
+ " this.y = y;\n"
+ "}\n",
+ "foo");
+
+ // Call function without any break points to ensure inlining is in place.
+ foo->Call(env->Global(), 0, NULL);
+
+ // Register a debug event listener which steps and counts.
+ v8::Debug::SetDebugEventListener(DebugEventStep);
+
+ // Setup break point and step through the function.
+ SetBreakPoint(foo, 4);
+ step_action = StepNext;
+ break_point_hit_count = 0;
+ foo->Call(env->Global(), 0, NULL);
+
+ // With stepping all break locations are hit.
+ CHECK_EQ(41, break_point_hit_count);
+
+ v8::Debug::SetDebugEventListener(NULL);
+ CheckDebuggerUnloaded();
+}
+
+
// Test the stepping mechanism with different ICs.
TEST(DebugStepLinearMixedICs) {
v8::HandleScope scope;
« no previous file with comments | « src/ic.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698