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

Unified Diff: src/ppc/lithium-codegen-ppc.cc

Issue 1124243002: PPC: Optimize the typeof operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/ppc/interface-descriptors-ppc.cc ('k') | src/ppc/lithium-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/lithium-codegen-ppc.cc
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc
index 2ddb658c35c6c765b35fe31c4afccf2d88f7ed74..2977da5ebc79a8d9fd04b5e1f55363ff8faeda6d 100644
--- a/src/ppc/lithium-codegen-ppc.cc
+++ b/src/ppc/lithium-codegen-ppc.cc
@@ -5823,9 +5823,17 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
void LCodeGen::DoTypeof(LTypeof* instr) {
- Register input = ToRegister(instr->value());
- __ push(input);
- CallRuntime(Runtime::kTypeof, 1, instr);
+ DCHECK(ToRegister(instr->value()).is(r6));
+ DCHECK(ToRegister(instr->result()).is(r3));
+ Label end, do_call;
+ Register value_register = ToRegister(instr->value());
+ __ JumpIfNotSmi(value_register, &do_call);
+ __ mov(r3, Operand(isolate()->factory()->number_string()));
+ __ b(&end);
+ __ bind(&do_call);
+ TypeofStub stub(isolate());
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
+ __ bind(&end);
}
« no previous file with comments | « src/ppc/interface-descriptors-ppc.cc ('k') | src/ppc/lithium-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698