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

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

Issue 238543005: Move property addition code from JSObject to Map (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed last comments Created 6 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/objects.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-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index eec5264eb8c4b9c46c600d9f617087eeb8cbbd69..339768b95fc188342ec2536c8b1f0eef58e5894d 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2637,14 +2637,15 @@ TEST(Regress1465) {
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 256;
+ CompileRun("function F() {}");
{
AlwaysAllocateScope always_allocate(CcTest::i_isolate());
for (int i = 0; i < transitions_count; i++) {
EmbeddedVector<char, 64> buffer;
- OS::SNPrintF(buffer, "var o = new Object; o.prop%d = %d;", i, i);
+ OS::SNPrintF(buffer, "var o = new F; o.prop%d = %d;", i, i);
CompileRun(buffer.start());
}
- CompileRun("var root = new Object;");
+ CompileRun("var root = new F;");
}
Handle<JSObject> root =
@@ -2673,7 +2674,7 @@ static void AddTransitions(int transitions_count) {
AlwaysAllocateScope always_allocate(CcTest::i_isolate());
for (int i = 0; i < transitions_count; i++) {
EmbeddedVector<char, 64> buffer;
- OS::SNPrintF(buffer, "var o = new Object; o.prop%d = %d;", i, i);
+ OS::SNPrintF(buffer, "var o = new F; o.prop%d = %d;", i, i);
CompileRun(buffer.start());
}
}
@@ -2706,8 +2707,9 @@ TEST(TransitionArrayShrinksDuringAllocToZero) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
+ CompileRun("function F() { }");
AddTransitions(transitions_count);
- CompileRun("var root = new Object;");
+ CompileRun("var root = new F;");
Handle<JSObject> root = GetByName("root");
// Count number of live transitions before marking.
@@ -2715,8 +2717,8 @@ TEST(TransitionArrayShrinksDuringAllocToZero) {
CHECK_EQ(transitions_count, transitions_before);
// Get rid of o
- CompileRun("o = new Object;"
- "root = new Object");
+ CompileRun("o = new F;"
+ "root = new F");
root = GetByName("root");
AddPropertyTo(2, root, "funny");
@@ -2734,8 +2736,9 @@ TEST(TransitionArrayShrinksDuringAllocToOne) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
+ CompileRun("function F() {}");
AddTransitions(transitions_count);
- CompileRun("var root = new Object;");
+ CompileRun("var root = new F;");
Handle<JSObject> root = GetByName("root");
// Count number of live transitions before marking.
@@ -2759,8 +2762,9 @@ TEST(TransitionArrayShrinksDuringAllocToOnePropertyFound) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
+ CompileRun("function F() {}");
AddTransitions(transitions_count);
- CompileRun("var root = new Object;");
+ CompileRun("var root = new F;");
Handle<JSObject> root = GetByName("root");
// Count number of live transitions before marking.
@@ -2784,16 +2788,17 @@ TEST(TransitionArraySimpleToFull) {
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 1;
+ CompileRun("function F() {}");
AddTransitions(transitions_count);
- CompileRun("var root = new Object;");
+ CompileRun("var root = new F;");
Handle<JSObject> root = GetByName("root");
// Count number of live transitions before marking.
int transitions_before = CountMapTransitions(root->map());
CHECK_EQ(transitions_count, transitions_before);
- CompileRun("o = new Object;"
- "root = new Object");
+ CompileRun("o = new F;"
+ "root = new F");
root = GetByName("root");
ASSERT(root->map()->transitions()->IsSimpleTransition());
AddPropertyTo(2, root, "happy");
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698