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/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 // The deoptimization jump table is the last part of the instruction | 369 // The deoptimization jump table is the last part of the instruction |
370 // sequence. Mark the generated code as done unless we bailed out. | 370 // sequence. Mark the generated code as done unless we bailed out. |
371 if (!is_aborted()) status_ = DONE; | 371 if (!is_aborted()) status_ = DONE; |
372 return !is_aborted(); | 372 return !is_aborted(); |
373 } | 373 } |
374 | 374 |
375 | 375 |
376 bool LCodeGen::GenerateSafepointTable() { | 376 bool LCodeGen::GenerateSafepointTable() { |
377 DCHECK(is_done()); | 377 DCHECK(is_done()); |
378 safepoints_.Emit(masm(), GetTotalFrameSlotCount()); | 378 safepoints_.Emit(masm(), GetStackSlotCount()); |
379 return !is_aborted(); | 379 return !is_aborted(); |
380 } | 380 } |
381 | 381 |
382 | 382 |
383 Register LCodeGen::ToRegister(int code) const { | 383 Register LCodeGen::ToRegister(int code) const { |
384 return Register::from_code(code); | 384 return Register::from_code(code); |
385 } | 385 } |
386 | 386 |
387 | 387 |
388 DwVfpRegister LCodeGen::ToDoubleRegister(int code) const { | 388 DwVfpRegister LCodeGen::ToDoubleRegister(int code) const { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 DCHECK(index < 0); | 540 DCHECK(index < 0); |
541 return -(index + 1) * kPointerSize; | 541 return -(index + 1) * kPointerSize; |
542 } | 542 } |
543 | 543 |
544 | 544 |
545 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { | 545 MemOperand LCodeGen::ToMemOperand(LOperand* op) const { |
546 DCHECK(!op->IsRegister()); | 546 DCHECK(!op->IsRegister()); |
547 DCHECK(!op->IsDoubleRegister()); | 547 DCHECK(!op->IsDoubleRegister()); |
548 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 548 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
549 if (NeedsEagerFrame()) { | 549 if (NeedsEagerFrame()) { |
550 return MemOperand(fp, FrameSlotToFPOffset(op->index())); | 550 return MemOperand(fp, StackSlotOffset(op->index())); |
551 } else { | 551 } else { |
552 // Retrieve parameter without eager stack-frame relative to the | 552 // Retrieve parameter without eager stack-frame relative to the |
553 // stack-pointer. | 553 // stack-pointer. |
554 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); | 554 return MemOperand(sp, ArgumentsOffsetWithoutFrame(op->index())); |
555 } | 555 } |
556 } | 556 } |
557 | 557 |
558 | 558 |
559 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { | 559 MemOperand LCodeGen::ToHighMemOperand(LOperand* op) const { |
560 DCHECK(op->IsDoubleStackSlot()); | 560 DCHECK(op->IsDoubleStackSlot()); |
561 if (NeedsEagerFrame()) { | 561 if (NeedsEagerFrame()) { |
562 return MemOperand(fp, FrameSlotToFPOffset(op->index()) + kPointerSize); | 562 return MemOperand(fp, StackSlotOffset(op->index()) + kPointerSize); |
563 } else { | 563 } else { |
564 // Retrieve parameter without eager stack-frame relative to the | 564 // Retrieve parameter without eager stack-frame relative to the |
565 // stack-pointer. | 565 // stack-pointer. |
566 return MemOperand( | 566 return MemOperand( |
567 sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); | 567 sp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
571 | 571 |
572 void LCodeGen::WriteTranslation(LEnvironment* environment, | 572 void LCodeGen::WriteTranslation(LEnvironment* environment, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 environment->HasTaggedValueAt(env_offset + i), | 621 environment->HasTaggedValueAt(env_offset + i), |
622 environment->HasUint32ValueAt(env_offset + i), | 622 environment->HasUint32ValueAt(env_offset + i), |
623 object_index_pointer, | 623 object_index_pointer, |
624 dematerialized_index_pointer); | 624 dematerialized_index_pointer); |
625 } | 625 } |
626 return; | 626 return; |
627 } | 627 } |
628 | 628 |
629 if (op->IsStackSlot()) { | 629 if (op->IsStackSlot()) { |
630 int index = op->index(); | 630 int index = op->index(); |
| 631 if (index >= 0) { |
| 632 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 633 } |
631 if (is_tagged) { | 634 if (is_tagged) { |
632 translation->StoreStackSlot(index); | 635 translation->StoreStackSlot(index); |
633 } else if (is_uint32) { | 636 } else if (is_uint32) { |
634 translation->StoreUint32StackSlot(index); | 637 translation->StoreUint32StackSlot(index); |
635 } else { | 638 } else { |
636 translation->StoreInt32StackSlot(index); | 639 translation->StoreInt32StackSlot(index); |
637 } | 640 } |
638 } else if (op->IsDoubleStackSlot()) { | 641 } else if (op->IsDoubleStackSlot()) { |
639 int index = op->index(); | 642 int index = op->index(); |
| 643 if (index >= 0) { |
| 644 index += StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 645 } |
640 translation->StoreDoubleStackSlot(index); | 646 translation->StoreDoubleStackSlot(index); |
641 } else if (op->IsRegister()) { | 647 } else if (op->IsRegister()) { |
642 Register reg = ToRegister(op); | 648 Register reg = ToRegister(op); |
643 if (is_tagged) { | 649 if (is_tagged) { |
644 translation->StoreRegister(reg); | 650 translation->StoreRegister(reg); |
645 } else if (is_uint32) { | 651 } else if (is_uint32) { |
646 translation->StoreUint32Register(reg); | 652 translation->StoreUint32Register(reg); |
647 } else { | 653 } else { |
648 translation->StoreInt32Register(reg); | 654 translation->StoreInt32Register(reg); |
649 } | 655 } |
(...skipping 4899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5549 __ push(ToRegister(instr->function())); | 5555 __ push(ToRegister(instr->function())); |
5550 CallRuntime(Runtime::kPushBlockContext, instr); | 5556 CallRuntime(Runtime::kPushBlockContext, instr); |
5551 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5557 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5552 } | 5558 } |
5553 | 5559 |
5554 | 5560 |
5555 #undef __ | 5561 #undef __ |
5556 | 5562 |
5557 } // namespace internal | 5563 } // namespace internal |
5558 } // namespace v8 | 5564 } // namespace v8 |
OLD | NEW |