Actually implement the sqrt intrinsic in Crankshaft

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1441a135
......@@ -10966,7 +10966,13 @@ void HOptimizedGraphBuilder::GenerateMathLog(CallRuntime* call) {
void HOptimizedGraphBuilder::GenerateMathSqrt(CallRuntime* call) {
return Bailout("inlined runtime function: MathSqrt");
ASSERT(call->arguments()->length() == 1);
CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
HValue* value = Pop();
HValue* context = environment()->LookupContext();
HInstruction* result =
HUnaryMathOperation::New(zone(), context, value, kMathSqrt);
return ast_context()->ReturnInstruction(result, call->id());
}
......
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