| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (FLAG_debug_code) { | 188 if (FLAG_debug_code) { |
| 189 // Check the function's context matches the context argument. | 189 // Check the function's context matches the context argument. |
| 190 __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); | 190 __ cmp(esi, FieldOperand(func, JSFunction::kContextOffset)); |
| 191 __ Assert(equal, kWrongFunctionContext); | 191 __ Assert(equal, kWrongFunctionContext); |
| 192 } | 192 } |
| 193 __ call(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 193 __ call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
| 194 AddSafepointAndDeopt(instr); | 194 AddSafepointAndDeopt(instr); |
| 195 break; | 195 break; |
| 196 } | 196 } |
| 197 case kArchJmp: | 197 case kArchJmp: |
| 198 __ jmp(code()->GetLabel(i.InputBlock(0))); | 198 __ jmp(code()->GetLabel(i.InputRpo(0))); |
| 199 break; | 199 break; |
| 200 case kArchNop: | 200 case kArchNop: |
| 201 // don't emit code for nops. | 201 // don't emit code for nops. |
| 202 break; | 202 break; |
| 203 case kArchRet: | 203 case kArchRet: |
| 204 AssembleReturn(); | 204 AssembleReturn(); |
| 205 break; | 205 break; |
| 206 case kArchStackPointer: | 206 case kArchStackPointer: |
| 207 __ mov(i.OutputRegister(), esp); | 207 __ mov(i.OutputRegister(), esp); |
| 208 break; | 208 break; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 | 463 |
| 464 | 464 |
| 465 // Assembles branches after an instruction. | 465 // Assembles branches after an instruction. |
| 466 void CodeGenerator::AssembleArchBranch(Instruction* instr, | 466 void CodeGenerator::AssembleArchBranch(Instruction* instr, |
| 467 FlagsCondition condition) { | 467 FlagsCondition condition) { |
| 468 IA32OperandConverter i(this, instr); | 468 IA32OperandConverter i(this, instr); |
| 469 Label done; | 469 Label done; |
| 470 | 470 |
| 471 // Emit a branch. The true and false targets are always the last two inputs | 471 // Emit a branch. The true and false targets are always the last two inputs |
| 472 // to the instruction. | 472 // to the instruction. |
| 473 BasicBlock* tblock = i.InputBlock(instr->InputCount() - 2); | 473 BasicBlock::RpoNumber tblock = |
| 474 BasicBlock* fblock = i.InputBlock(instr->InputCount() - 1); | 474 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); |
| 475 BasicBlock::RpoNumber fblock = |
| 476 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); |
| 475 bool fallthru = IsNextInAssemblyOrder(fblock); | 477 bool fallthru = IsNextInAssemblyOrder(fblock); |
| 476 Label* tlabel = code()->GetLabel(tblock); | 478 Label* tlabel = code()->GetLabel(tblock); |
| 477 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); | 479 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); |
| 478 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; | 480 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; |
| 479 switch (condition) { | 481 switch (condition) { |
| 480 case kUnorderedEqual: | 482 case kUnorderedEqual: |
| 481 __ j(parity_even, flabel, flabel_distance); | 483 __ j(parity_even, flabel, flabel_distance); |
| 482 // Fall through. | 484 // Fall through. |
| 483 case kEqual: | 485 case kEqual: |
| 484 __ j(equal, tlabel); | 486 __ j(equal, tlabel); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1031 } |
| 1030 } | 1032 } |
| 1031 MarkLazyDeoptSite(); | 1033 MarkLazyDeoptSite(); |
| 1032 } | 1034 } |
| 1033 | 1035 |
| 1034 #undef __ | 1036 #undef __ |
| 1035 | 1037 |
| 1036 } // namespace compiler | 1038 } // namespace compiler |
| 1037 } // namespace internal | 1039 } // namespace internal |
| 1038 } // namespace v8 | 1040 } // namespace v8 |
| OLD | NEW |