Removed bailout-only 'implementations' of intrinsics in Crankshaft.

Doing a runtime call should always be better than totally giving up
(unless we have fullcode-only intrinsics, which we'll probably never
have).

BUG=v8:3947
LOG=n

Review URL: https://codereview.chromium.org/997543002

Cr-Commit-Position: refs/heads/master@{#27110}
This commit is contained in:
svenpanne 2015-03-10 08:00:08 -07:00 committed by Commit bot
parent 37729a52fd
commit db2d31ab3b
3 changed files with 68 additions and 127 deletions

View File

@ -116,19 +116,8 @@ namespace internal {
"Improper object on prototype chain for store") \
V(kIndexIsNegative, "Index is negative") \
V(kIndexIsTooLarge, "Index is too large") \
V(kInlinedRuntimeFunctionClassOf, "Inlined runtime function: ClassOf") \
V(kInlinedRuntimeFunctionFastOneByteArrayJoin, \
"Inlined runtime function: FastOneByteArrayJoin") \
V(kInlinedRuntimeFunctionGeneratorNext, \
"Inlined runtime function: GeneratorNext") \
V(kInlinedRuntimeFunctionGeneratorThrow, \
"Inlined runtime function: GeneratorThrow") \
V(kInlinedRuntimeFunctionGetFromCache, \
"Inlined runtime function: GetFromCache") \
V(kInlinedRuntimeFunctionIsNonNegativeSmi, \
"Inlined runtime function: IsNonNegativeSmi") \
V(kInlinedRuntimeFunctionIsStringWrapperSafeForDefaultValueOf, \
"Inlined runtime function: IsStringWrapperSafeForDefaultValueOf") \
V(kInliningBailedOut, "Inlining bailed out") \
V(kInputGPRIsExpectedToHaveUpper32Cleared, \
"Input GPR is expected to have upper32 cleared") \

View File

@ -11606,11 +11606,6 @@ void HOptimizedGraphBuilder::GenerateHasFastPackedElements(CallRuntime* call) {
}
void HOptimizedGraphBuilder::GenerateIsNonNegativeSmi(CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionIsNonNegativeSmi);
}
void HOptimizedGraphBuilder::GenerateIsUndetectableObject(CallRuntime* call) {
DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
@ -11620,12 +11615,6 @@ void HOptimizedGraphBuilder::GenerateIsUndetectableObject(CallRuntime* call) {
}
void HOptimizedGraphBuilder::GenerateIsStringWrapperSafeForDefaultValueOf(
CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionIsStringWrapperSafeForDefaultValueOf);
}
// Support for construct call checks.
void HOptimizedGraphBuilder::GenerateIsConstructCall(CallRuntime* call) {
DCHECK(call->arguments()->length() == 0);
@ -11684,14 +11673,6 @@ void HOptimizedGraphBuilder::GenerateArguments(CallRuntime* call) {
}
// Support for accessing the class and value fields of an object.
void HOptimizedGraphBuilder::GenerateClassOf(CallRuntime* call) {
// The special form detected by IsClassOfTest is detected before we get here
// and does not cause a bailout.
return Bailout(kInlinedRuntimeFunctionClassOf);
}
void HOptimizedGraphBuilder::GenerateValueOf(CallRuntime* call) {
DCHECK(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
@ -11996,12 +11977,6 @@ void HOptimizedGraphBuilder::GenerateCallFunction(CallRuntime* call) {
}
void HOptimizedGraphBuilder::GenerateDefaultConstructorCallSuper(
CallRuntime* call) {
return Bailout(kSuperReference);
}
// Fast call to math functions.
void HOptimizedGraphBuilder::GenerateMathPow(CallRuntime* call) {
DCHECK_EQ(2, call->arguments()->length());
@ -12694,22 +12669,6 @@ void HOptimizedGraphBuilder::GenerateGetCachedArrayIndex(CallRuntime* call) {
}
void HOptimizedGraphBuilder::GenerateFastOneByteArrayJoin(CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionFastOneByteArrayJoin);
}
// Support for generators.
void HOptimizedGraphBuilder::GenerateGeneratorNext(CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionGeneratorNext);
}
void HOptimizedGraphBuilder::GenerateGeneratorThrow(CallRuntime* call) {
return Bailout(kInlinedRuntimeFunctionGeneratorThrow);
}
void HOptimizedGraphBuilder::GenerateDebugBreakInOptimizedCode(
CallRuntime* call) {
Add<HDebugBreak>();

View File

@ -2162,81 +2162,74 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
return function_state()->compilation_info()->language_mode();
}
#define FOR_EACH_HYDROGEN_INTRINSIC(F) \
F(IsSmi) \
F(IsNonNegativeSmi) \
F(IsArray) \
F(IsRegExp) \
F(IsJSProxy) \
F(IsConstructCall) \
F(CallFunction) \
F(DefaultConstructorCallSuper) \
F(ArgumentsLength) \
F(Arguments) \
F(ValueOf) \
F(SetValueOf) \
F(DateField) \
F(StringCharFromCode) \
F(StringCharAt) \
F(OneByteSeqStringSetChar) \
F(TwoByteSeqStringSetChar) \
F(ObjectEquals) \
F(IsObject) \
F(IsFunction) \
F(IsUndetectableObject) \
F(IsSpecObject) \
F(IsStringWrapperSafeForDefaultValueOf) \
F(MathPow) \
F(IsMinusZero) \
F(HasCachedArrayIndex) \
F(GetCachedArrayIndex) \
F(FastOneByteArrayJoin) \
F(GeneratorNext) \
F(GeneratorThrow) \
F(DebugBreakInOptimizedCode) \
F(ClassOf) \
F(StringCharCodeAt) \
F(StringAdd) \
F(SubString) \
F(StringCompare) \
F(RegExpExec) \
F(RegExpConstructResult) \
F(GetFromCache) \
F(NumberToString) \
F(DebugIsActive) \
/* Typed Arrays */ \
F(TypedArrayInitialize) \
F(DataViewInitialize) \
F(MaxSmi) \
F(TypedArrayMaxSizeInHeap) \
F(ArrayBufferViewGetByteLength) \
F(ArrayBufferViewGetByteOffset) \
F(TypedArrayGetLength) \
/* ArrayBuffer */ \
F(ArrayBufferGetByteLength) \
/* Maths */ \
F(ConstructDouble) \
F(DoubleHi) \
F(DoubleLo) \
F(MathFloor) \
F(MathSqrtRT) \
F(MathLogRT) \
/* ES6 Collections */ \
F(MapClear) \
F(MapDelete) \
F(MapGet) \
F(MapGetSize) \
F(MapHas) \
F(MapInitialize) \
F(MapSet) \
F(SetAdd) \
F(SetClear) \
F(SetDelete) \
F(SetGetSize) \
F(SetHas) \
F(SetInitialize) \
/* Arrays */ \
F(HasFastPackedElements) \
#define FOR_EACH_HYDROGEN_INTRINSIC(F) \
F(IsSmi) \
F(IsArray) \
F(IsRegExp) \
F(IsJSProxy) \
F(IsConstructCall) \
F(CallFunction) \
F(ArgumentsLength) \
F(Arguments) \
F(ValueOf) \
F(SetValueOf) \
F(DateField) \
F(StringCharFromCode) \
F(StringCharAt) \
F(OneByteSeqStringSetChar) \
F(TwoByteSeqStringSetChar) \
F(ObjectEquals) \
F(IsObject) \
F(IsFunction) \
F(IsUndetectableObject) \
F(IsSpecObject) \
F(MathPow) \
F(IsMinusZero) \
F(HasCachedArrayIndex) \
F(GetCachedArrayIndex) \
F(DebugBreakInOptimizedCode) \
F(StringCharCodeAt) \
F(StringAdd) \
F(SubString) \
F(StringCompare) \
F(RegExpExec) \
F(RegExpConstructResult) \
F(GetFromCache) \
F(NumberToString) \
F(DebugIsActive) \
/* Typed Arrays */ \
F(TypedArrayInitialize) \
F(DataViewInitialize) \
F(MaxSmi) \
F(TypedArrayMaxSizeInHeap) \
F(ArrayBufferViewGetByteLength) \
F(ArrayBufferViewGetByteOffset) \
F(TypedArrayGetLength) \
/* ArrayBuffer */ \
F(ArrayBufferGetByteLength) \
/* Maths */ \
F(ConstructDouble) \
F(DoubleHi) \
F(DoubleLo) \
F(MathFloor) \
F(MathSqrtRT) \
F(MathLogRT) \
/* ES6 Collections */ \
F(MapClear) \
F(MapDelete) \
F(MapGet) \
F(MapGetSize) \
F(MapHas) \
F(MapInitialize) \
F(MapSet) \
F(SetAdd) \
F(SetClear) \
F(SetDelete) \
F(SetGetSize) \
F(SetHas) \
F(SetInitialize) \
/* Arrays */ \
F(HasFastPackedElements) \
F(GetPrototype)
#define GENERATOR_DECLARATION(Name) void Generate##Name(CallRuntime* call);