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(), GetStackSlotCount()); | 358 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); |
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, StackSlotOffset(op->index())); | 533 return MemOperand(fp, FrameSlotToFPOffset(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, StackSlotOffset(op->index()) + kPointerSize); | 545 // return MemOperand(fp, FrameSlotToFPOffset(op->index()) + kPointerSize); |
546 return MemOperand(fp, StackSlotOffset(op->index()) + kIntSize); | 546 return MemOperand(fp, FrameSlotToFPOffset(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 } | |
620 if (is_tagged) { | 617 if (is_tagged) { |
621 translation->StoreStackSlot(index); | 618 translation->StoreStackSlot(index); |
622 } else if (is_uint32) { | 619 } else if (is_uint32) { |
623 translation->StoreUint32StackSlot(index); | 620 translation->StoreUint32StackSlot(index); |
624 } else { | 621 } else { |
625 translation->StoreInt32StackSlot(index); | 622 translation->StoreInt32StackSlot(index); |
626 } | 623 } |
627 } else if (op->IsDoubleStackSlot()) { | 624 } else if (op->IsDoubleStackSlot()) { |
628 int index = op->index(); | 625 int index = op->index(); |
629 if (index >= 0) { | |
630 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; | |
631 } | |
632 translation->StoreDoubleStackSlot(index); | 626 translation->StoreDoubleStackSlot(index); |
633 } else if (op->IsRegister()) { | 627 } else if (op->IsRegister()) { |
634 Register reg = ToRegister(op); | 628 Register reg = ToRegister(op); |
635 if (is_tagged) { | 629 if (is_tagged) { |
636 translation->StoreRegister(reg); | 630 translation->StoreRegister(reg); |
637 } else if (is_uint32) { | 631 } else if (is_uint32) { |
638 translation->StoreUint32Register(reg); | 632 translation->StoreUint32Register(reg); |
639 } else { | 633 } else { |
640 translation->StoreInt32Register(reg); | 634 translation->StoreInt32Register(reg); |
641 } | 635 } |
(...skipping 5131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5773 __ Push(at, ToRegister(instr->function())); | 5767 __ Push(at, ToRegister(instr->function())); |
5774 CallRuntime(Runtime::kPushBlockContext, instr); | 5768 CallRuntime(Runtime::kPushBlockContext, instr); |
5775 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5769 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5776 } | 5770 } |
5777 | 5771 |
5778 | 5772 |
5779 #undef __ | 5773 #undef __ |
5780 | 5774 |
5781 } // namespace internal | 5775 } // namespace internal |
5782 } // namespace v8 | 5776 } // namespace v8 |
OLD | NEW |