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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 147 matching lines...) Loading... |
158 case kArchCallJSFunction: { | 158 case kArchCallJSFunction: { |
159 // TODO(jarin) The load of the context should be separated from the call. | 159 // TODO(jarin) The load of the context should be separated from the call. |
160 Register func = i.InputRegister(0); | 160 Register func = i.InputRegister(0); |
161 __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset)); | 161 __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset)); |
162 __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 162 __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
163 __ Call(ip); | 163 __ Call(ip); |
164 AddSafepointAndDeopt(instr); | 164 AddSafepointAndDeopt(instr); |
165 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 165 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
166 break; | 166 break; |
167 } | 167 } |
168 case kArchDeoptimize: { | |
169 int deoptimization_id = BuildTranslation(instr, 0); | |
170 | |
171 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | |
172 isolate(), deoptimization_id, Deoptimizer::LAZY); | |
173 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | |
174 DCHECK_EQ(LeaveCC, i.OutputSBit()); | |
175 break; | |
176 } | |
177 case kArchDrop: { | 168 case kArchDrop: { |
178 int words = MiscField::decode(instr->opcode()); | 169 int words = MiscField::decode(instr->opcode()); |
179 __ Drop(words); | 170 __ Drop(words); |
180 DCHECK_LT(0, words); | 171 DCHECK_LT(0, words); |
181 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 172 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
182 break; | 173 break; |
183 } | 174 } |
184 case kArchJmp: | 175 case kArchJmp: |
185 __ b(code_->GetLabel(i.InputBlock(0))); | 176 __ b(code_->GetLabel(i.InputBlock(0))); |
186 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 177 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
(...skipping 420 matching lines...) Loading... |
607 cc = vc; | 598 cc = vc; |
608 break; | 599 break; |
609 } | 600 } |
610 __ bind(&check); | 601 __ bind(&check); |
611 __ mov(reg, Operand(0)); | 602 __ mov(reg, Operand(0)); |
612 __ mov(reg, Operand(1), LeaveCC, cc); | 603 __ mov(reg, Operand(1), LeaveCC, cc); |
613 __ bind(&done); | 604 __ bind(&done); |
614 } | 605 } |
615 | 606 |
616 | 607 |
| 608 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { |
| 609 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 610 isolate(), deoptimization_id, Deoptimizer::LAZY); |
| 611 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 612 } |
| 613 |
| 614 |
617 void CodeGenerator::AssemblePrologue() { | 615 void CodeGenerator::AssemblePrologue() { |
618 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 616 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
619 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 617 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
620 __ Push(lr, fp); | 618 __ Push(lr, fp); |
621 __ mov(fp, sp); | 619 __ mov(fp, sp); |
622 const RegList saves = descriptor->CalleeSavedRegisters(); | 620 const RegList saves = descriptor->CalleeSavedRegisters(); |
623 if (saves != 0) { // Save callee-saved registers. | 621 if (saves != 0) { // Save callee-saved registers. |
624 int register_save_area_size = 0; | 622 int register_save_area_size = 0; |
625 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { | 623 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
626 if (!((1 << i) & saves)) continue; | 624 if (!((1 << i) & saves)) continue; |
(...skipping 214 matching lines...) Loading... |
841 | 839 |
842 void CodeGenerator::AddNopForSmiCodeInlining() { | 840 void CodeGenerator::AddNopForSmiCodeInlining() { |
843 // On 32-bit ARM we do not insert nops for inlined Smi code. | 841 // On 32-bit ARM we do not insert nops for inlined Smi code. |
844 } | 842 } |
845 | 843 |
846 #undef __ | 844 #undef __ |
847 | 845 |
848 } // namespace compiler | 846 } // namespace compiler |
849 } // namespace internal | 847 } // namespace internal |
850 } // namespace v8 | 848 } // namespace v8 |
OLD | NEW |