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

Side by Side Diff: src/mips64/lithium-codegen-mips64.cc

Issue 1114563003: Optimize the typeof operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/cpu-profiler.h" 9 #include "src/cpu-profiler.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 5596 matching lines...) Expand 10 before | Expand all | Expand 10 after
5607 } else { 5607 } else {
5608 __ li(a2, Operand(instr->hydrogen()->shared_info())); 5608 __ li(a2, Operand(instr->hydrogen()->shared_info()));
5609 __ li(a1, Operand(pretenure ? factory()->true_value() 5609 __ li(a1, Operand(pretenure ? factory()->true_value()
5610 : factory()->false_value())); 5610 : factory()->false_value()));
5611 __ Push(cp, a2, a1); 5611 __ Push(cp, a2, a1);
5612 CallRuntime(Runtime::kNewClosure, 3, instr); 5612 CallRuntime(Runtime::kNewClosure, 3, instr);
5613 } 5613 }
5614 } 5614 }
5615 5615
5616 5616
5617 void LCodeGen::DoTypeof(LTypeof* instr) { 5617 void LCodeGen::DoTypeof(LTypeof* instr) {
paul.l... 2015/04/28 17:03:37 Delete this duplicated function.
mvstanton 2015/04/29 06:37:24 Oh brother! :p Thanks.
5618 DCHECK(ToRegister(instr->result()).is(v0)); 5618 DCHECK(ToRegister(instr->result()).is(v0));
5619 Register input = ToRegister(instr->value()); 5619 Register input = ToRegister(instr->value());
5620 __ push(input); 5620 __ push(input);
5621 CallRuntime(Runtime::kTypeof, 1, instr); 5621 CallRuntime(Runtime::kTypeof, 1, instr);
5622 } 5622 }
5623 5623
5624 5624
5625 void LCodeGen::DoTypeof(LTypeof* instr) {
5626 DCHECK(ToRegister(instr->value()).is(a3));
5627 DCHECK(ToRegister(instr->result()).is(v0));
5628 Label end, do_call;
5629 Register value_register = ToRegister(instr->value());
5630 __ JumpIfNotSmi(value_register, &do_call);
5631 __ mov(v0, Immediate(isolate()->factory()->number_string()));
paul.l... 2015/04/28 17:03:37 s/b: __ li(v0, Operand(isolate()->factory()->numb
mvstanton 2015/04/29 06:37:24 Done.
5632 __ jmp(&end);
5633 __ bind(&do_call);
5634 TypeofStub stub(isolate());
5635 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5636 __ bind(&end);
5637 }
5638
5639
5625 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { 5640 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
5626 Register input = ToRegister(instr->value()); 5641 Register input = ToRegister(instr->value());
5627 5642
5628 Register cmp1 = no_reg; 5643 Register cmp1 = no_reg;
5629 Operand cmp2 = Operand(no_reg); 5644 Operand cmp2 = Operand(no_reg);
5630 5645
5631 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_), 5646 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_),
5632 instr->FalseLabel(chunk_), 5647 instr->FalseLabel(chunk_),
5633 input, 5648 input,
5634 instr->type_literal(), 5649 instr->type_literal(),
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 __ li(at, scope_info); 6057 __ li(at, scope_info);
6043 __ Push(at, ToRegister(instr->function())); 6058 __ Push(at, ToRegister(instr->function()));
6044 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6059 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6045 RecordSafepoint(Safepoint::kNoLazyDeopt); 6060 RecordSafepoint(Safepoint::kNoLazyDeopt);
6046 } 6061 }
6047 6062
6048 6063
6049 #undef __ 6064 #undef __
6050 6065
6051 } } // namespace v8::internal 6066 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698