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(), GetStackSlotCount()); | 409 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); |
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, StackSlotOffset(op->index())); | 510 return Operand(rbp, FrameSlotToFPOffset(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 } | |
581 if (is_tagged) { | 578 if (is_tagged) { |
582 translation->StoreStackSlot(index); | 579 translation->StoreStackSlot(index); |
583 } else if (is_uint32) { | 580 } else if (is_uint32) { |
584 translation->StoreUint32StackSlot(index); | 581 translation->StoreUint32StackSlot(index); |
585 } else { | 582 } else { |
586 translation->StoreInt32StackSlot(index); | 583 translation->StoreInt32StackSlot(index); |
587 } | 584 } |
588 } else if (op->IsDoubleStackSlot()) { | 585 } else if (op->IsDoubleStackSlot()) { |
589 int index = op->index(); | 586 int index = op->index(); |
590 if (index >= 0) { | |
591 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; | |
592 } | |
593 translation->StoreDoubleStackSlot(index); | 587 translation->StoreDoubleStackSlot(index); |
594 } else if (op->IsRegister()) { | 588 } else if (op->IsRegister()) { |
595 Register reg = ToRegister(op); | 589 Register reg = ToRegister(op); |
596 if (is_tagged) { | 590 if (is_tagged) { |
597 translation->StoreRegister(reg); | 591 translation->StoreRegister(reg); |
598 } else if (is_uint32) { | 592 } else if (is_uint32) { |
599 translation->StoreUint32Register(reg); | 593 translation->StoreUint32Register(reg); |
600 } else { | 594 } else { |
601 translation->StoreInt32Register(reg); | 595 translation->StoreInt32Register(reg); |
602 } | 596 } |
(...skipping 5013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5616 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5610 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5617 } | 5611 } |
5618 | 5612 |
5619 | 5613 |
5620 #undef __ | 5614 #undef __ |
5621 | 5615 |
5622 } // namespace internal | 5616 } // namespace internal |
5623 } // namespace v8 | 5617 } // namespace v8 |
5624 | 5618 |
5625 #endif // V8_TARGET_ARCH_X64 | 5619 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |