Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index cc6bb341d3848a33f4e3342bdca1a2323bd54e1b..7c42a3bcd63c0eb952d133a2c4e64863e5be2056 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -6705,6 +6705,11 @@ int HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) { |
Handle<JSFunction> caller = current_info()->closure(); |
Handle<SharedFunctionInfo> target_shared(target->shared()); |
+ // Always inline builtins marked for inlining. |
+ if (target->IsBuiltin()) { |
+ return target_shared->inline_builtin() ? 0 : kNotInlinable; |
+ } |
+ |
// Do a quick check on source code length to avoid parsing large |
// inlining candidates. |
if (target_shared->SourceSize() > |
@@ -6714,7 +6719,7 @@ int HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) { |
} |
// Target must be inlineable. |
- if (!target->IsInlineable()) { |
+ if (!target_shared->IsInlineable()) { |
TraceInline(target, caller, "target not inlineable"); |
return kNotInlinable; |
} |
@@ -7094,9 +7099,6 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinFunctionCall(Call* expr, |
case kMathAbs: |
case kMathSqrt: |
case kMathLog: |
- case kMathSin: |
- case kMathCos: |
- case kMathTan: |
if (expr->arguments()->length() == 1) { |
HValue* argument = Pop(); |
Drop(1); // Receiver. |
@@ -7175,9 +7177,6 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( |
case kMathAbs: |
case kMathSqrt: |
case kMathLog: |
- case kMathSin: |
- case kMathCos: |
- case kMathTan: |
if (argument_count == 2 && check_type == RECEIVER_MAP_CHECK) { |
AddCheckConstantFunction(expr->holder(), receiver, receiver_map); |
HValue* argument = Pop(); |
@@ -9506,36 +9505,6 @@ void HOptimizedGraphBuilder::GenerateMathPow(CallRuntime* call) { |
} |
-void HOptimizedGraphBuilder::GenerateMathSin(CallRuntime* call) { |
- ASSERT_EQ(1, call->arguments()->length()); |
- CHECK_ALIVE(VisitArgumentList(call->arguments())); |
- HCallStub* result = New<HCallStub>(CodeStub::TranscendentalCache, 1); |
- result->set_transcendental_type(TranscendentalCache::SIN); |
- Drop(1); |
- return ast_context()->ReturnInstruction(result, call->id()); |
-} |
- |
- |
-void HOptimizedGraphBuilder::GenerateMathCos(CallRuntime* call) { |
- ASSERT_EQ(1, call->arguments()->length()); |
- CHECK_ALIVE(VisitArgumentList(call->arguments())); |
- HCallStub* result = New<HCallStub>(CodeStub::TranscendentalCache, 1); |
- result->set_transcendental_type(TranscendentalCache::COS); |
- Drop(1); |
- return ast_context()->ReturnInstruction(result, call->id()); |
-} |
- |
- |
-void HOptimizedGraphBuilder::GenerateMathTan(CallRuntime* call) { |
- ASSERT_EQ(1, call->arguments()->length()); |
- CHECK_ALIVE(VisitArgumentList(call->arguments())); |
- HCallStub* result = New<HCallStub>(CodeStub::TranscendentalCache, 1); |
- result->set_transcendental_type(TranscendentalCache::TAN); |
- Drop(1); |
- return ast_context()->ReturnInstruction(result, call->id()); |
-} |
- |
- |
void HOptimizedGraphBuilder::GenerateMathLog(CallRuntime* call) { |
ASSERT_EQ(1, call->arguments()->length()); |
CHECK_ALIVE(VisitArgumentList(call->arguments())); |