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/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 // Assembles an instruction after register allocation, producing machine code. | 464 // Assembles an instruction after register allocation, producing machine code. |
465 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( | 465 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
466 Instruction* instr) { | 466 Instruction* instr) { |
467 ArmOperandConverter i(this, instr); | 467 ArmOperandConverter i(this, instr); |
468 | 468 |
469 __ MaybeCheckConstPool(); | 469 __ MaybeCheckConstPool(); |
470 InstructionCode opcode = instr->opcode(); | 470 InstructionCode opcode = instr->opcode(); |
471 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); | 471 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
472 switch (arch_opcode) { | 472 switch (arch_opcode) { |
| 473 case kArchCallWasmFunction: { |
| 474 DCHECK((instr->InputAt(0)->IsImmediate())); |
| 475 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
| 476 DCHECK(callee_operand.type() == Constant::Type::kInt32); |
| 477 __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
| 478 callee_operand.rmode()); |
| 479 RecordCallPosition(instr); |
| 480 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 481 frame_access_state()->ClearSPDelta(); |
| 482 break; |
| 483 } |
473 case kArchCallCodeObject: { | 484 case kArchCallCodeObject: { |
474 EnsureSpaceForLazyDeopt(); | 485 EnsureSpaceForLazyDeopt(); |
475 if (instr->InputAt(0)->IsImmediate()) { | 486 if (instr->InputAt(0)->IsImmediate()) { |
476 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 487 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
477 RelocInfo::CODE_TARGET); | 488 RelocInfo::CODE_TARGET); |
478 } else { | 489 } else { |
479 __ add(ip, i.InputRegister(0), | 490 __ add(ip, i.InputRegister(0), |
480 Operand(Code::kHeaderSize - kHeapObjectTag)); | 491 Operand(Code::kHeaderSize - kHeapObjectTag)); |
481 __ Call(ip); | 492 __ Call(ip); |
482 } | 493 } |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 padding_size -= v8::internal::Assembler::kInstrSize; | 1718 padding_size -= v8::internal::Assembler::kInstrSize; |
1708 } | 1719 } |
1709 } | 1720 } |
1710 } | 1721 } |
1711 | 1722 |
1712 #undef __ | 1723 #undef __ |
1713 | 1724 |
1714 } // namespace compiler | 1725 } // namespace compiler |
1715 } // namespace internal | 1726 } // namespace internal |
1716 } // namespace v8 | 1727 } // namespace v8 |
OLD | NEW |