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/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 case kArchRet: | 415 case kArchRet: |
416 AssembleReturn(); | 416 AssembleReturn(); |
417 break; | 417 break; |
418 case kArchFramePointer: | 418 case kArchFramePointer: |
419 __ mov(i.OutputRegister(), ebp); | 419 __ mov(i.OutputRegister(), ebp); |
420 break; | 420 break; |
421 case kArchStackPointer: | 421 case kArchStackPointer: |
422 __ mov(i.OutputRegister(), esp); | 422 __ mov(i.OutputRegister(), esp); |
423 break; | 423 break; |
424 case kArchTruncateDoubleToI: { | 424 case kArchTruncateDoubleToI: { |
425 auto input = i.InputDoubleRegister(0); | 425 if (!instr->InputAt(0)->IsDoubleRegister()) { |
426 USE(input); | 426 __ fld_d(i.InputOperand(0)); |
427 DCHECK(input.code() == 0); | 427 } |
428 auto result_reg = i.OutputRegister(); | 428 __ TruncateX87TOSToI(i.OutputRegister()); |
429 __ TruncateX87TOSToI(result_reg); | 429 if (!instr->InputAt(0)->IsDoubleRegister()) { |
| 430 __ fstp(0); |
| 431 } |
430 break; | 432 break; |
431 } | 433 } |
432 case kX87Add: | 434 case kX87Add: |
433 if (HasImmediateInput(instr, 1)) { | 435 if (HasImmediateInput(instr, 1)) { |
434 __ add(i.InputOperand(0), i.InputImmediate(1)); | 436 __ add(i.InputOperand(0), i.InputImmediate(1)); |
435 } else { | 437 } else { |
436 __ add(i.InputRegister(0), i.InputOperand(1)); | 438 __ add(i.InputRegister(0), i.InputOperand(1)); |
437 } | 439 } |
438 break; | 440 break; |
439 case kX87And: | 441 case kX87And: |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 __ Nop(padding_size); | 1843 __ Nop(padding_size); |
1842 } | 1844 } |
1843 } | 1845 } |
1844 } | 1846 } |
1845 | 1847 |
1846 #undef __ | 1848 #undef __ |
1847 | 1849 |
1848 } // namespace compiler | 1850 } // namespace compiler |
1849 } // namespace internal | 1851 } // namespace internal |
1850 } // namespace v8 | 1852 } // namespace v8 |
OLD | NEW |