X87: Turn ToNumberStub into a PlatformCodeStub again.

port b6737c56eaf51d63ab83b6529f657c15f834623c (r25187)

original commit message:

  Turn ToNumberStub into a PlatformCodeStub again.

  The HydrogenCodeStub is too expensive and there's no easy way to reduce
  this cost, so turning it into a PlatformCodeStub solves that problem until
  we can use TurboFan for code stubs.

BUG=
R=weiliang.lin@intel.com

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

Cr-Commit-Position: refs/heads/master@{#25227}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
weiliang.lin@intel.com 2014-11-10 04:53:15 +00:00
parent 28d6001c05
commit 406fa443e7

View File

@ -2862,6 +2862,25 @@ void SubStringStub::Generate(MacroAssembler* masm) {
}
void ToNumberStub::Generate(MacroAssembler* masm) {
// The ToNumber stub takes one argument in eax.
Label check_heap_number, call_builtin;
__ JumpIfNotSmi(eax, &check_heap_number, Label::kNear);
__ Ret();
__ bind(&check_heap_number);
__ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
__ j(not_equal, &call_builtin, Label::kNear);
__ Ret();
__ bind(&call_builtin);
__ pop(ecx); // Pop return address.
__ push(eax);
__ push(ecx); // Push return address.
__ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION);
}
void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
Register left,
Register right,