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

Unified Diff: vm/code_index_table_test.cc

Issue 9454024: Change the generated dart test in CodeIndexTableTest so that it does not induce a deep recursion in… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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 | « tests/vm/vm.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/code_index_table_test.cc
===================================================================
--- vm/code_index_table_test.cc (revision 4552)
+++ vm/code_index_table_test.cc (working copy)
@@ -7,6 +7,7 @@
#include "vm/code_index_table.h"
#include "vm/compiler.h"
#include "vm/object.h"
+#include "vm/pages.h"
#include "vm/unit_test.h"
namespace dart {
@@ -65,24 +66,21 @@
// Now load up class B with 1024 functions.
written = OS::SNPrint(scriptChars, kScriptSize, "class B {");
// Create one large function.
- OS::SNPrint(buffer, sizeof(buffer), "static moo0([int i=1]) { return ");
+ OS::SNPrint(buffer, sizeof(buffer), "static moo0([int i=1]) { ");
written += OS::SNPrint((scriptChars + written),
(kScriptSize - written),
"%s",
buffer);
- // Currently this causes about 750KB of code to be allocated. The
- // nesting level of binary operations is reduced from 50000 so this
- // test will pass on Windows. Larger nesting leads to stack overflow
- // in debug mode in the code generation visitor even when the stack
- // reserved size is set to 2MB.
- for (int i = 0; i < 35000; i++) {
- OS::SNPrint(buffer, sizeof(buffer), "i+");
+ // Generate a large function so that the code for this function when
+ // compiled will reside in a large page.
+ for (int i = 0; i < 50000; i++) {
+ OS::SNPrint(buffer, sizeof(buffer), "i = i+i;");
written += OS::SNPrint((scriptChars + written),
(kScriptSize - written),
"%s",
buffer);
}
- OS::SNPrint(buffer, sizeof(buffer), "i; }");
+ OS::SNPrint(buffer, sizeof(buffer), "return i; }");
written += OS::SNPrint((scriptChars + written),
(kScriptSize - written),
"%s",
@@ -144,10 +142,11 @@
code = function.code();
EXPECT(code.Size() > 16);
pc = code.EntryPoint() + 16;
+ EXPECT(code.Size() > PageSpace::kPageSize);
EXPECT(code_index_table->LookupFunction(pc) == function.raw());
EXPECT(code_index_table->LookupCode(pc) == code.raw());
- EXPECT(code.Size() > 750 * KB);
- pc = code.EntryPoint() + 750 * KB;
+ EXPECT(code.Size() > (1 * MB));
+ pc = code.EntryPoint() + (1 * MB);
EXPECT(code_index_table->LookupFunction(pc) == function.raw());
EXPECT(code_index_table->LookupCode(pc) == code.raw());
}
« no previous file with comments | « tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698