Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 3b232e6e93ee2d307e5ea9504266825fb9f11b36..183df0897ddc94bb1c7c1d71d7866265fe833d10 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -6321,6 +6321,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() > |
@@ -6330,7 +6335,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; |
} |
@@ -6728,9 +6733,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. |
@@ -6809,9 +6811,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(); |
@@ -9131,36 +9130,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())); |
@@ -9180,6 +9149,15 @@ void HOptimizedGraphBuilder::GenerateMathSqrt(CallRuntime* call) { |
} |
+void HOptimizedGraphBuilder::GenerateMathFloor(CallRuntime* call) { |
+ ASSERT(call->arguments()->length() == 1); |
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
+ HValue* value = Pop(); |
+ HInstruction* result = New<HUnaryMathOperation>(value, kMathFloor); |
+ return ast_context()->ReturnInstruction(result, call->id()); |
+} |
+ |
+ |
// Check whether two RegExps are equivalent |
void HOptimizedGraphBuilder::GenerateIsRegExpEquivalent(CallRuntime* call) { |
return Bailout(kInlinedRuntimeFunctionIsRegExpEquivalent); |