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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 kArchCallCodeObject: { | 558 case kArchCallCodeObject: { |
559 EnsureSpaceForLazyDeopt(); | 559 EnsureSpaceForLazyDeopt(); |
560 if (instr->InputAt(0)->IsImmediate()) { | 560 if (instr->InputAt(0)->IsImmediate()) { |
561 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 561 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
562 RelocInfo::CODE_TARGET); | 562 if (callee_operand.type() == Constant::Type::kInt32) { |
| 563 __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
| 564 RelocInfo::WASM_DIRECT_CALL); |
| 565 } else { |
| 566 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
| 567 RelocInfo::CODE_TARGET); |
| 568 } |
563 } else { | 569 } else { |
564 __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 570 __ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
565 __ Call(at); | 571 __ Call(at); |
566 } | 572 } |
567 RecordCallPosition(instr); | 573 RecordCallPosition(instr); |
568 frame_access_state()->ClearSPDelta(); | 574 frame_access_state()->ClearSPDelta(); |
569 break; | 575 break; |
570 } | 576 } |
571 case kArchTailCallCodeObjectFromJSFunction: | 577 case kArchTailCallCodeObjectFromJSFunction: |
572 case kArchTailCallCodeObject: { | 578 case kArchTailCallCodeObject: { |
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2250 padding_size -= v8::internal::Assembler::kInstrSize; | 2256 padding_size -= v8::internal::Assembler::kInstrSize; |
2251 } | 2257 } |
2252 } | 2258 } |
2253 } | 2259 } |
2254 | 2260 |
2255 #undef __ | 2261 #undef __ |
2256 | 2262 |
2257 } // namespace compiler | 2263 } // namespace compiler |
2258 } // namespace internal | 2264 } // namespace internal |
2259 } // namespace v8 | 2265 } // namespace v8 |
OLD | NEW |