OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 // The deoptimization jump table is the last part of the instruction | 349 // The deoptimization jump table is the last part of the instruction |
350 // sequence. Mark the generated code as done unless we bailed out. | 350 // sequence. Mark the generated code as done unless we bailed out. |
351 if (!is_aborted()) status_ = DONE; | 351 if (!is_aborted()) status_ = DONE; |
352 return !is_aborted(); | 352 return !is_aborted(); |
353 } | 353 } |
354 | 354 |
355 | 355 |
356 bool LCodeGen::GenerateSafepointTable() { | 356 bool LCodeGen::GenerateSafepointTable() { |
357 DCHECK(is_done()); | 357 DCHECK(is_done()); |
358 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); | 358 safepoints_.Emit(masm(), GetStackSlotCount()); |
359 return !is_aborted(); | 359 return !is_aborted(); |
360 } | 360 } |
361 | 361 |
362 | 362 |
363 Register LCodeGen::ToRegister(int index) const { | 363 Register LCodeGen::ToRegister(int index) const { |
364 return Register::from_code(index); | 364 return Register::from_code(index); |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 DoubleRegister LCodeGen::ToDoubleRegister(int index) const { | 368 DoubleRegister LCodeGen::ToDoubleRegister(int index) const { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 DCHECK(index < 0); | 523 DCHECK(index < 0); |
524 return -(index + 1) * kPointerSize; | 524 return -(index + 1) * kPointerSize; |
525 } | 525 } |
526 | 526 |
527 | 527 |
528 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { | 528 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { |
529 DCHECK(!op->IsRegister()); | 529 DCHECK(!op->IsRegister()); |
530 DCHECK(!op->IsDoubleRegister()); | 530 DCHECK(!op->IsDoubleRegister()); |
531 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 531 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
532 if (NeedsEagerFrame()) { | 532 if (NeedsEagerFrame()) { |
533 return MemOperand(fp, FrameSlotToFPOffset(op->index())); | 533 return MemOperand(fp, StackSlotOffset(op->index())); |
534 } else { | 534 } else { |
535 // Retrieve parameter without eager stack-frame relative to the | 535 // Retrieve parameter without eager stack-frame relative to the |
536 // stack-pointer. | 536 // stack-pointer. |
537 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); | 537 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); |
538 } | 538 } |
539 } | 539 } |
540 | 540 |
541 | 541 |
542 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { | 542 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { |
543 DCHECK(op->IsDoubleStackSlot()); | 543 DCHECK(op->IsDoubleStackSlot()); |
544 if (NeedsEagerFrame()) { | 544 if (NeedsEagerFrame()) { |
545 // return MemOperand(fp, FrameSlotToFPOffset(op->index()) + kPointerSize); | 545 // return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize); |
546 return MemOperand(fp, FrameSlotToFPOffset(op->index()) + kIntSize); | 546 return MemOperand(fp, StackSlotOffset(op->index()) + kIntSize); |
547 } else { | 547 } else { |
548 // Retrieve parameter without eager stack-frame relative to the | 548 // Retrieve parameter without eager stack-frame relative to the |
549 // stack-pointer. | 549 // stack-pointer. |
550 // return MemOperand( | 550 // return MemOperand( |
551 // sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); | 551 // sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); |
552 return MemOperand( | 552 return MemOperand( |
553 sp, ArgumentsOffsetWithoutFrame(op->index()) + kIntSize); | 553 sp, ArgumentsOffsetWithoutFrame(op->index()) + kIntSize); |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 environment->HasTaggedValueAt(env_offset + i), | 607 environment->HasTaggedValueAt(env_offset + i), |
608 environment->HasUint32ValueAt(env_offset + i), | 608 environment->HasUint32ValueAt(env_offset + i), |
609 object_index_pointer, | 609 object_index_pointer, |
610 dematerialized_index_pointer); | 610 dematerialized_index_pointer); |
611 } | 611 } |
612 return; | 612 return; |
613 } | 613 } |
614 | 614 |
615 if (op->IsStackSlot()) { | 615 if (op->IsStackSlot()) { |
616 int index = op->index(); | 616 int index = op->index(); |
| 617 if (index >= 0) { |
| 618 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 619 } |
617 if (is_tagged) { | 620 if (is_tagged) { |
618 translation->StoreStackSlot(index); | 621 translation->StoreStackSlot(index); |
619 } else if (is_uint32) { | 622 } else if (is_uint32) { |
620 translation->StoreUint32StackSlot(index); | 623 translation->StoreUint32StackSlot(index); |
621 } else { | 624 } else { |
622 translation->StoreInt32StackSlot(index); | 625 translation->StoreInt32StackSlot(index); |
623 } | 626 } |
624 } else if (op->IsDoubleStackSlot()) { | 627 } else if (op->IsDoubleStackSlot()) { |
625 int index = op->index(); | 628 int index = op->index(); |
| 629 if (index >= 0) { |
| 630 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 631 } |
626 translation->StoreDoubleStackSlot(index); | 632 translation->StoreDoubleStackSlot(index); |
627 } else if (op->IsRegister()) { | 633 } else if (op->IsRegister()) { |
628 Register reg = ToRegister(op); | 634 Register reg = ToRegister(op); |
629 if (is_tagged) { | 635 if (is_tagged) { |
630 translation->StoreRegister(reg); | 636 translation->StoreRegister(reg); |
631 } else if (is_uint32) { | 637 } else if (is_uint32) { |
632 translation->StoreUint32Register(reg); | 638 translation->StoreUint32Register(reg); |
633 } else { | 639 } else { |
634 translation->StoreInt32Register(reg); | 640 translation->StoreInt32Register(reg); |
635 } | 641 } |
(...skipping 5135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 __ Push(at, ToRegister(instr->function())); | 5777 __ Push(at, ToRegister(instr->function())); |
5772 CallRuntime(Runtime::kPushBlockContext, instr); | 5778 CallRuntime(Runtime::kPushBlockContext, instr); |
5773 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5779 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5774 } | 5780 } |
5775 | 5781 |
5776 | 5782 |
5777 #undef __ | 5783 #undef __ |
5778 | 5784 |
5779 } // namespace internal | 5785 } // namespace internal |
5780 } // namespace v8 | 5786 } // namespace v8 |
OLD | NEW |