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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 case kSSEUint32ToFloat64: | 477 case kSSEUint32ToFloat64: |
478 if (instr->InputAt(0)->IsRegister()) { | 478 if (instr->InputAt(0)->IsRegister()) { |
479 __ movl(kScratchRegister, i.InputRegister(0)); | 479 __ movl(kScratchRegister, i.InputRegister(0)); |
480 } else { | 480 } else { |
481 __ movl(kScratchRegister, i.InputOperand(0)); | 481 __ movl(kScratchRegister, i.InputOperand(0)); |
482 } | 482 } |
483 __ cvtqsi2sd(i.OutputDoubleRegister(), kScratchRegister); | 483 __ cvtqsi2sd(i.OutputDoubleRegister(), kScratchRegister); |
484 break; | 484 break; |
485 case kX64Movsxbl: | 485 case kX64Movsxbl: |
486 __ movsxbl(i.OutputRegister(), i.MemoryOperand()); | 486 __ movsxbl(i.OutputRegister(), i.MemoryOperand()); |
| 487 __ AssertZeroExtended(i.OutputRegister()); |
487 break; | 488 break; |
488 case kX64Movzxbl: | 489 case kX64Movzxbl: |
489 __ movzxbl(i.OutputRegister(), i.MemoryOperand()); | 490 __ movzxbl(i.OutputRegister(), i.MemoryOperand()); |
490 break; | 491 break; |
491 case kX64Movb: { | 492 case kX64Movb: { |
492 int index = 0; | 493 int index = 0; |
493 Operand operand = i.MemoryOperand(&index); | 494 Operand operand = i.MemoryOperand(&index); |
494 if (HasImmediateInput(instr, index)) { | 495 if (HasImmediateInput(instr, index)) { |
495 __ movb(operand, Immediate(i.InputInt8(index))); | 496 __ movb(operand, Immediate(i.InputInt8(index))); |
496 } else { | 497 } else { |
497 __ movb(operand, i.InputRegister(index)); | 498 __ movb(operand, i.InputRegister(index)); |
498 } | 499 } |
499 break; | 500 break; |
500 } | 501 } |
501 case kX64Movsxwl: | 502 case kX64Movsxwl: |
502 __ movsxwl(i.OutputRegister(), i.MemoryOperand()); | 503 if (instr->addressing_mode() != kMode_None) { |
| 504 __ movsxwl(i.OutputRegister(), i.MemoryOperand()); |
| 505 } else if (instr->InputAt(0)->IsRegister()) { |
| 506 __ movsxwl(i.OutputRegister(), i.InputRegister(0)); |
| 507 } else { |
| 508 __ movsxwl(i.OutputRegister(), i.InputOperand(0)); |
| 509 } |
| 510 __ AssertZeroExtended(i.OutputRegister()); |
503 break; | 511 break; |
504 case kX64Movzxwl: | 512 case kX64Movzxwl: |
505 __ movzxwl(i.OutputRegister(), i.MemoryOperand()); | 513 __ movzxwl(i.OutputRegister(), i.MemoryOperand()); |
| 514 __ AssertZeroExtended(i.OutputRegister()); |
506 break; | 515 break; |
507 case kX64Movw: { | 516 case kX64Movw: { |
508 int index = 0; | 517 int index = 0; |
509 Operand operand = i.MemoryOperand(&index); | 518 Operand operand = i.MemoryOperand(&index); |
510 if (HasImmediateInput(instr, index)) { | 519 if (HasImmediateInput(instr, index)) { |
511 __ movw(operand, Immediate(i.InputInt16(index))); | 520 __ movw(operand, Immediate(i.InputInt16(index))); |
512 } else { | 521 } else { |
513 __ movw(operand, i.InputRegister(index)); | 522 __ movw(operand, i.InputRegister(index)); |
514 } | 523 } |
515 break; | 524 break; |
516 } | 525 } |
517 case kX64Movl: | 526 case kX64Movl: |
518 if (instr->HasOutput()) { | 527 if (instr->HasOutput()) { |
519 if (instr->addressing_mode() == kMode_None) { | 528 if (instr->addressing_mode() == kMode_None) { |
520 if (instr->InputAt(0)->IsRegister()) { | 529 if (instr->InputAt(0)->IsRegister()) { |
521 __ movl(i.OutputRegister(), i.InputRegister(0)); | 530 __ movl(i.OutputRegister(), i.InputRegister(0)); |
522 } else { | 531 } else { |
523 __ movl(i.OutputRegister(), i.InputOperand(0)); | 532 __ movl(i.OutputRegister(), i.InputOperand(0)); |
524 } | 533 } |
525 } else { | 534 } else { |
526 __ movl(i.OutputRegister(), i.MemoryOperand()); | 535 __ movl(i.OutputRegister(), i.MemoryOperand()); |
527 } | 536 } |
| 537 __ AssertZeroExtended(i.OutputRegister()); |
528 } else { | 538 } else { |
529 int index = 0; | 539 int index = 0; |
530 Operand operand = i.MemoryOperand(&index); | 540 Operand operand = i.MemoryOperand(&index); |
531 if (HasImmediateInput(instr, index)) { | 541 if (HasImmediateInput(instr, index)) { |
532 __ movl(operand, i.InputImmediate(index)); | 542 __ movl(operand, i.InputImmediate(index)); |
533 } else { | 543 } else { |
534 __ movl(operand, i.InputRegister(index)); | 544 __ movl(operand, i.InputRegister(index)); |
535 } | 545 } |
536 } | 546 } |
537 break; | 547 break; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 if (instr->HasOutput()) { | 579 if (instr->HasOutput()) { |
570 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); | 580 __ movsd(i.OutputDoubleRegister(), i.MemoryOperand()); |
571 } else { | 581 } else { |
572 int index = 0; | 582 int index = 0; |
573 Operand operand = i.MemoryOperand(&index); | 583 Operand operand = i.MemoryOperand(&index); |
574 __ movsd(operand, i.InputDoubleRegister(index)); | 584 __ movsd(operand, i.InputDoubleRegister(index)); |
575 } | 585 } |
576 break; | 586 break; |
577 case kX64Lea32: | 587 case kX64Lea32: |
578 __ leal(i.OutputRegister(), i.MemoryOperand()); | 588 __ leal(i.OutputRegister(), i.MemoryOperand()); |
| 589 __ AssertZeroExtended(i.OutputRegister()); |
579 break; | 590 break; |
580 case kX64Lea: | 591 case kX64Lea: |
581 __ leaq(i.OutputRegister(), i.MemoryOperand()); | 592 __ leaq(i.OutputRegister(), i.MemoryOperand()); |
582 break; | 593 break; |
583 case kX64Push: | 594 case kX64Push: |
584 if (HasImmediateInput(instr, 0)) { | 595 if (HasImmediateInput(instr, 0)) { |
585 __ pushq(i.InputImmediate(0)); | 596 __ pushq(i.InputImmediate(0)); |
586 } else { | 597 } else { |
587 if (instr->InputAt(0)->IsRegister()) { | 598 if (instr->InputAt(0)->IsRegister()) { |
588 __ pushq(i.InputRegister(0)); | 599 __ pushq(i.InputRegister(0)); |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 } | 1025 } |
1015 } | 1026 } |
1016 MarkLazyDeoptSite(); | 1027 MarkLazyDeoptSite(); |
1017 } | 1028 } |
1018 | 1029 |
1019 #undef __ | 1030 #undef __ |
1020 | 1031 |
1021 } // namespace internal | 1032 } // namespace internal |
1022 } // namespace compiler | 1033 } // namespace compiler |
1023 } // namespace v8 | 1034 } // namespace v8 |
OLD | NEW |