From: svenpanne Date: Wed, 11 Mar 2015 13:28:29 +0000 (-0700) Subject: Bailout for %_FastOneByteArrayJoin again. X-Git-Tag: upstream/4.7.83~3909 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88a7f24f46c2d0c9d7b19d80d73633ad901fd3c6;p=platform%2Fupstream%2Fv8.git Bailout for %_FastOneByteArrayJoin again. This recovers the performance loss for some ancient benchmarks. Added some comments/UNIMPLEMENTED on the way. BUG=v8:3947 LOG=n Review URL: https://codereview.chromium.org/996153002 Cr-Commit-Position: refs/heads/master@{#27131} --- diff --git a/src/bailout-reason.h b/src/bailout-reason.h index 403a1b4..9b801c8 100644 --- a/src/bailout-reason.h +++ b/src/bailout-reason.h @@ -116,6 +116,8 @@ namespace internal { "Improper object on prototype chain for store") \ V(kIndexIsNegative, "Index is negative") \ V(kIndexIsTooLarge, "Index is too large") \ + V(kInlinedRuntimeFunctionFastOneByteArrayJoin, \ + "Inlined runtime function: FastOneByteArrayJoin") \ V(kInlinedRuntimeFunctionGetFromCache, \ "Inlined runtime function: GetFromCache") \ V(kInliningBailedOut, "Inlining bailed out") \ diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 3246dfa..5b332b3 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -12677,6 +12677,16 @@ void HOptimizedGraphBuilder::GenerateGetCachedArrayIndex(CallRuntime* call) { } +void HOptimizedGraphBuilder::GenerateFastOneByteArrayJoin(CallRuntime* call) { + // Simply returning undefined here would be semantically correct and even + // avoid the bailout. Nevertheless, some ancient benchmarks like SunSpider's + // string-fasta would tank, because fullcode contains an optimized version. + // Obviously the fullcode => Crankshaft => bailout => fullcode dance is + // faster... *sigh* + return Bailout(kInlinedRuntimeFunctionFastOneByteArrayJoin); +} + + void HOptimizedGraphBuilder::GenerateDebugBreakInOptimizedCode( CallRuntime* call) { Add(); diff --git a/src/hydrogen.h b/src/hydrogen.h index da76657..2e7a5dd 100644 --- a/src/hydrogen.h +++ b/src/hydrogen.h @@ -2187,6 +2187,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { F(IsMinusZero) \ F(HasCachedArrayIndex) \ F(GetCachedArrayIndex) \ + F(FastOneByteArrayJoin) \ F(DebugBreakInOptimizedCode) \ F(StringCharCodeAt) \ F(StringAdd) \ diff --git a/src/runtime/runtime-array.cc b/src/runtime/runtime-array.cc index 90a1e2c..0e4f5b4 100644 --- a/src/runtime/runtime-array.cc +++ b/src/runtime/runtime-array.cc @@ -1338,15 +1338,18 @@ RUNTIME_FUNCTION(Runtime_HasCachedArrayIndex) { RUNTIME_FUNCTION(Runtime_GetCachedArrayIndex) { - SealHandleScope shs(isolate); - DCHECK(args.length() == 1); - return isolate->heap()->undefined_value(); + // This can never be reached, because Runtime_HasCachedArrayIndex always + // returns false. + UNIMPLEMENTED(); + return nullptr; } RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { SealHandleScope shs(isolate); DCHECK(args.length() == 2); + // Returning undefined means that this fast path fails and one has to resort + // to a slow path. return isolate->heap()->undefined_value(); } } diff --git a/src/runtime/runtime-classes.cc b/src/runtime/runtime-classes.cc index 36619b0..67d7e69 100644 --- a/src/runtime/runtime-classes.cc +++ b/src/runtime/runtime-classes.cc @@ -454,7 +454,7 @@ RUNTIME_FUNCTION(Runtime_HandleStepInForDerivedConstructors) { RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { - UNREACHABLE(); + UNIMPLEMENTED(); return nullptr; } }