From 9b6d753170f9a0421b9a6788b355f5096e8981ac Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Tue, 9 Aug 2016 05:16:48 -0700 Subject: [PATCH] [test] Speedup serializer test for large code objects. R=yangguo@chromium.org TEST=cctest/test-serialize/CodeSerializerLargeCodeObject Review-Url: https://codereview.chromium.org/2226233002 Cr-Commit-Position: refs/heads/master@{#38489} --- test/cctest/cctest.status | 23 ----------------------- test/cctest/test-serialize.cc | 12 ++++++++---- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status index 4212c64031..eb8368598d 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -321,17 +321,9 @@ }], # 'arch == ppc64 and simulator_run == True' -############################################################################## -['variant == stress', { - 'test-serialize/CodeSerializerLargeCodeObject': [SKIP], -}], # variant == stress - ############################################################################## ['variant == turbofan', { - # Too many inputs into the merge of the handler block. And slow! - 'test-serialize/CodeSerializerLargeCodeObject': [SKIP], - # TODO(bmeurer): TurboFan embeds strong references to all kinds of objects # via deoptimization data (Crankshaft also does this, but lack proper test # coverage). @@ -344,14 +336,6 @@ }], # variant == turbofan -############################################################################## -['variant == turbofan_opt', { - - # Too many inputs into the merge of the handler block. And slow! - 'test-serialize/CodeSerializerLargeCodeObject': [SKIP], - -}], # variant == turbofan_opt - ############################################################################## ['variant == ignition', { # TODO(rmcilroy,4680): Related to lack of code flushing. Check failed: !function->shared()->is_compiled() || function->IsOptimized(). @@ -400,9 +384,6 @@ # with crankshaft. 'test-cpu-profiler/TickLinesOptimized': [SKIP], - # TOOD(mstarzinger): Test expectation does not respect bytecode array. - 'test-serialize/CodeSerializerLargeCodeObject': [FAIL], - # TurboFan cpu profiler result is different. 'test-cpu-profiler/DeoptAtFirstLevelInlinedSource': [FAIL], 'test-cpu-profiler/DeoptAtSecondLevelInlinedSource': [FAIL], @@ -457,7 +438,6 @@ 'test-run-inlining/SimpleInliningContextDeopt': [FAIL], 'test-run-inlining/SimpleInliningContext': [FAIL], 'test-run-inlining/SimpleInlining': [FAIL], - 'test-serialize/CodeSerializerLargeCodeObject': [FAIL], }], # variant == ignition_staging ############################################################################## @@ -529,9 +509,6 @@ # BUG(4751). Flaky with Ignition. 'test-cpu-profiler/JsNativeJsSample': [SKIP], - # TOOD(mstarzinger): Test expectation does not respect bytecode array. - 'test-serialize/CodeSerializerLargeCodeObject': [FAIL], - # TODO(bmeurer): TurboFan embeds strong references to all kinds of objects # via deoptimization data (Crankshaft also does this, but lack proper test # coverage). diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc index a2e29db133..480699c97c 100644 --- a/test/cctest/test-serialize.cc +++ b/test/cctest/test-serialize.cc @@ -1060,10 +1060,14 @@ TEST(CodeSerializerLargeCodeObject) { v8::HandleScope scope(CcTest::isolate()); + // The serializer only tests the shared code, which is always the unoptimized + // code. Don't even bother generating optimized code to avoid timeouts. + FLAG_always_opt = false; + Vector source = - ConstructSource(STATIC_CHAR_VECTOR("var j=1; try { if (j) throw 1;"), - STATIC_CHAR_VECTOR("for(var i=0;i<1;i++)j++;"), - STATIC_CHAR_VECTOR("} catch (e) { j=7; } j"), 10000); + ConstructSource(STATIC_CHAR_VECTOR("var j=1; if (!j) {"), + STATIC_CHAR_VECTOR("for (let i of Object.prototype);"), + STATIC_CHAR_VECTOR("} j=7; j"), 1500); Handle source_str = isolate->factory()->NewStringFromOneByte(source).ToHandleChecked(); @@ -1074,7 +1078,7 @@ TEST(CodeSerializerLargeCodeObject) { CompileScript(isolate, source_str, Handle(), &cache, v8::ScriptCompiler::kProduceCodeCache); - CHECK(isolate->heap()->InSpace(orig->code(), LO_SPACE)); + CHECK(isolate->heap()->InSpace(orig->abstract_code(), LO_SPACE)); Handle copy; {