| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 __ bind(&done); | 537 __ bind(&done); |
| 538 } | 538 } |
| 539 | 539 |
| 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 kArchCallWasmFunction: { |
| 548 DCHECK(instr->InputAt(0)->IsImmediate()); |
| 549 Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
| 550 DCHECK(callee_operand.type() == Constant::Type::kInt32); |
| 551 __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
| 552 callee_operand.rmode()); |
| 553 RecordCallPosition(instr); |
| 554 frame_access_state()->ClearSPDelta(); |
| 555 break; |
| 556 } |
| 547 case kArchCallCodeObject: { | 557 case kArchCallCodeObject: { |
| 548 EnsureSpaceForLazyDeopt(); | 558 EnsureSpaceForLazyDeopt(); |
| 549 if (instr->InputAt(0)->IsImmediate()) { | 559 if (instr->InputAt(0)->IsImmediate()) { |
| 550 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), | 560 __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
| 551 RelocInfo::CODE_TARGET); | 561 RelocInfo::CODE_TARGET); |
| 552 } else { | 562 } else { |
| 553 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); | 563 __ addiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
| 554 __ Call(at); | 564 __ Call(at); |
| 555 } | 565 } |
| 556 RecordCallPosition(instr); | 566 RecordCallPosition(instr); |
| (...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 padding_size -= v8::internal::Assembler::kInstrSize; | 2008 padding_size -= v8::internal::Assembler::kInstrSize; |
| 1999 } | 2009 } |
| 2000 } | 2010 } |
| 2001 } | 2011 } |
| 2002 | 2012 |
| 2003 #undef __ | 2013 #undef __ |
| 2004 | 2014 |
| 2005 } // namespace compiler | 2015 } // namespace compiler |
| 2006 } // namespace internal | 2016 } // namespace internal |
| 2007 } // namespace v8 | 2017 } // namespace v8 |
| OLD | NEW |