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/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/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 215 matching lines...) Loading... |
226 if (FLAG_debug_code) { | 226 if (FLAG_debug_code) { |
227 // Check the function's context matches the context argument. | 227 // Check the function's context matches the context argument. |
228 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); | 228 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); |
229 __ Assert(equal, kWrongFunctionContext); | 229 __ Assert(equal, kWrongFunctionContext); |
230 } | 230 } |
231 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 231 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
232 AddSafepointAndDeopt(instr); | 232 AddSafepointAndDeopt(instr); |
233 break; | 233 break; |
234 } | 234 } |
235 case kArchJmp: | 235 case kArchJmp: |
236 __ jmp(code_->GetLabel(i.InputBlock(0))); | 236 __ jmp(code_->GetLabel(i.InputRpo(0))); |
237 break; | 237 break; |
238 case kArchNop: | 238 case kArchNop: |
239 // don't emit code for nops. | 239 // don't emit code for nops. |
240 break; | 240 break; |
241 case kArchRet: | 241 case kArchRet: |
242 AssembleReturn(); | 242 AssembleReturn(); |
243 break; | 243 break; |
244 case kArchStackPointer: | 244 case kArchStackPointer: |
245 __ movq(i.OutputRegister(), rsp); | 245 __ movq(i.OutputRegister(), rsp); |
246 break; | 246 break; |
(...skipping 329 matching lines...) Loading... |
576 | 576 |
577 | 577 |
578 // Assembles branches after this instruction. | 578 // Assembles branches after this instruction. |
579 void CodeGenerator::AssembleArchBranch(Instruction* instr, | 579 void CodeGenerator::AssembleArchBranch(Instruction* instr, |
580 FlagsCondition condition) { | 580 FlagsCondition condition) { |
581 X64OperandConverter i(this, instr); | 581 X64OperandConverter i(this, instr); |
582 Label done; | 582 Label done; |
583 | 583 |
584 // Emit a branch. The true and false targets are always the last two inputs | 584 // Emit a branch. The true and false targets are always the last two inputs |
585 // to the instruction. | 585 // to the instruction. |
586 BasicBlock* tblock = i.InputBlock(static_cast<int>(instr->InputCount()) - 2); | 586 BasicBlock::RpoNumber tblock = |
587 BasicBlock* fblock = i.InputBlock(static_cast<int>(instr->InputCount()) - 1); | 587 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); |
| 588 BasicBlock::RpoNumber fblock = |
| 589 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); |
588 bool fallthru = IsNextInAssemblyOrder(fblock); | 590 bool fallthru = IsNextInAssemblyOrder(fblock); |
589 Label* tlabel = code()->GetLabel(tblock); | 591 Label* tlabel = code()->GetLabel(tblock); |
590 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); | 592 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); |
591 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; | 593 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; |
592 switch (condition) { | 594 switch (condition) { |
593 case kUnorderedEqual: | 595 case kUnorderedEqual: |
594 __ j(parity_even, flabel, flabel_distance); | 596 __ j(parity_even, flabel, flabel_distance); |
595 // Fall through. | 597 // Fall through. |
596 case kEqual: | 598 case kEqual: |
597 __ j(equal, tlabel); | 599 __ j(equal, tlabel); |
(...skipping 399 matching lines...) Loading... |
997 } | 999 } |
998 } | 1000 } |
999 MarkLazyDeoptSite(); | 1001 MarkLazyDeoptSite(); |
1000 } | 1002 } |
1001 | 1003 |
1002 #undef __ | 1004 #undef __ |
1003 | 1005 |
1004 } // namespace internal | 1006 } // namespace internal |
1005 } // namespace compiler | 1007 } // namespace compiler |
1006 } // namespace v8 | 1008 } // namespace v8 |
OLD | NEW |