| 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 5764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5775 DoubleRegister input = ToDoubleRegister(instr->value()); | 5775 DoubleRegister input = ToDoubleRegister(instr->value()); |
| 5776 Register result = ToRegister(instr->result()); | 5776 Register result = ToRegister(instr->result()); |
| 5777 __ TruncateDoubleToI(result, input); | 5777 __ TruncateDoubleToI(result, input); |
| 5778 if (instr->tag_result()) { | 5778 if (instr->tag_result()) { |
| 5779 __ SmiTag(result, result); | 5779 __ SmiTag(result, result); |
| 5780 } | 5780 } |
| 5781 } | 5781 } |
| 5782 | 5782 |
| 5783 | 5783 |
| 5784 void LCodeGen::DoTypeof(LTypeof* instr) { | 5784 void LCodeGen::DoTypeof(LTypeof* instr) { |
| 5785 Register input = ToRegister(instr->value()); | 5785 DCHECK(ToRegister(instr->value()).is(x3)); |
| 5786 __ Push(input); | 5786 DCHECK(ToRegister(instr->result()).is(x0)); |
| 5787 CallRuntime(Runtime::kTypeof, 1, instr); | 5787 Label end, do_call; |
| 5788 Register value_register = ToRegister(instr->value()); |
| 5789 __ JumpIfNotSmi(value_register, &do_call); |
| 5790 __ Mov(x0, Immediate(isolate()->factory()->number_string())); |
| 5791 __ B(&end); |
| 5792 __ Bind(&do_call); |
| 5793 TypeofStub stub(isolate()); |
| 5794 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 5795 __ Bind(&end); |
| 5788 } | 5796 } |
| 5789 | 5797 |
| 5790 | 5798 |
| 5791 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 5799 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
| 5792 Handle<String> type_name = instr->type_literal(); | 5800 Handle<String> type_name = instr->type_literal(); |
| 5793 Label* true_label = instr->TrueLabel(chunk_); | 5801 Label* true_label = instr->TrueLabel(chunk_); |
| 5794 Label* false_label = instr->FalseLabel(chunk_); | 5802 Label* false_label = instr->FalseLabel(chunk_); |
| 5795 Register value = ToRegister(instr->value()); | 5803 Register value = ToRegister(instr->value()); |
| 5796 | 5804 |
| 5797 Factory* factory = isolate()->factory(); | 5805 Factory* factory = isolate()->factory(); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6028 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6036 Handle<ScopeInfo> scope_info = instr->scope_info(); |
| 6029 __ Push(scope_info); | 6037 __ Push(scope_info); |
| 6030 __ Push(ToRegister(instr->function())); | 6038 __ Push(ToRegister(instr->function())); |
| 6031 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6039 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6032 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6040 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6033 } | 6041 } |
| 6034 | 6042 |
| 6035 | 6043 |
| 6036 | 6044 |
| 6037 } } // namespace v8::internal | 6045 } } // namespace v8::internal |
| OLD | NEW |