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

Side by Side Diff: src/mips/lithium-mips.cc

Issue 306053011: MIPS: Simplify known successor block lowering. (Closed) Base URL: git@github.com:paul99/v8m-rb.git@master
Patch Set: Created 6 years, 6 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/mips/lithium-mips.h ('k') | no next file » | 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 "v8.h" 5 #include "v8.h"
6 6
7 #include "lithium-allocator-inl.h" 7 #include "lithium-allocator-inl.h"
8 #include "mips/lithium-mips.h" 8 #include "mips/lithium-mips.h"
9 #include "mips/lithium-codegen-mips.h" 9 #include "mips/lithium-codegen-mips.h"
10 #include "hydrogen-osr.h" 10 #include "hydrogen-osr.h"
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 LDummyUse(UseAny(current->OperandAt(0)))); 842 LDummyUse(UseAny(current->OperandAt(0))));
843 } 843 }
844 for (int i = 1; i < current->OperandCount(); ++i) { 844 for (int i = 1; i < current->OperandCount(); ++i) {
845 if (current->OperandAt(i)->IsControlInstruction()) continue; 845 if (current->OperandAt(i)->IsControlInstruction()) continue;
846 LInstruction* dummy = 846 LInstruction* dummy =
847 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); 847 new(zone()) LDummyUse(UseAny(current->OperandAt(i)));
848 dummy->set_hydrogen_value(current); 848 dummy->set_hydrogen_value(current);
849 chunk_->AddInstruction(dummy, current_block_); 849 chunk_->AddInstruction(dummy, current_block_);
850 } 850 }
851 } else { 851 } else {
852 instr = current->CompileToLithium(this); 852 HBasicBlock* successor;
853 if (current->IsControlInstruction() &&
854 HControlInstruction::cast(current)->KnownSuccessorBlock(&successor) &&
855 successor != NULL) {
856 instr = new(zone()) LGoto(successor);
857 } else {
858 instr = current->CompileToLithium(this);
859 }
853 } 860 }
854 861
855 argument_count_ += current->argument_delta(); 862 argument_count_ += current->argument_delta();
856 ASSERT(argument_count_ >= 0); 863 ASSERT(argument_count_ >= 0);
857 864
858 if (instr != NULL) { 865 if (instr != NULL) {
859 AddInstruction(instr, current); 866 AddInstruction(instr, current);
860 } 867 }
861 868
862 current_instruction_ = old_current; 869 current_instruction_ = old_current;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
928 } 935 }
929 } 936 }
930 937
931 938
932 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 939 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
933 return new(zone()) LGoto(instr->FirstSuccessor()); 940 return new(zone()) LGoto(instr->FirstSuccessor());
934 } 941 }
935 942
936 943
937 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 944 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
938 LInstruction* goto_instr = CheckElideControlInstruction(instr);
939 if (goto_instr != NULL) return goto_instr;
940
941 HValue* value = instr->value(); 945 HValue* value = instr->value();
942 Representation r = value->representation(); 946 Representation r = value->representation();
943 HType type = value->type(); 947 HType type = value->type();
944 ToBooleanStub::Types expected = instr->expected_input_types(); 948 ToBooleanStub::Types expected = instr->expected_input_types();
945 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic(); 949 if (expected.IsEmpty()) expected = ToBooleanStub::Types::Generic();
946 950
947 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() || 951 bool easy_case = !r.IsTagged() || type.IsBoolean() || type.IsSmi() ||
948 type.IsJSArray() || type.IsHeapNumber() || type.IsString(); 952 type.IsJSArray() || type.IsHeapNumber() || type.IsString();
949 LInstruction* branch = new(zone()) LBranch(UseRegister(value)); 953 LInstruction* branch = new(zone()) LBranch(UseRegister(value));
950 if (!easy_case && 954 if (!easy_case &&
951 ((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) || 955 ((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) ||
952 !expected.IsGeneric())) { 956 !expected.IsGeneric())) {
953 branch = AssignEnvironment(branch); 957 branch = AssignEnvironment(branch);
954 } 958 }
955 return branch; 959 return branch;
956 } 960 }
957 961
958 962
959 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 963 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
960 LInstruction* goto_instr = CheckElideControlInstruction(instr);
961 if (goto_instr != NULL) return goto_instr;
962
963 ASSERT(instr->value()->representation().IsTagged()); 964 ASSERT(instr->value()->representation().IsTagged());
964 LOperand* value = UseRegisterAtStart(instr->value()); 965 LOperand* value = UseRegisterAtStart(instr->value());
965 LOperand* temp = TempRegister(); 966 LOperand* temp = TempRegister();
966 return new(zone()) LCmpMapAndBranch(value, temp); 967 return new(zone()) LCmpMapAndBranch(value, temp);
967 } 968 }
968 969
969 970
970 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { 971 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
971 info()->MarkAsRequiresFrame(); 972 info()->MarkAsRequiresFrame();
972 return DefineAsRegister( 973 return DefineAsRegister(
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 LOperand* context = UseFixed(instr->context(), cp); 1622 LOperand* context = UseFixed(instr->context(), cp);
1622 LOperand* left = UseFixed(instr->left(), a1); 1623 LOperand* left = UseFixed(instr->left(), a1);
1623 LOperand* right = UseFixed(instr->right(), a0); 1624 LOperand* right = UseFixed(instr->right(), a0);
1624 LCmpT* result = new(zone()) LCmpT(context, left, right); 1625 LCmpT* result = new(zone()) LCmpT(context, left, right);
1625 return MarkAsCall(DefineFixed(result, v0), instr); 1626 return MarkAsCall(DefineFixed(result, v0), instr);
1626 } 1627 }
1627 1628
1628 1629
1629 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( 1630 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1630 HCompareNumericAndBranch* instr) { 1631 HCompareNumericAndBranch* instr) {
1631 LInstruction* goto_instr = CheckElideControlInstruction(instr);
1632 if (goto_instr != NULL) return goto_instr;
1633 Representation r = instr->representation(); 1632 Representation r = instr->representation();
1634 if (r.IsSmiOrInteger32()) { 1633 if (r.IsSmiOrInteger32()) {
1635 ASSERT(instr->left()->representation().Equals(r)); 1634 ASSERT(instr->left()->representation().Equals(r));
1636 ASSERT(instr->right()->representation().Equals(r)); 1635 ASSERT(instr->right()->representation().Equals(r));
1637 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1636 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1638 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); 1637 LOperand* right = UseRegisterOrConstantAtStart(instr->right());
1639 return new(zone()) LCompareNumericAndBranch(left, right); 1638 return new(zone()) LCompareNumericAndBranch(left, right);
1640 } else { 1639 } else {
1641 ASSERT(r.IsDouble()); 1640 ASSERT(r.IsDouble());
1642 ASSERT(instr->left()->representation().IsDouble()); 1641 ASSERT(instr->left()->representation().IsDouble());
1643 ASSERT(instr->right()->representation().IsDouble()); 1642 ASSERT(instr->right()->representation().IsDouble());
1644 LOperand* left = UseRegisterAtStart(instr->left()); 1643 LOperand* left = UseRegisterAtStart(instr->left());
1645 LOperand* right = UseRegisterAtStart(instr->right()); 1644 LOperand* right = UseRegisterAtStart(instr->right());
1646 return new(zone()) LCompareNumericAndBranch(left, right); 1645 return new(zone()) LCompareNumericAndBranch(left, right);
1647 } 1646 }
1648 } 1647 }
1649 1648
1650 1649
1651 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( 1650 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1652 HCompareObjectEqAndBranch* instr) { 1651 HCompareObjectEqAndBranch* instr) {
1653 LInstruction* goto_instr = CheckElideControlInstruction(instr);
1654 if (goto_instr != NULL) return goto_instr;
1655 LOperand* left = UseRegisterAtStart(instr->left()); 1652 LOperand* left = UseRegisterAtStart(instr->left());
1656 LOperand* right = UseRegisterAtStart(instr->right()); 1653 LOperand* right = UseRegisterAtStart(instr->right());
1657 return new(zone()) LCmpObjectEqAndBranch(left, right); 1654 return new(zone()) LCmpObjectEqAndBranch(left, right);
1658 } 1655 }
1659 1656
1660 1657
1661 LInstruction* LChunkBuilder::DoCompareHoleAndBranch( 1658 LInstruction* LChunkBuilder::DoCompareHoleAndBranch(
1662 HCompareHoleAndBranch* instr) { 1659 HCompareHoleAndBranch* instr) {
1663 LOperand* value = UseRegisterAtStart(instr->value()); 1660 LOperand* value = UseRegisterAtStart(instr->value());
1664 return new(zone()) LCmpHoleAndBranch(value); 1661 return new(zone()) LCmpHoleAndBranch(value);
1665 } 1662 }
1666 1663
1667 1664
1668 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( 1665 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch(
1669 HCompareMinusZeroAndBranch* instr) { 1666 HCompareMinusZeroAndBranch* instr) {
1670 LInstruction* goto_instr = CheckElideControlInstruction(instr);
1671 if (goto_instr != NULL) return goto_instr;
1672 LOperand* value = UseRegister(instr->value()); 1667 LOperand* value = UseRegister(instr->value());
1673 LOperand* scratch = TempRegister(); 1668 LOperand* scratch = TempRegister();
1674 return new(zone()) LCompareMinusZeroAndBranch(value, scratch); 1669 return new(zone()) LCompareMinusZeroAndBranch(value, scratch);
1675 } 1670 }
1676 1671
1677 1672
1678 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { 1673 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1679 ASSERT(instr->value()->representation().IsTagged()); 1674 ASSERT(instr->value()->representation().IsTagged());
1680 LOperand* temp = TempRegister(); 1675 LOperand* temp = TempRegister();
1681 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()), 1676 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()),
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 2421
2427 2422
2428 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { 2423 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
2429 LOperand* context = UseFixed(instr->context(), cp); 2424 LOperand* context = UseFixed(instr->context(), cp);
2430 LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), a0)); 2425 LTypeof* result = new(zone()) LTypeof(context, UseFixed(instr->value(), a0));
2431 return MarkAsCall(DefineFixed(result, v0), instr); 2426 return MarkAsCall(DefineFixed(result, v0), instr);
2432 } 2427 }
2433 2428
2434 2429
2435 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) { 2430 LInstruction* LChunkBuilder::DoTypeofIsAndBranch(HTypeofIsAndBranch* instr) {
2436 LInstruction* goto_instr = CheckElideControlInstruction(instr);
2437 if (goto_instr != NULL) return goto_instr;
2438
2439 return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value())); 2431 return new(zone()) LTypeofIsAndBranch(UseTempRegister(instr->value()));
2440 } 2432 }
2441 2433
2442 2434
2443 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( 2435 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch(
2444 HIsConstructCallAndBranch* instr) { 2436 HIsConstructCallAndBranch* instr) {
2445 return new(zone()) LIsConstructCallAndBranch(TempRegister()); 2437 return new(zone()) LIsConstructCallAndBranch(TempRegister());
2446 } 2438 }
2447 2439
2448 2440
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2520 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2529 LOperand* object = UseRegister(instr->object()); 2521 LOperand* object = UseRegister(instr->object());
2530 LOperand* index = UseTempRegister(instr->index()); 2522 LOperand* index = UseTempRegister(instr->index());
2531 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2523 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2532 LInstruction* result = DefineSameAsFirst(load); 2524 LInstruction* result = DefineSameAsFirst(load);
2533 return AssignPointerMap(result); 2525 return AssignPointerMap(result);
2534 } 2526 }
2535 2527
2536 2528
2537 } } // namespace v8::internal 2529 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698