Commit 88a7f24f authored by svenpanne's avatar svenpanne Committed by Commit bot

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}
parent b1a58122
......@@ -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") \
......
......@@ -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<HDebugBreak>();
......
......@@ -2187,6 +2187,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
F(IsMinusZero) \
F(HasCachedArrayIndex) \
F(GetCachedArrayIndex) \
F(FastOneByteArrayJoin) \
F(DebugBreakInOptimizedCode) \
F(StringCharCodeAt) \
F(StringAdd) \
......
......@@ -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();
}
}
......
......@@ -454,7 +454,7 @@ RUNTIME_FUNCTION(Runtime_HandleStepInForDerivedConstructors) {
RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
UNREACHABLE();
UNIMPLEMENTED();
return nullptr;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment