Revision: 25227
Author: [email protected]
Date: Mon Nov 10 04:53:15 2014 UTC
Log: 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=
[email protected]
Review URL: https://codereview.chromium.org/714573003
Patch from Chunyang Dai <[email protected]>.
https://code.google.com/p/v8/source/detail?r=25227
Modified:
/branches/bleeding_edge/src/x87/code-stubs-x87.cc
=======================================
--- /branches/bleeding_edge/src/x87/code-stubs-x87.cc Tue Oct 21 08:28:00
2014 UTC
+++ /branches/bleeding_edge/src/x87/code-stubs-x87.cc Mon Nov 10 04:53:15
2014 UTC
@@ -2860,6 +2860,25 @@
__ ret(3 * kPointerSize);
generator.SkipSlow(masm, &runtime);
}
+
+
+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,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.