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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 5631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5642 __ sd(a3, FieldMemOperand(v0, i)); | 5642 __ sd(a3, FieldMemOperand(v0, i)); |
5643 __ sd(a2, FieldMemOperand(v0, i + kPointerSize)); | 5643 __ sd(a2, FieldMemOperand(v0, i + kPointerSize)); |
5644 } | 5644 } |
5645 if ((size % (2 * kPointerSize)) != 0) { | 5645 if ((size % (2 * kPointerSize)) != 0) { |
5646 __ ld(a3, FieldMemOperand(a1, size - kPointerSize)); | 5646 __ ld(a3, FieldMemOperand(a1, size - kPointerSize)); |
5647 __ sd(a3, FieldMemOperand(v0, size - kPointerSize)); | 5647 __ sd(a3, FieldMemOperand(v0, size - kPointerSize)); |
5648 } | 5648 } |
5649 } | 5649 } |
5650 | 5650 |
5651 | 5651 |
5652 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | |
5653 DCHECK(ToRegister(instr->context()).is(cp)); | |
5654 // Use the fast case closure allocation code that allocates in new | |
5655 // space for nested functions that don't need literals cloning. | |
5656 bool pretenure = instr->hydrogen()->pretenure(); | |
5657 if (!pretenure && instr->hydrogen()->has_no_literals()) { | |
5658 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(), | |
5659 instr->hydrogen()->kind()); | |
5660 __ li(a2, Operand(instr->hydrogen()->shared_info())); | |
5661 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
5662 } else { | |
5663 __ li(a2, Operand(instr->hydrogen()->shared_info())); | |
5664 __ li(a1, Operand(pretenure ? factory()->true_value() | |
5665 : factory()->false_value())); | |
5666 __ Push(cp, a2, a1); | |
5667 CallRuntime(Runtime::kNewClosure, 3, instr); | |
5668 } | |
5669 } | |
5670 | |
5671 | |
5672 void LCodeGen::DoTypeof(LTypeof* instr) { | 5652 void LCodeGen::DoTypeof(LTypeof* instr) { |
5673 DCHECK(ToRegister(instr->value()).is(a3)); | 5653 DCHECK(ToRegister(instr->value()).is(a3)); |
5674 DCHECK(ToRegister(instr->result()).is(v0)); | 5654 DCHECK(ToRegister(instr->result()).is(v0)); |
5675 Label end, do_call; | 5655 Label end, do_call; |
5676 Register value_register = ToRegister(instr->value()); | 5656 Register value_register = ToRegister(instr->value()); |
5677 __ JumpIfNotSmi(value_register, &do_call); | 5657 __ JumpIfNotSmi(value_register, &do_call); |
5678 __ li(v0, Operand(isolate()->factory()->number_string())); | 5658 __ li(v0, Operand(isolate()->factory()->number_string())); |
5679 __ jmp(&end); | 5659 __ jmp(&end); |
5680 __ bind(&do_call); | 5660 __ bind(&do_call); |
5681 TypeofStub stub(isolate()); | 5661 TypeofStub stub(isolate()); |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6111 __ Push(at, ToRegister(instr->function())); | 6091 __ Push(at, ToRegister(instr->function())); |
6112 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6092 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6113 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6093 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6114 } | 6094 } |
6115 | 6095 |
6116 | 6096 |
6117 #undef __ | 6097 #undef __ |
6118 | 6098 |
6119 } // namespace internal | 6099 } // namespace internal |
6120 } // namespace v8 | 6100 } // namespace v8 |
OLD | NEW |