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 { ...@@ -116,6 +116,8 @@ namespace internal {
"Improper object on prototype chain for store") \ "Improper object on prototype chain for store") \
V(kIndexIsNegative, "Index is negative") \ V(kIndexIsNegative, "Index is negative") \
V(kIndexIsTooLarge, "Index is too large") \ V(kIndexIsTooLarge, "Index is too large") \
V(kInlinedRuntimeFunctionFastOneByteArrayJoin, \
"Inlined runtime function: FastOneByteArrayJoin") \
V(kInlinedRuntimeFunctionGetFromCache, \ V(kInlinedRuntimeFunctionGetFromCache, \
"Inlined runtime function: GetFromCache") \ "Inlined runtime function: GetFromCache") \
V(kInliningBailedOut, "Inlining bailed out") \ V(kInliningBailedOut, "Inlining bailed out") \
......
...@@ -12677,6 +12677,16 @@ void HOptimizedGraphBuilder::GenerateGetCachedArrayIndex(CallRuntime* call) { ...@@ -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( void HOptimizedGraphBuilder::GenerateDebugBreakInOptimizedCode(
CallRuntime* call) { CallRuntime* call) {
Add<HDebugBreak>(); Add<HDebugBreak>();
......
...@@ -2187,6 +2187,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor { ...@@ -2187,6 +2187,7 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
F(IsMinusZero) \ F(IsMinusZero) \
F(HasCachedArrayIndex) \ F(HasCachedArrayIndex) \
F(GetCachedArrayIndex) \ F(GetCachedArrayIndex) \
F(FastOneByteArrayJoin) \
F(DebugBreakInOptimizedCode) \ F(DebugBreakInOptimizedCode) \
F(StringCharCodeAt) \ F(StringCharCodeAt) \
F(StringAdd) \ F(StringAdd) \
......
...@@ -1338,15 +1338,18 @@ RUNTIME_FUNCTION(Runtime_HasCachedArrayIndex) { ...@@ -1338,15 +1338,18 @@ RUNTIME_FUNCTION(Runtime_HasCachedArrayIndex) {
RUNTIME_FUNCTION(Runtime_GetCachedArrayIndex) { RUNTIME_FUNCTION(Runtime_GetCachedArrayIndex) {
SealHandleScope shs(isolate); // This can never be reached, because Runtime_HasCachedArrayIndex always
DCHECK(args.length() == 1); // returns false.
return isolate->heap()->undefined_value(); UNIMPLEMENTED();
return nullptr;
} }
RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) {
SealHandleScope shs(isolate); SealHandleScope shs(isolate);
DCHECK(args.length() == 2); 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(); return isolate->heap()->undefined_value();
} }
} }
......
...@@ -454,7 +454,7 @@ RUNTIME_FUNCTION(Runtime_HandleStepInForDerivedConstructors) { ...@@ -454,7 +454,7 @@ RUNTIME_FUNCTION(Runtime_HandleStepInForDerivedConstructors) {
RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) { RUNTIME_FUNCTION(Runtime_DefaultConstructorCallSuper) {
UNREACHABLE(); UNIMPLEMENTED();
return nullptr; 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