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/ast/scopes.h" | 7 #include "src/ast/scopes.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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 __ bind(&done); | 427 __ bind(&done); |
428 } | 428 } |
429 | 429 |
430 // Assembles an instruction after register allocation, producing machine code. | 430 // Assembles an instruction after register allocation, producing machine code. |
431 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( | 431 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
432 Instruction* instr) { | 432 Instruction* instr) { |
433 IA32OperandConverter i(this, instr); | 433 IA32OperandConverter i(this, instr); |
434 InstructionCode opcode = instr->opcode(); | 434 InstructionCode opcode = instr->opcode(); |
435 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); | 435 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
436 switch (arch_opcode) { | 436 switch (arch_opcode) { |
| 437 case kArchCallWasmFunction: { |
| 438 DCHECK(HasImmediateInput(instr, 0)); |
| 439 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
| 440 DCHECK(callee_operand.type() == Constant::Type::kInt32); |
| 441 __ wasm_call(callee_operand.ToInt32(), callee_operand.rmode()); |
| 442 RecordCallPosition(instr); |
| 443 frame_access_state()->ClearSPDelta(); |
| 444 break; |
| 445 } |
437 case kArchCallCodeObject: { | 446 case kArchCallCodeObject: { |
438 EnsureSpaceForLazyDeopt(); | 447 EnsureSpaceForLazyDeopt(); |
439 if (HasImmediateInput(instr, 0)) { | 448 if (HasImmediateInput(instr, 0)) { |
440 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); | 449 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); |
441 __ call(code, RelocInfo::CODE_TARGET); | 450 __ call(code, RelocInfo::CODE_TARGET); |
442 } else { | 451 } else { |
443 Register reg = i.InputRegister(0); | 452 Register reg = i.InputRegister(0); |
444 __ add(reg, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 453 __ add(reg, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
445 __ call(reg); | 454 __ call(reg); |
446 } | 455 } |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1976 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1968 __ Nop(padding_size); | 1977 __ Nop(padding_size); |
1969 } | 1978 } |
1970 } | 1979 } |
1971 | 1980 |
1972 #undef __ | 1981 #undef __ |
1973 | 1982 |
1974 } // namespace compiler | 1983 } // namespace compiler |
1975 } // namespace internal | 1984 } // namespace internal |
1976 } // namespace v8 | 1985 } // namespace v8 |
OLD | NEW |