| 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.InputRpo(0))); | 198 __ jmp(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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 IA32OperandConverter i(this, instr); | 491 IA32OperandConverter i(this, instr); |
| 492 Label done; | 492 Label done; |
| 493 | 493 |
| 494 // Emit a branch. The true and false targets are always the last two inputs | 494 // Emit a branch. The true and false targets are always the last two inputs |
| 495 // to the instruction. | 495 // to the instruction. |
| 496 BasicBlock::RpoNumber tblock = | 496 BasicBlock::RpoNumber tblock = |
| 497 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); | 497 i.InputRpo(static_cast<int>(instr->InputCount()) - 2); |
| 498 BasicBlock::RpoNumber fblock = | 498 BasicBlock::RpoNumber fblock = |
| 499 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); | 499 i.InputRpo(static_cast<int>(instr->InputCount()) - 1); |
| 500 bool fallthru = IsNextInAssemblyOrder(fblock); | 500 bool fallthru = IsNextInAssemblyOrder(fblock); |
| 501 Label* tlabel = code()->GetLabel(tblock); | 501 Label* tlabel = GetLabel(tblock); |
| 502 Label* flabel = fallthru ? &done : code()->GetLabel(fblock); | 502 Label* flabel = fallthru ? &done : GetLabel(fblock); |
| 503 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; | 503 Label::Distance flabel_distance = fallthru ? Label::kNear : Label::kFar; |
| 504 switch (condition) { | 504 switch (condition) { |
| 505 case kUnorderedEqual: | 505 case kUnorderedEqual: |
| 506 __ j(parity_even, flabel, flabel_distance); | 506 __ j(parity_even, flabel, flabel_distance); |
| 507 // Fall through. | 507 // Fall through. |
| 508 case kEqual: | 508 case kEqual: |
| 509 __ j(equal, tlabel); | 509 __ j(equal, tlabel); |
| 510 break; | 510 break; |
| 511 case kUnorderedNotEqual: | 511 case kUnorderedNotEqual: |
| 512 __ j(parity_even, tlabel); | 512 __ j(parity_even, tlabel); |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 } | 1054 } |
| 1055 } | 1055 } |
| 1056 MarkLazyDeoptSite(); | 1056 MarkLazyDeoptSite(); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 #undef __ | 1059 #undef __ |
| 1060 | 1060 |
| 1061 } // namespace compiler | 1061 } // namespace compiler |
| 1062 } // namespace internal | 1062 } // namespace internal |
| 1063 } // namespace v8 | 1063 } // namespace v8 |
| OLD | NEW |