Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1338)

Unified Diff: src/x87/code-stubs-x87.cc

Issue 1258873002: X87: implement MathPow stub for X87. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/code-stubs-x87.cc
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc
index c3903f99ecb04694fabc425f62f3cc0f71275a4b..0fe2cd93c5b47f14d387160f27418fc9232f8a72 100644
--- a/src/x87/code-stubs-x87.cc
+++ b/src/x87/code-stubs-x87.cc
@@ -325,8 +325,28 @@ void FloatingPointHelper::CheckFloatOperands(MacroAssembler* masm,
void MathPowStub::Generate(MacroAssembler* masm) {
- // No SSE2 support
- UNREACHABLE();
+ const Register base = edx;
+ const Register scratch = ecx;
+ Counters* counters = isolate()->counters();
+ Label call_runtime;
+
+ // We will call runtime helper function directly.
+ if (exponent_type() == ON_STACK) {
+ // The arguments are still on the stack.
+ __ bind(&call_runtime);
+ __ TailCallRuntime(Runtime::kMathPowRT, 2, 1);
+
+ // The stub is called from non-optimized code, which expects the result
+ // as heap number in exponent.
+ __ AllocateHeapNumber(eax, scratch, base, &call_runtime);
+ __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset));
+ __ IncrementCounter(counters->math_pow(), 1);
+ __ ret(2 * kPointerSize);
+ } else {
+ // Currently it's only called from full-compiler and exponent type is
+ // ON_STACK.
+ UNIMPLEMENTED();
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698