From: mvstanton@chromium.org Date: Wed, 15 May 2013 15:17:01 +0000 (+0000) Subject: With flag optimize-constructed-arrays on, ARM and MIPS suffered a performance degrade... X-Git-Tag: upstream/4.7.83~14224 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31b8fc19c3f9e7233156a3b8c7253616c3db19a4;p=platform%2Fupstream%2Fv8.git With flag optimize-constructed-arrays on, ARM and MIPS suffered a performance degrade due to incorrect code in GenerateRecordCallTarget(). The CL also enables flag optimize-constructed-arrays. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/14772043 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14692 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 98e5d8f..a7d2b81 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -4790,6 +4790,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { __ bind(&megamorphic); __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); __ str(ip, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); + __ jmp(&done); // An uninitialized cache is patched with the function or sentinel to // indicate the ElementsKind if function is the Array constructor. diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 95bea4a..3cffa7b 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -258,7 +258,7 @@ DEFINE_bool(unreachable_code_elimination, false, "eliminate unreachable code (hidden behind soft deopts)") DEFINE_bool(track_allocation_sites, true, "Use allocation site info to reduce transitions") -DEFINE_bool(optimize_constructed_arrays, false, +DEFINE_bool(optimize_constructed_arrays, true, "Use allocation site info on constructed arrays") DEFINE_bool(trace_osr, false, "trace on-stack replacement") DEFINE_int(stress_runs, 0, "number of stress runs") diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 48e7e2b..fe33478 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -5158,6 +5158,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { __ bind(&megamorphic); __ LoadRoot(at, Heap::kUndefinedValueRootIndex); __ sw(at, FieldMemOperand(a2, JSGlobalPropertyCell::kValueOffset)); + __ jmp(&done); // An uninitialized cache is patched with the function or sentinel to // indicate the ElementsKind if function is the Array constructor. diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js index 5c7ae13..4560531 100644 --- a/test/mjsunit/allocation-site-info.js +++ b/test/mjsunit/allocation-site-info.js @@ -28,10 +28,6 @@ // Flags: --allow-natives-syntax --smi-only-arrays --expose-gc // Flags: --track-allocation-sites --noalways-opt -// TODO(mvstanton): remove --nooptimize-constructed-arrays and enable -// the constructed array code below when the feature is turned on -// by default. - // Test element kind of objects. // Since --smi-only-arrays affects builtins, its default setting at compile // time sticks if built with snapshot. If --smi-only-arrays is deactivated @@ -41,7 +37,7 @@ // support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8)); support_smi_only_arrays = true; -optimize_constructed_arrays = false; +optimize_constructed_arrays = true; if (support_smi_only_arrays) { print("Tests include smi-only arrays.");