Index: test/cctest/test-heap.cc |
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc |
index fd85b023be6dff3e7863817fde736fbfaffbfbcd..4c286f2c1c14e38eb22694ac933850ab7d27099c 100644 |
--- a/test/cctest/test-heap.cc |
+++ b/test/cctest/test-heap.cc |
@@ -3312,106 +3312,6 @@ TEST(OptimizedPretenuringNestedDoubleLiterals) { |
} |
-// Make sure pretenuring feedback is gathered for constructed objects as well |
-// as for literals. |
-TEST(OptimizedPretenuringConstructorCalls) { |
- if (!i::FLAG_pretenuring_call_new) { |
- // FLAG_pretenuring_call_new needs to be synced with the snapshot. |
- return; |
- } |
- i::FLAG_allow_natives_syntax = true; |
- i::FLAG_expose_gc = true; |
- CcTest::InitializeVM(); |
- if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; |
- if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; |
- v8::HandleScope scope(CcTest::isolate()); |
- |
- // Grow new space unitl maximum capacity reached. |
- while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { |
- CcTest::heap()->new_space()->Grow(); |
- } |
- |
- i::ScopedVector<char> source(1024); |
- // Call new is doing slack tracking for the first |
- // JSFunction::kGenerousAllocationCount allocations, and we can't find |
- // mementos during that time. |
- i::SNPrintF( |
- source, |
- "var number_elements = %d;" |
- "var elements = new Array(number_elements);" |
- "function foo() {" |
- " this.a = 3;" |
- " this.b = {};" |
- "}" |
- "function f() {" |
- " for (var i = 0; i < number_elements; i++) {" |
- " elements[i] = new foo();" |
- " }" |
- " return elements[number_elements - 1];" |
- "};" |
- "f(); gc();" |
- "f(); f();" |
- "%%OptimizeFunctionOnNextCall(f);" |
- "f();", |
- AllocationSite::kPretenureMinimumCreated + |
- JSFunction::kGenerousAllocationCount); |
- |
- v8::Local<v8::Value> res = CompileRun(source.start()); |
- |
- Handle<JSObject> o = |
- v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- |
- CHECK(CcTest::heap()->InOldSpace(*o)); |
-} |
- |
- |
-TEST(OptimizedPretenuringCallNew) { |
- if (!i::FLAG_pretenuring_call_new) { |
- // FLAG_pretenuring_call_new needs to be synced with the snapshot. |
- return; |
- } |
- i::FLAG_allow_natives_syntax = true; |
- i::FLAG_expose_gc = true; |
- CcTest::InitializeVM(); |
- if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; |
- if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; |
- v8::HandleScope scope(CcTest::isolate()); |
- |
- // Grow new space unitl maximum capacity reached. |
- while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { |
- CcTest::heap()->new_space()->Grow(); |
- } |
- |
- i::ScopedVector<char> source(1024); |
- // Call new is doing slack tracking for the first |
- // JSFunction::kGenerousAllocationCount allocations, and we can't find |
- // mementos during that time. |
- i::SNPrintF( |
- source, |
- "var number_elements = %d;" |
- "var elements = new Array(number_elements);" |
- "function g() { this.a = 0; }" |
- "function f() {" |
- " for (var i = 0; i < number_elements; i++) {" |
- " elements[i] = new g();" |
- " }" |
- " return elements[number_elements - 1];" |
- "};" |
- "f(); gc();" |
- "f(); f();" |
- "%%OptimizeFunctionOnNextCall(f);" |
- "f();", |
- AllocationSite::kPretenureMinimumCreated + |
- JSFunction::kGenerousAllocationCount); |
- |
- v8::Local<v8::Value> res = CompileRun(source.start()); |
- |
- Handle<JSObject> o = |
- v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); |
- CHECK(CcTest::heap()->InOldSpace(*o)); |
-} |
- |
- |
// Test regular array literals allocation. |
TEST(OptimizedAllocationArrayLiterals) { |
i::FLAG_allow_natives_syntax = true; |