OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 5805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5816 __ mov(r5, Operand(instr->hydrogen()->shared_info())); | 5816 __ mov(r5, Operand(instr->hydrogen()->shared_info())); |
5817 __ mov(r4, Operand(pretenure ? factory()->true_value() | 5817 __ mov(r4, Operand(pretenure ? factory()->true_value() |
5818 : factory()->false_value())); | 5818 : factory()->false_value())); |
5819 __ Push(cp, r5, r4); | 5819 __ Push(cp, r5, r4); |
5820 CallRuntime(Runtime::kNewClosure, 3, instr); | 5820 CallRuntime(Runtime::kNewClosure, 3, instr); |
5821 } | 5821 } |
5822 } | 5822 } |
5823 | 5823 |
5824 | 5824 |
5825 void LCodeGen::DoTypeof(LTypeof* instr) { | 5825 void LCodeGen::DoTypeof(LTypeof* instr) { |
5826 Register input = ToRegister(instr->value()); | 5826 DCHECK(ToRegister(instr->value()).is(r6)); |
5827 __ push(input); | 5827 DCHECK(ToRegister(instr->result()).is(r3)); |
5828 CallRuntime(Runtime::kTypeof, 1, instr); | 5828 Label end, do_call; |
| 5829 Register value_register = ToRegister(instr->value()); |
| 5830 __ JumpIfNotSmi(value_register, &do_call); |
| 5831 __ mov(r3, Operand(isolate()->factory()->number_string())); |
| 5832 __ b(&end); |
| 5833 __ bind(&do_call); |
| 5834 TypeofStub stub(isolate()); |
| 5835 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 5836 __ bind(&end); |
5829 } | 5837 } |
5830 | 5838 |
5831 | 5839 |
5832 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 5840 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
5833 Register input = ToRegister(instr->value()); | 5841 Register input = ToRegister(instr->value()); |
5834 | 5842 |
5835 Condition final_branch_condition = | 5843 Condition final_branch_condition = |
5836 EmitTypeofIs(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), input, | 5844 EmitTypeofIs(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), input, |
5837 instr->type_literal()); | 5845 instr->type_literal()); |
5838 if (final_branch_condition != kNoCondition) { | 5846 if (final_branch_condition != kNoCondition) { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6205 __ Push(scope_info); | 6213 __ Push(scope_info); |
6206 __ push(ToRegister(instr->function())); | 6214 __ push(ToRegister(instr->function())); |
6207 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6215 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6208 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6216 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6209 } | 6217 } |
6210 | 6218 |
6211 | 6219 |
6212 #undef __ | 6220 #undef __ |
6213 } | 6221 } |
6214 } // namespace v8::internal | 6222 } // namespace v8::internal |
OLD | NEW |