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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 | 399 |
400 // Deferred code is the last part of the instruction sequence. Mark | 400 // Deferred code is the last part of the instruction sequence. Mark |
401 // the generated code as done unless we bailed out. | 401 // the generated code as done unless we bailed out. |
402 if (!is_aborted()) status_ = DONE; | 402 if (!is_aborted()) status_ = DONE; |
403 return !is_aborted(); | 403 return !is_aborted(); |
404 } | 404 } |
405 | 405 |
406 | 406 |
407 bool LCodeGen::GenerateSafepointTable() { | 407 bool LCodeGen::GenerateSafepointTable() { |
408 DCHECK(is_done()); | 408 DCHECK(is_done()); |
409 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); | 409 safepoints_.Emit(masm(), GetStackSlotCount()); |
410 return !is_aborted(); | 410 return !is_aborted(); |
411 } | 411 } |
412 | 412 |
413 | 413 |
414 Register LCodeGen::ToRegister(int index) const { | 414 Register LCodeGen::ToRegister(int index) const { |
415 return Register::from_code(index); | 415 return Register::from_code(index); |
416 } | 416 } |
417 | 417 |
418 | 418 |
419 XMMRegister LCodeGen::ToDoubleRegister(int index) const { | 419 XMMRegister LCodeGen::ToDoubleRegister(int index) const { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 DCHECK(index < 0); | 500 DCHECK(index < 0); |
501 return -(index + 1) * kPointerSize + kPCOnStackSize; | 501 return -(index + 1) * kPointerSize + kPCOnStackSize; |
502 } | 502 } |
503 | 503 |
504 | 504 |
505 Operand LCodeGen::ToOperand(LOperand* op) const { | 505 Operand LCodeGen::ToOperand(LOperand* op) const { |
506 // Does not handle registers. In X64 assembler, plain registers are not | 506 // Does not handle registers. In X64 assembler, plain registers are not |
507 // representable as an Operand. | 507 // representable as an Operand. |
508 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 508 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
509 if (NeedsEagerFrame()) { | 509 if (NeedsEagerFrame()) { |
510 return Operand(rbp, FrameSlotToFPOffset(op->index())); | 510 return Operand(rbp, StackSlotOffset(op->index())); |
511 } else { | 511 } else { |
512 // Retrieve parameter without eager stack-frame relative to the | 512 // Retrieve parameter without eager stack-frame relative to the |
513 // stack-pointer. | 513 // stack-pointer. |
514 return Operand(rsp, ArgumentsOffsetWithoutFrame(op->index())); | 514 return Operand(rsp, ArgumentsOffsetWithoutFrame(op->index())); |
515 } | 515 } |
516 } | 516 } |
517 | 517 |
518 | 518 |
519 void LCodeGen::WriteTranslation(LEnvironment* environment, | 519 void LCodeGen::WriteTranslation(LEnvironment* environment, |
520 Translation* translation) { | 520 Translation* translation) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 environment->HasTaggedValueAt(env_offset + i), | 568 environment->HasTaggedValueAt(env_offset + i), |
569 environment->HasUint32ValueAt(env_offset + i), | 569 environment->HasUint32ValueAt(env_offset + i), |
570 object_index_pointer, | 570 object_index_pointer, |
571 dematerialized_index_pointer); | 571 dematerialized_index_pointer); |
572 } | 572 } |
573 return; | 573 return; |
574 } | 574 } |
575 | 575 |
576 if (op->IsStackSlot()) { | 576 if (op->IsStackSlot()) { |
577 int index = op->index(); | 577 int index = op->index(); |
| 578 if (index >= 0) { |
| 579 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 580 } |
578 if (is_tagged) { | 581 if (is_tagged) { |
579 translation->StoreStackSlot(index); | 582 translation->StoreStackSlot(index); |
580 } else if (is_uint32) { | 583 } else if (is_uint32) { |
581 translation->StoreUint32StackSlot(index); | 584 translation->StoreUint32StackSlot(index); |
582 } else { | 585 } else { |
583 translation->StoreInt32StackSlot(index); | 586 translation->StoreInt32StackSlot(index); |
584 } | 587 } |
585 } else if (op->IsDoubleStackSlot()) { | 588 } else if (op->IsDoubleStackSlot()) { |
586 int index = op->index(); | 589 int index = op->index(); |
| 590 if (index >= 0) { |
| 591 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 592 } |
587 translation->StoreDoubleStackSlot(index); | 593 translation->StoreDoubleStackSlot(index); |
588 } else if (op->IsRegister()) { | 594 } else if (op->IsRegister()) { |
589 Register reg = ToRegister(op); | 595 Register reg = ToRegister(op); |
590 if (is_tagged) { | 596 if (is_tagged) { |
591 translation->StoreRegister(reg); | 597 translation->StoreRegister(reg); |
592 } else if (is_uint32) { | 598 } else if (is_uint32) { |
593 translation->StoreUint32Register(reg); | 599 translation->StoreUint32Register(reg); |
594 } else { | 600 } else { |
595 translation->StoreInt32Register(reg); | 601 translation->StoreInt32Register(reg); |
596 } | 602 } |
(...skipping 5011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5608 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5614 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5609 } | 5615 } |
5610 | 5616 |
5611 | 5617 |
5612 #undef __ | 5618 #undef __ |
5613 | 5619 |
5614 } // namespace internal | 5620 } // namespace internal |
5615 } // namespace v8 | 5621 } // namespace v8 |
5616 | 5622 |
5617 #endif // V8_TARGET_ARCH_X64 | 5623 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |