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}
"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") \
}
+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>();
F(IsMinusZero) \
F(HasCachedArrayIndex) \
F(GetCachedArrayIndex) \
+ F(FastOneByteArrayJoin) \
F(DebugBreakInOptimizedCode) \
F(StringCharCodeAt) \
F(StringAdd) \
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();
}
}
RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
- UNREACHABLE();
+ UNIMPLEMENTED();
return nullptr;
}
}