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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (input.type == kRegister) { | 381 if (input.type == kRegister) { |
382 __ pushq(input.reg); | 382 __ pushq(input.reg); |
383 } else { | 383 } else { |
384 __ pushq(input.operand); | 384 __ pushq(input.operand); |
385 } | 385 } |
386 break; | 386 break; |
387 } | 387 } |
388 case kX64PushI: | 388 case kX64PushI: |
389 __ pushq(i.InputImmediate(0)); | 389 __ pushq(i.InputImmediate(0)); |
390 break; | 390 break; |
| 391 case kX64Movl: { |
| 392 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
| 393 if (input.type == kRegister) { |
| 394 __ movl(i.OutputRegister(), input.reg); |
| 395 } else { |
| 396 __ movl(i.OutputRegister(), input.operand); |
| 397 } |
| 398 break; |
| 399 } |
| 400 case kX64Movsxlq: { |
| 401 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
| 402 if (input.type == kRegister) { |
| 403 __ movsxlq(i.OutputRegister(), input.reg); |
| 404 } else { |
| 405 __ movsxlq(i.OutputRegister(), input.operand); |
| 406 } |
| 407 break; |
| 408 } |
391 case kX64CallCodeObject: { | 409 case kX64CallCodeObject: { |
392 if (HasImmediateInput(instr, 0)) { | 410 if (HasImmediateInput(instr, 0)) { |
393 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); | 411 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); |
394 __ Call(code, RelocInfo::CODE_TARGET); | 412 __ Call(code, RelocInfo::CODE_TARGET); |
395 } else { | 413 } else { |
396 Register reg = i.InputRegister(0); | 414 Register reg = i.InputRegister(0); |
397 int entry = Code::kHeaderSize - kHeapObjectTag; | 415 int entry = Code::kHeaderSize - kHeapObjectTag; |
398 __ Call(Operand(reg, entry)); | 416 __ Call(Operand(reg, entry)); |
399 } | 417 } |
400 RecordSafepoint(instr->pointer_map(), Safepoint::kSimple, 0, | 418 RecordSafepoint(instr->pointer_map(), Safepoint::kSimple, 0, |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 __ popfq(); | 495 __ popfq(); |
478 } | 496 } |
479 __ j(parity_even, &mod_loop); | 497 __ j(parity_even, &mod_loop); |
480 // Move output to stack and clean up. | 498 // Move output to stack and clean up. |
481 __ fstp(1); | 499 __ fstp(1); |
482 __ fstp_d(Operand(rsp, 0)); | 500 __ fstp_d(Operand(rsp, 0)); |
483 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); | 501 __ movsd(i.OutputDoubleRegister(), Operand(rsp, 0)); |
484 __ addq(rsp, Immediate(kDoubleSize)); | 502 __ addq(rsp, Immediate(kDoubleSize)); |
485 break; | 503 break; |
486 } | 504 } |
487 case kX64Int32ToInt64: | |
488 __ movzxwq(i.OutputRegister(), i.InputRegister(0)); | |
489 break; | |
490 case kX64Int64ToInt32: | |
491 __ Move(i.OutputRegister(), i.InputRegister(0)); | |
492 break; | |
493 case kSSEFloat64ToInt32: { | 505 case kSSEFloat64ToInt32: { |
494 RegisterOrOperand input = i.InputRegisterOrOperand(0); | 506 RegisterOrOperand input = i.InputRegisterOrOperand(0); |
495 if (input.type == kDoubleRegister) { | 507 if (input.type == kDoubleRegister) { |
496 __ cvttsd2si(i.OutputRegister(), input.double_reg); | 508 __ cvttsd2si(i.OutputRegister(), input.double_reg); |
497 } else { | 509 } else { |
498 __ cvttsd2si(i.OutputRegister(), input.operand); | 510 __ cvttsd2si(i.OutputRegister(), input.operand); |
499 } | 511 } |
500 break; | 512 break; |
501 } | 513 } |
502 case kSSEFloat64ToUint32: { | 514 case kSSEFloat64ToUint32: { |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 } | 996 } |
985 | 997 |
986 | 998 |
987 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 999 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
988 | 1000 |
989 #undef __ | 1001 #undef __ |
990 | 1002 |
991 } // namespace internal | 1003 } // namespace internal |
992 } // namespace compiler | 1004 } // namespace compiler |
993 } // namespace v8 | 1005 } // namespace v8 |
OLD | NEW |