| Index: test/cctest/test-heap.cc
|
| diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
|
| index d0bec935d43b991049fe6b28e57e9573da5aa562..963c91b7f3106cc1b4f69b1c6e40cfa297500ae0 100644
|
| --- a/test/cctest/test-heap.cc
|
| +++ b/test/cctest/test-heap.cc
|
| @@ -2079,6 +2079,30 @@ TEST(OptimizedPretenuringArrayLiterals) {
|
| }
|
|
|
|
|
| +TEST(OptimizedPretenuringSimpleArrayLiterals) {
|
| + i::FLAG_allow_natives_syntax = true;
|
| + i::FLAG_pretenure_literals = false;
|
| + InitializeVM();
|
| + if (!i::V8::UseCrankshaft() || i::FLAG_always_opt) return;
|
| + if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
|
| + v8::HandleScope scope(env->GetIsolate());
|
| +
|
| + AlwaysAllocateScope always_allocate;
|
| + v8::Local<v8::Value> res = CompileRun(
|
| + "function f() {"
|
| + " return [1, 2, 3];"
|
| + "};"
|
| + "f(); f(); f();"
|
| + "%OptimizeFunctionOnNextCall(f);"
|
| + "f();");
|
| +
|
| + Handle<JSObject> o =
|
| + v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
|
| +
|
| + CHECK(HEAP->InNewSpace(*o));
|
| +}
|
| +
|
| +
|
| // Test regular array literals allocation.
|
| TEST(OptimizedAllocationArrayLiterals) {
|
| i::FLAG_allow_natives_syntax = true;
|
|
|