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

Side by Side Diff: src/crankshaft/mips64/lithium-codegen-mips64.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/mips64/lithium-codegen-mips64.h ('k') | src/crankshaft/mips64/lithium-mips64.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 #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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // the frame (that is done in GeneratePrologue). 51 // the frame (that is done in GeneratePrologue).
52 FrameScope frame_scope(masm_, StackFrame::NONE); 52 FrameScope frame_scope(masm_, StackFrame::NONE);
53 53
54 return GeneratePrologue() && GenerateBody() && GenerateDeferredCode() && 54 return GeneratePrologue() && GenerateBody() && GenerateDeferredCode() &&
55 GenerateJumpTable() && GenerateSafepointTable(); 55 GenerateJumpTable() && GenerateSafepointTable();
56 } 56 }
57 57
58 58
59 void LCodeGen::FinishCode(Handle<Code> code) { 59 void LCodeGen::FinishCode(Handle<Code> code) {
60 DCHECK(is_done()); 60 DCHECK(is_done());
61 code->set_stack_slots(GetStackSlotCount()); 61 code->set_stack_slots(GetTotalFrameSlotCount());
62 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); 62 code->set_safepoint_table_offset(safepoints_.GetCodeOffset());
63 PopulateDeoptimizationData(code); 63 PopulateDeoptimizationData(code);
64 } 64 }
65 65
66 66
67 void LCodeGen::SaveCallerDoubles() { 67 void LCodeGen::SaveCallerDoubles() {
68 DCHECK(info()->saves_caller_doubles()); 68 DCHECK(info()->saves_caller_doubles());
69 DCHECK(NeedsEagerFrame()); 69 DCHECK(NeedsEagerFrame());
70 Comment(";;; Save clobbered callee double registers"); 70 Comment(";;; Save clobbered callee double registers");
71 int count = 0; 71 int count = 0;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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 5135 matching lines...) Expand 10 before | Expand all | Expand 10 after
5777 __ Push(at, ToRegister(instr->function())); 5771 __ Push(at, ToRegister(instr->function()));
5778 CallRuntime(Runtime::kPushBlockContext, instr); 5772 CallRuntime(Runtime::kPushBlockContext, instr);
5779 RecordSafepoint(Safepoint::kNoLazyDeopt); 5773 RecordSafepoint(Safepoint::kNoLazyDeopt);
5780 } 5774 }
5781 5775
5782 5776
5783 #undef __ 5777 #undef __
5784 5778
5785 } // namespace internal 5779 } // namespace internal
5786 } // namespace v8 5780 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/mips64/lithium-codegen-mips64.h ('k') | src/crankshaft/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698