| 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 __ Ldr(temp, FieldMemOperand(func, JSFunction::kContextOffset)); | 157 __ Ldr(temp, FieldMemOperand(func, JSFunction::kContextOffset)); |
| 158 __ cmp(cp, temp); | 158 __ cmp(cp, temp); |
| 159 __ Assert(eq, kWrongFunctionContext); | 159 __ Assert(eq, kWrongFunctionContext); |
| 160 } | 160 } |
| 161 __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 161 __ Ldr(x10, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
| 162 __ Call(x10); | 162 __ Call(x10); |
| 163 AddSafepointAndDeopt(instr); | 163 AddSafepointAndDeopt(instr); |
| 164 break; | 164 break; |
| 165 } | 165 } |
| 166 case kArchJmp: | 166 case kArchJmp: |
| 167 __ B(code_->GetLabel(i.InputBlock(0))); | 167 __ B(code_->GetLabel(i.InputRpo(0))); |
| 168 break; | 168 break; |
| 169 case kArchNop: | 169 case kArchNop: |
| 170 // don't emit code for nops. | 170 // don't emit code for nops. |
| 171 break; | 171 break; |
| 172 case kArchRet: | 172 case kArchRet: |
| 173 AssembleReturn(); | 173 AssembleReturn(); |
| 174 break; | 174 break; |
| 175 case kArchStackPointer: | 175 case kArchStackPointer: |
| 176 __ mov(i.OutputRegister(), masm()->StackPointer()); | 176 __ mov(i.OutputRegister(), masm()->StackPointer()); |
| 177 break; | 177 break; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 | 520 |
| 521 // Assemble branches after this instruction. | 521 // Assemble branches after this instruction. |
| 522 void CodeGenerator::AssembleArchBranch(Instruction* instr, | 522 void CodeGenerator::AssembleArchBranch(Instruction* instr, |
| 523 FlagsCondition condition) { | 523 FlagsCondition condition) { |
| 524 Arm64OperandConverter i(this, instr); | 524 Arm64OperandConverter i(this, instr); |
| 525 Label done; | 525 Label done; |
| 526 | 526 |
| 527 // Emit a branch. The true and false targets are always the last two inputs | 527 // Emit a branch. The true and false targets are always the last two inputs |
| 528 // to the instruction. | 528 // to the instruction. |
| 529 BasicBlock* tblock = i.InputBlock(instr->InputCount() - 2); | 529 BasicBlock::RpoNumber tblock = |
| 530 BasicBlock* fblock = i.InputBlock(instr->InputCount() - 1); | 530 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); |
| 531 BasicBlock::RpoNumber fblock = |
| 532 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); |
| 531 bool fallthru = IsNextInAssemblyOrder(fblock); | 533 bool fallthru = IsNextInAssemblyOrder(fblock); |
| 532 Label* tlabel = code()->GetLabel(tblock); | 534 Label* tlabel = code()->GetLabel(tblock); |
| 533 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); | 535 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); |
| 534 switch (condition) { | 536 switch (condition) { |
| 535 case kUnorderedEqual: | 537 case kUnorderedEqual: |
| 536 __ B(vs, flabel); | 538 __ B(vs, flabel); |
| 537 // Fall through. | 539 // Fall through. |
| 538 case kEqual: | 540 case kEqual: |
| 539 __ B(eq, tlabel); | 541 __ B(eq, tlabel); |
| 540 break; | 542 break; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 } | 937 } |
| 936 } | 938 } |
| 937 MarkLazyDeoptSite(); | 939 MarkLazyDeoptSite(); |
| 938 } | 940 } |
| 939 | 941 |
| 940 #undef __ | 942 #undef __ |
| 941 | 943 |
| 942 } // namespace compiler | 944 } // namespace compiler |
| 943 } // namespace internal | 945 } // namespace internal |
| 944 } // namespace v8 | 946 } // namespace v8 |
| OLD | NEW |