OLD | NEW |
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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 5609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5620 __ li(a2, Operand(instr->hydrogen()->shared_info())); | 5620 __ li(a2, Operand(instr->hydrogen()->shared_info())); |
5621 __ li(a1, Operand(pretenure ? factory()->true_value() | 5621 __ li(a1, Operand(pretenure ? factory()->true_value() |
5622 : factory()->false_value())); | 5622 : factory()->false_value())); |
5623 __ Push(cp, a2, a1); | 5623 __ Push(cp, a2, a1); |
5624 CallRuntime(Runtime::kNewClosure, 3, instr); | 5624 CallRuntime(Runtime::kNewClosure, 3, instr); |
5625 } | 5625 } |
5626 } | 5626 } |
5627 | 5627 |
5628 | 5628 |
5629 void LCodeGen::DoTypeof(LTypeof* instr) { | 5629 void LCodeGen::DoTypeof(LTypeof* instr) { |
| 5630 DCHECK(ToRegister(instr->value()).is(a3)); |
5630 DCHECK(ToRegister(instr->result()).is(v0)); | 5631 DCHECK(ToRegister(instr->result()).is(v0)); |
5631 Register input = ToRegister(instr->value()); | 5632 Label end, do_call; |
5632 __ push(input); | 5633 Register value_register = ToRegister(instr->value()); |
5633 CallRuntime(Runtime::kTypeof, 1, instr); | 5634 __ JumpIfNotSmi(value_register, &do_call); |
| 5635 __ li(v0, Operand(isolate()->factory()->number_string())); |
| 5636 __ jmp(&end); |
| 5637 __ bind(&do_call); |
| 5638 TypeofStub stub(isolate()); |
| 5639 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 5640 __ bind(&end); |
5634 } | 5641 } |
5635 | 5642 |
5636 | 5643 |
5637 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 5644 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
5638 Register input = ToRegister(instr->value()); | 5645 Register input = ToRegister(instr->value()); |
5639 | 5646 |
5640 Register cmp1 = no_reg; | 5647 Register cmp1 = no_reg; |
5641 Operand cmp2 = Operand(no_reg); | 5648 Operand cmp2 = Operand(no_reg); |
5642 | 5649 |
5643 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_), | 5650 Condition final_branch_condition = EmitTypeofIs(instr->TrueLabel(chunk_), |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6054 __ li(at, scope_info); | 6061 __ li(at, scope_info); |
6055 __ Push(at, ToRegister(instr->function())); | 6062 __ Push(at, ToRegister(instr->function())); |
6056 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6063 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6057 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6064 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6058 } | 6065 } |
6059 | 6066 |
6060 | 6067 |
6061 #undef __ | 6068 #undef __ |
6062 | 6069 |
6063 } } // namespace v8::internal | 6070 } } // namespace v8::internal |
OLD | NEW |