| 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 } | 226 } |
| 227 break; | 227 break; |
| 228 case kArchCallJSFunction: { | 228 case kArchCallJSFunction: { |
| 229 // TODO(jarin) The load of the context should be separated from the call. | 229 // TODO(jarin) The load of the context should be separated from the call. |
| 230 Register func = i.InputRegister(0); | 230 Register func = i.InputRegister(0); |
| 231 __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset)); | 231 __ movp(rsi, FieldOperand(func, JSFunction::kContextOffset)); |
| 232 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 232 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
| 233 AddSafepointAndDeopt(instr); | 233 AddSafepointAndDeopt(instr); |
| 234 break; | 234 break; |
| 235 } | 235 } |
| 236 case kArchDeoptimize: { | |
| 237 int deoptimization_id = BuildTranslation(instr, 0); | |
| 238 | |
| 239 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | |
| 240 isolate(), deoptimization_id, Deoptimizer::LAZY); | |
| 241 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | |
| 242 break; | |
| 243 } | |
| 244 case kArchDrop: { | 236 case kArchDrop: { |
| 245 int words = MiscField::decode(instr->opcode()); | 237 int words = MiscField::decode(instr->opcode()); |
| 246 __ addq(rsp, Immediate(kPointerSize * words)); | 238 __ addq(rsp, Immediate(kPointerSize * words)); |
| 247 break; | 239 break; |
| 248 } | 240 } |
| 249 case kArchJmp: | 241 case kArchJmp: |
| 250 __ jmp(code_->GetLabel(i.InputBlock(0))); | 242 __ jmp(code_->GetLabel(i.InputBlock(0))); |
| 251 break; | 243 break; |
| 252 case kArchNop: | 244 case kArchNop: |
| 253 // don't emit code for nops. | 245 // don't emit code for nops. |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 cc = no_overflow; | 767 cc = no_overflow; |
| 776 break; | 768 break; |
| 777 } | 769 } |
| 778 __ bind(&check); | 770 __ bind(&check); |
| 779 __ setcc(cc, reg); | 771 __ setcc(cc, reg); |
| 780 __ movzxbl(reg, reg); | 772 __ movzxbl(reg, reg); |
| 781 __ bind(&done); | 773 __ bind(&done); |
| 782 } | 774 } |
| 783 | 775 |
| 784 | 776 |
| 777 void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) { |
| 778 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 779 isolate(), deoptimization_id, Deoptimizer::LAZY); |
| 780 __ call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 781 } |
| 782 |
| 783 |
| 785 void CodeGenerator::AssemblePrologue() { | 784 void CodeGenerator::AssemblePrologue() { |
| 786 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 785 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 787 int stack_slots = frame()->GetSpillSlotCount(); | 786 int stack_slots = frame()->GetSpillSlotCount(); |
| 788 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 787 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 789 __ pushq(rbp); | 788 __ pushq(rbp); |
| 790 __ movq(rbp, rsp); | 789 __ movq(rbp, rsp); |
| 791 const RegList saves = descriptor->CalleeSavedRegisters(); | 790 const RegList saves = descriptor->CalleeSavedRegisters(); |
| 792 if (saves != 0) { // Save callee-saved registers. | 791 if (saves != 0) { // Save callee-saved registers. |
| 793 int register_save_area_size = 0; | 792 int register_save_area_size = 0; |
| 794 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { | 793 for (int i = Register::kNumRegisters - 1; i >= 0; i--) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 } | 995 } |
| 997 | 996 |
| 998 | 997 |
| 999 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 998 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
| 1000 | 999 |
| 1001 #undef __ | 1000 #undef __ |
| 1002 | 1001 |
| 1003 } // namespace internal | 1002 } // namespace internal |
| 1004 } // namespace compiler | 1003 } // namespace compiler |
| 1005 } // namespace v8 | 1004 } // namespace v8 |
| OLD | NEW |