| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index dead4649a419ed43234b8b4063ad209eb4122795..19db3f1e46ca651ac1f2f45d2c41bbe8084c19f7 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -6353,11 +6353,6 @@ 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() >
|
| @@ -6367,7 +6362,7 @@ int HOptimizedGraphBuilder::InliningAstSize(Handle<JSFunction> target) {
|
| }
|
|
|
| // Target must be inlineable.
|
| - if (!target_shared->IsInlineable()) {
|
| + if (!target->IsInlineable()) {
|
| TraceInline(target, caller, "target not inlineable");
|
| return kNotInlinable;
|
| }
|
| @@ -6747,6 +6742,9 @@ 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.
|
| @@ -6825,6 +6823,9 @@ 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();
|
| @@ -9144,30 +9145,51 @@ void HOptimizedGraphBuilder::GenerateMathPow(CallRuntime* call) {
|
| }
|
|
|
|
|
| -void HOptimizedGraphBuilder::GenerateMathLog(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::LOG);
|
| + result->set_transcendental_type(TranscendentalCache::SIN);
|
| Drop(1);
|
| return ast_context()->ReturnInstruction(result, call->id());
|
| }
|
|
|
|
|
| -void HOptimizedGraphBuilder::GenerateMathSqrt(CallRuntime* call) {
|
| - ASSERT(call->arguments()->length() == 1);
|
| - CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
|
| - HValue* value = Pop();
|
| - HInstruction* result = New<HUnaryMathOperation>(value, kMathSqrt);
|
| +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::GenerateMathFloor(CallRuntime* call) {
|
| +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()));
|
| + HCallStub* result = New<HCallStub>(CodeStub::TranscendentalCache, 1);
|
| + result->set_transcendental_type(TranscendentalCache::LOG);
|
| + Drop(1);
|
| + return ast_context()->ReturnInstruction(result, call->id());
|
| +}
|
| +
|
| +
|
| +void HOptimizedGraphBuilder::GenerateMathSqrt(CallRuntime* call) {
|
| ASSERT(call->arguments()->length() == 1);
|
| CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
|
| HValue* value = Pop();
|
| - HInstruction* result = New<HUnaryMathOperation>(value, kMathFloor);
|
| + HInstruction* result = New<HUnaryMathOperation>(value, kMathSqrt);
|
| return ast_context()->ReturnInstruction(result, call->id());
|
| }
|
|
|
|
|