OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |