Commit 5c5c55fb authored by chunyang.dai's avatar chunyang.dai Committed by Commit bot

X87: implement MathPow stub for X87.

  In CL 0fe2fbd1 the implementation of
  MathPow for all ports are unified and MathPow stub code is invoked.
  So we move the direct runtime function call from full-codegen to MathPow
  stub for X87 platform.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#29865}
parent 20ebc602
......@@ -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();
}
}
......
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