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

Side by Side Diff: src/arm64/lithium-codegen-arm64.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/arm64/lithium-arm64.cc ('k') | src/code-factory.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" 7 #include "src/arm64/lithium-codegen-arm64.h"
8 #include "src/arm64/lithium-gap-resolver-arm64.h" 8 #include "src/arm64/lithium-gap-resolver-arm64.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 5777 matching lines...) Expand 10 before | Expand all | Expand 10 after
5788 DoubleRegister input = ToDoubleRegister(instr->value()); 5788 DoubleRegister input = ToDoubleRegister(instr->value());
5789 Register result = ToRegister(instr->result()); 5789 Register result = ToRegister(instr->result());
5790 __ TruncateDoubleToI(result, input); 5790 __ TruncateDoubleToI(result, input);
5791 if (instr->tag_result()) { 5791 if (instr->tag_result()) {
5792 __ SmiTag(result, result); 5792 __ SmiTag(result, result);
5793 } 5793 }
5794 } 5794 }
5795 5795
5796 5796
5797 void LCodeGen::DoTypeof(LTypeof* instr) { 5797 void LCodeGen::DoTypeof(LTypeof* instr) {
5798 Register input = ToRegister(instr->value()); 5798 DCHECK(ToRegister(instr->value()).is(x3));
5799 __ Push(input); 5799 DCHECK(ToRegister(instr->result()).is(x0));
5800 CallRuntime(Runtime::kTypeof, 1, instr); 5800 Label end, do_call;
5801 Register value_register = ToRegister(instr->value());
5802 __ JumpIfNotSmi(value_register, &do_call);
5803 __ Mov(x0, Immediate(isolate()->factory()->number_string()));
5804 __ B(&end);
5805 __ Bind(&do_call);
5806 TypeofStub stub(isolate());
5807 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr);
5808 __ Bind(&end);
5801 } 5809 }
5802 5810
5803 5811
5804 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { 5812 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
5805 Handle<String> type_name = instr->type_literal(); 5813 Handle<String> type_name = instr->type_literal();
5806 Label* true_label = instr->TrueLabel(chunk_); 5814 Label* true_label = instr->TrueLabel(chunk_);
5807 Label* false_label = instr->FalseLabel(chunk_); 5815 Label* false_label = instr->FalseLabel(chunk_);
5808 Register value = ToRegister(instr->value()); 5816 Register value = ToRegister(instr->value());
5809 5817
5810 Factory* factory = isolate()->factory(); 5818 Factory* factory = isolate()->factory();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
6041 Handle<ScopeInfo> scope_info = instr->scope_info(); 6049 Handle<ScopeInfo> scope_info = instr->scope_info();
6042 __ Push(scope_info); 6050 __ Push(scope_info);
6043 __ Push(ToRegister(instr->function())); 6051 __ Push(ToRegister(instr->function()));
6044 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6052 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6045 RecordSafepoint(Safepoint::kNoLazyDeopt); 6053 RecordSafepoint(Safepoint::kNoLazyDeopt);
6046 } 6054 }
6047 6055
6048 6056
6049 6057
6050 } } // namespace v8::internal 6058 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm64/lithium-arm64.cc ('k') | src/code-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698