Check for SSE2 support in FullCodeGenerator::EmitMathPow.
authorvegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 25 Mar 2011 12:51:32 +0000 (12:51 +0000)
committervegorov@chromium.org <vegorov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 25 Mar 2011 12:51:32 +0000 (12:51 +0000)
Do not emit call to the MathPowStub when SSE2 is not available because it requires SSE2.

Review URL: http://codereview.chromium.org/6736006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7366 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ia32/full-codegen-ia32.cc

index 24b3f47..2c82220 100644 (file)
@@ -2800,8 +2800,12 @@ void FullCodeGenerator::EmitMathPow(ZoneList<Expression*>* args) {
   VisitForStackValue(args->at(0));
   VisitForStackValue(args->at(1));
 
-  MathPowStub stub;
-  __ CallStub(&stub);
+  if (masm()->isolate()->cpu_features()->IsSupported(SSE2)) {
+    MathPowStub stub;
+    __ CallStub(&stub);
+  } else {
+    __ CallRuntime(Runtime::kMath_pow, 2);
+  }
   context()->Plug(eax);
 }