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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 // Assembles an instruction after register allocation, producing machine code. | 540 // Assembles an instruction after register allocation, producing machine code. |
541 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( | 541 CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
542 Instruction* instr) { | 542 Instruction* instr) { |
543 MipsOperandConverter i(this, instr); | 543 MipsOperandConverter i(this, instr); |
544 InstructionCode opcode = instr->opcode(); | 544 InstructionCode opcode = instr->opcode(); |
545 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); | 545 ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
546 switch (arch_opcode) { | 546 switch (arch_opcode) { |
547 case kArchCallCodeObject: { | 547 case kArchCallCodeObject: { |
548 EnsureSpaceForLazyDeopt(); | 548 EnsureSpaceForLazyDeopt(); |
549 if (instr->InputAt(0)->IsImmediate()) { | 549 if (instr->InputAt(0)->IsImmediate()) { |
550 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 550 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
551 RelocInfo::CODE_TARGET); | 551 if (callee_operand.type() == Constant::Type::kInt32) { |
| 552 __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
| 553 RelocInfo::WASM_DIRECT_CALL); |
| 554 } else { |
| 555 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
| 556 RelocInfo::CODE_TARGET); |
| 557 } |
552 } else { | 558 } else { |
553 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 559 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
554 __ Call(at); | 560 __ Call(at); |
555 } | 561 } |
556 RecordCallPosition(instr); | 562 RecordCallPosition(instr); |
557 frame_access_state()->ClearSPDelta(); | 563 frame_access_state()->ClearSPDelta(); |
558 break; | 564 break; |
559 } | 565 } |
560 case kArchTailCallCodeObjectFromJSFunction: | 566 case kArchTailCallCodeObjectFromJSFunction: |
561 case kArchTailCallCodeObject: { | 567 case kArchTailCallCodeObject: { |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1980 padding_size -= v8::internal::Assembler::kInstrSize; | 1986 padding_size -= v8::internal::Assembler::kInstrSize; |
1981 } | 1987 } |
1982 } | 1988 } |
1983 } | 1989 } |
1984 | 1990 |
1985 #undef __ | 1991 #undef __ |
1986 | 1992 |
1987 } // namespace compiler | 1993 } // namespace compiler |
1988 } // namespace internal | 1994 } // namespace internal |
1989 } // namespace v8 | 1995 } // namespace v8 |
OLD | NEW |