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

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

Issue 1114563003: Optimize the typeof operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. 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
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/arm/lithium-codegen-arm.h" 7 #include "src/arm/lithium-codegen-arm.h"
8 #include "src/arm/lithium-gap-resolver-arm.h" 8 #include "src/arm/lithium-gap-resolver-arm.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 5532 matching lines...) Expand 10 before | Expand all | Expand 10 after
5543 __ mov(r2, Operand(instr->hydrogen()->shared_info())); 5543 __ mov(r2, Operand(instr->hydrogen()->shared_info()));
5544 __ mov(r1, Operand(pretenure ? factory()->true_value() 5544 __ mov(r1, Operand(pretenure ? factory()->true_value()
5545 : factory()->false_value())); 5545 : factory()->false_value()));
5546 __ Push(cp, r2, r1); 5546 __ Push(cp, r2, r1);
5547 CallRuntime(Runtime::kNewClosure, 3, instr); 5547 CallRuntime(Runtime::kNewClosure, 3, instr);
5548 } 5548 }
5549 } 5549 }
5550 5550
5551 5551
5552 void LCodeGen::DoTypeof(LTypeof* instr) { 5552 void LCodeGen::DoTypeof(LTypeof* instr) {
5553 Register input = ToRegister(instr->value()); 5553 DCHECK(ToRegister(instr->value()).is(r3));
5554 __ push(input); 5554 DCHECK(ToRegister(instr->result()).is(r0));
5555 CallRuntime(Runtime::kTypeof, 1, instr); 5555 Label end, do_call;
5556 Register value_register = ToRegister(instr->value());
5557 __ JumpIfNotSmi(value_register, &do_call);
5558 __ mov(r0, Operand(isolate()->factory()->number_string()));
5559 __ jmp(&end);
5560 __ bind(&do_call);
5561 TypeofStub stub(isolate());
5562 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5563 __ bind(&end);
5556 } 5564 }
5557 5565
5558 5566
5559 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { 5567 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
5560 Register input = ToRegister(instr->value()); 5568 Register input = ToRegister(instr->value());
5561 5569
5562 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_), 5570 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_),
5563 instr->FalseLabel(chunk_), 5571 instr->FalseLabel(chunk_),
5564 input, 5572 input,
5565 instr->type_literal()); 5573 instr->type_literal());
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
5943 __ Push(scope_info); 5951 __ Push(scope_info);
5944 __ push(ToRegister(instr->function())); 5952 __ push(ToRegister(instr->function()));
5945 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5953 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5946 RecordSafepoint(Safepoint::kNoLazyDeopt); 5954 RecordSafepoint(Safepoint::kNoLazyDeopt);
5947 } 5955 }
5948 5956
5949 5957
5950 #undef __ 5958 #undef __
5951 5959
5952 } } // namespace v8::internal 5960 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698