Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 1702593002: More simplification and unification of frame handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.h ('k') | src/crankshaft/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return GeneratePrologue() && 67 return GeneratePrologue() &&
68 GenerateBody() && 68 GenerateBody() &&
69 GenerateDeferredCode() && 69 GenerateDeferredCode() &&
70 GenerateJumpTable() && 70 GenerateJumpTable() &&
71 GenerateSafepointTable(); 71 GenerateSafepointTable();
72 } 72 }
73 73
74 74
75 void LCodeGen::FinishCode(Handle<Code> code) { 75 void LCodeGen::FinishCode(Handle<Code> code) {
76 DCHECK(is_done()); 76 DCHECK(is_done());
77 code->set_stack_slots(GetStackSlotCount()); 77 code->set_stack_slots(GetTotalFrameSlotCount());
78 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); 78 code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
79 PopulateDeoptimizationData(code); 79 PopulateDeoptimizationData(code);
80 if (info()->ShouldEnsureSpaceForLazyDeopt()) { 80 if (info()->ShouldEnsureSpaceForLazyDeopt()) {
81 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code); 81 Deoptimizer::EnsureRelocSpaceForLazyDeoptimization(code);
82 } 82 }
83 } 83 }
84 84
85 85
86 #ifdef _MSC_VER 86 #ifdef _MSC_VER
87 void LCodeGen::MakeSureStackPagesMapped(int offset) { 87 void LCodeGen::MakeSureStackPagesMapped(int offset) {
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 DCHECK(is_done()); 476 DCHECK(is_done());
477 if (info()->ShouldEnsureSpaceForLazyDeopt()) { 477 if (info()->ShouldEnsureSpaceForLazyDeopt()) {
478 // For lazy deoptimization we need space to patch a call after every call. 478 // For lazy deoptimization we need space to patch a call after every call.
479 // Ensure there is always space for such patching, even if the code ends 479 // Ensure there is always space for such patching, even if the code ends
480 // in a call. 480 // in a call.
481 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); 481 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size();
482 while (masm()->pc_offset() < target_offset) { 482 while (masm()->pc_offset() < target_offset) {
483 masm()->nop(); 483 masm()->nop();
484 } 484 }
485 } 485 }
486 safepoints_.Emit(masm(), GetStackSlotCount()); 486 safepoints_.Emit(masm(), GetTotalFrameSlotCount());
487 return !is_aborted(); 487 return !is_aborted();
488 } 488 }
489 489
490 490
491 Register LCodeGen::ToRegister(int code) const { 491 Register LCodeGen::ToRegister(int code) const {
492 return Register::from_code(code); 492 return Register::from_code(code);
493 } 493 }
494 494
495 495
496 XMMRegister LCodeGen::ToDoubleRegister(int code) const { 496 XMMRegister LCodeGen::ToDoubleRegister(int code) const {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 DCHECK(index < 0); 564 DCHECK(index < 0);
565 return -(index + 1) * kPointerSize + kPCOnStackSize; 565 return -(index + 1) * kPointerSize + kPCOnStackSize;
566 } 566 }
567 567
568 568
569 Operand LCodeGen::ToOperand(LOperand* op) const { 569 Operand LCodeGen::ToOperand(LOperand* op) const {
570 if (op->IsRegister()) return Operand(ToRegister(op)); 570 if (op->IsRegister()) return Operand(ToRegister(op));
571 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op)); 571 if (op->IsDoubleRegister()) return Operand(ToDoubleRegister(op));
572 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); 572 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
573 if (NeedsEagerFrame()) { 573 if (NeedsEagerFrame()) {
574 return Operand(ebp, StackSlotOffset(op->index())); 574 return Operand(ebp, FrameSlotToFPOffset(op->index()));
575 } else { 575 } else {
576 // Retrieve parameter without eager stack-frame relative to the 576 // Retrieve parameter without eager stack-frame relative to the
577 // stack-pointer. 577 // stack-pointer.
578 return Operand(esp, ArgumentsOffsetWithoutFrame(op->index())); 578 return Operand(esp, ArgumentsOffsetWithoutFrame(op->index()));
579 } 579 }
580 } 580 }
581 581
582 582
583 Operand LCodeGen::HighOperand(LOperand* op) { 583 Operand LCodeGen::HighOperand(LOperand* op) {
584 DCHECK(op->IsDoubleStackSlot()); 584 DCHECK(op->IsDoubleStackSlot());
585 if (NeedsEagerFrame()) { 585 if (NeedsEagerFrame()) {
586 return Operand(ebp, StackSlotOffset(op->index()) + kPointerSize); 586 return Operand(ebp, FrameSlotToFPOffset(op->index()) + kPointerSize);
587 } else { 587 } else {
588 // Retrieve parameter without eager stack-frame relative to the 588 // Retrieve parameter without eager stack-frame relative to the
589 // stack-pointer. 589 // stack-pointer.
590 return Operand( 590 return Operand(
591 esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize); 591 esp, ArgumentsOffsetWithoutFrame(op->index()) + kPointerSize);
592 } 592 }
593 } 593 }
594 594
595 595
596 void LCodeGen::WriteTranslation(LEnvironment* environment, 596 void LCodeGen::WriteTranslation(LEnvironment* environment,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 environment->HasTaggedValueAt(env_offset + i), 645 environment->HasTaggedValueAt(env_offset + i),
646 environment->HasUint32ValueAt(env_offset + i), 646 environment->HasUint32ValueAt(env_offset + i),
647 object_index_pointer, 647 object_index_pointer,
648 dematerialized_index_pointer); 648 dematerialized_index_pointer);
649 } 649 }
650 return; 650 return;
651 } 651 }
652 652
653 if (op->IsStackSlot()) { 653 if (op->IsStackSlot()) {
654 int index = op->index(); 654 int index = op->index();
655 if (index >= 0) {
656 index += StandardFrameConstants::kFixedFrameSize / kPointerSize;
657 }
658 if (is_tagged) { 655 if (is_tagged) {
659 translation->StoreStackSlot(index); 656 translation->StoreStackSlot(index);
660 } else if (is_uint32) { 657 } else if (is_uint32) {
661 translation->StoreUint32StackSlot(index); 658 translation->StoreUint32StackSlot(index);
662 } else { 659 } else {
663 translation->StoreInt32StackSlot(index); 660 translation->StoreInt32StackSlot(index);
664 } 661 }
665 } else if (op->IsDoubleStackSlot()) { 662 } else if (op->IsDoubleStackSlot()) {
666 int index = op->index(); 663 int index = op->index();
667 if (index >= 0) {
668 index += StandardFrameConstants::kFixedFrameSize / kPointerSize;
669 }
670 translation->StoreDoubleStackSlot(index); 664 translation->StoreDoubleStackSlot(index);
671 } else if (op->IsRegister()) { 665 } else if (op->IsRegister()) {
672 Register reg = ToRegister(op); 666 Register reg = ToRegister(op);
673 if (is_tagged) { 667 if (is_tagged) {
674 translation->StoreRegister(reg); 668 translation->StoreRegister(reg);
675 } else if (is_uint32) { 669 } else if (is_uint32) {
676 translation->StoreUint32Register(reg); 670 translation->StoreUint32Register(reg);
677 } else { 671 } else {
678 translation->StoreInt32Register(reg); 672 translation->StoreInt32Register(reg);
679 } 673 }
(...skipping 4742 matching lines...) Expand 10 before | Expand all | Expand 10 after
5422 RecordSafepoint(Safepoint::kNoLazyDeopt); 5416 RecordSafepoint(Safepoint::kNoLazyDeopt);
5423 } 5417 }
5424 5418
5425 5419
5426 #undef __ 5420 #undef __
5427 5421
5428 } // namespace internal 5422 } // namespace internal
5429 } // namespace v8 5423 } // namespace v8
5430 5424
5431 #endif // V8_TARGET_ARCH_IA32 5425 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-codegen-ia32.h ('k') | src/crankshaft/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698