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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/compiler/code-generator.h" | 6 #include "src/compiler/code-generator.h" |
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/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 __ bind(&done); | 548 __ bind(&done); |
549 } | 549 } |
550 | 550 |
551 // Assembles an instruction after register allocation, producing machine code. | 551 // Assembles an instruction after register allocation, producing machine code. |
552 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( | 552 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
553 Instruction* instr) { | 553 Instruction* instr) { |
554 MipsOperandConverter i(this, instr); | 554 MipsOperandConverter i(this, instr); |
555 InstructionCode opcode = instr->opcode(); | 555 InstructionCode opcode = instr->opcode(); |
556 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); | 556 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
557 switch (arch_opcode) { | 557 switch (arch_opcode) { |
| 558 case kArchCallWasmFunction: { |
| 559 DCHECK(instr->InputAt(0)->IsImmediate()); |
| 560 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
| 561 DCHECK(callee_operand.type() == Constant::Type::kInt32); |
| 562 __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
| 563 callee_operand.rmode()); |
| 564 RecordCallPosition(instr); |
| 565 frame_access_state()->ClearSPDelta(); |
| 566 break; |
| 567 } |
558 case kArchCallCodeObject: { | 568 case kArchCallCodeObject: { |
559 EnsureSpaceForLazyDeopt(); | 569 EnsureSpaceForLazyDeopt(); |
560 if (instr->InputAt(0)->IsImmediate()) { | 570 if (instr->InputAt(0)->IsImmediate()) { |
561 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 571 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
562 RelocInfo::CODE_TARGET); | 572 RelocInfo::CODE_TARGET); |
563 } else { | 573 } else { |
564 __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 574 __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
565 __ Call(at); | 575 __ Call(at); |
566 } | 576 } |
567 RecordCallPosition(instr); | 577 RecordCallPosition(instr); |
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2262 padding_size -= v8::internal::Assembler::kInstrSize; | 2272 padding_size -= v8::internal::Assembler::kInstrSize; |
2263 } | 2273 } |
2264 } | 2274 } |
2265 } | 2275 } |
2266 | 2276 |
2267 #undef __ | 2277 #undef __ |
2268 | 2278 |
2269 } // namespace compiler | 2279 } // namespace compiler |
2270 } // namespace internal | 2280 } // namespace internal |
2271 } // namespace v8 | 2281 } // namespace v8 |
OLD | NEW |