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

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 24 matching lines...) Expand all
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace internal {
38 38
39 // Forward declarations. 39 // Forward declarations.
40 class LCodeGen; 40 class LCodeGen;
41 41
42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
43 V(ControlInstruction) \ 43 V(ControlInstruction) \
44 V(Call) \ 44 V(Call) \
45 V(StoreKeyed) \
46 V(StoreNamed) \
47 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) 45 LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
48 46
49 47
50 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 48 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
51 V(AccessArgumentsAt) \ 49 V(AccessArgumentsAt) \
52 V(AddI) \ 50 V(AddI) \
53 V(ApplyArguments) \ 51 V(ApplyArguments) \
54 V(ArgumentsElements) \ 52 V(ArgumentsElements) \
55 V(ArgumentsLength) \ 53 V(ArgumentsLength) \
56 V(ArithmeticD) \ 54 V(ArithmeticD) \
(...skipping 27 matching lines...) Expand all
84 V(CmpT) \ 82 V(CmpT) \
85 V(CmpTAndBranch) \ 83 V(CmpTAndBranch) \
86 V(ConstantD) \ 84 V(ConstantD) \
87 V(ConstantI) \ 85 V(ConstantI) \
88 V(ConstantT) \ 86 V(ConstantT) \
89 V(Context) \ 87 V(Context) \
90 V(DeleteProperty) \ 88 V(DeleteProperty) \
91 V(Deoptimize) \ 89 V(Deoptimize) \
92 V(DivI) \ 90 V(DivI) \
93 V(DoubleToI) \ 91 V(DoubleToI) \
92 V(ExternalArrayLength) \
94 V(FixedArrayLength) \ 93 V(FixedArrayLength) \
95 V(FunctionLiteral) \ 94 V(FunctionLiteral) \
96 V(Gap) \ 95 V(Gap) \
96 V(GetCachedArrayIndex) \
97 V(GlobalObject) \ 97 V(GlobalObject) \
98 V(GlobalReceiver) \ 98 V(GlobalReceiver) \
99 V(Goto) \ 99 V(Goto) \
100 V(HasCachedArrayIndex) \ 100 V(HasCachedArrayIndex) \
101 V(HasCachedArrayIndexAndBranch) \ 101 V(HasCachedArrayIndexAndBranch) \
102 V(HasInstanceType) \ 102 V(HasInstanceType) \
103 V(HasInstanceTypeAndBranch) \ 103 V(HasInstanceTypeAndBranch) \
104 V(InstanceOf) \ 104 V(InstanceOf) \
105 V(InstanceOfAndBranch) \ 105 V(InstanceOfAndBranch) \
106 V(InstanceOfKnownGlobal) \ 106 V(InstanceOfKnownGlobal) \
107 V(Integer32ToDouble) \ 107 V(Integer32ToDouble) \
108 V(IsNull) \ 108 V(IsNull) \
109 V(IsNullAndBranch) \ 109 V(IsNullAndBranch) \
110 V(IsObject) \ 110 V(IsObject) \
111 V(IsObjectAndBranch) \ 111 V(IsObjectAndBranch) \
112 V(IsSmi) \ 112 V(IsSmi) \
113 V(IsSmiAndBranch) \ 113 V(IsSmiAndBranch) \
114 V(IsConstructCall) \ 114 V(IsConstructCall) \
115 V(IsConstructCallAndBranch) \ 115 V(IsConstructCallAndBranch) \
116 V(JSArrayLength) \ 116 V(JSArrayLength) \
117 V(Label) \ 117 V(Label) \
118 V(LazyBailout) \ 118 V(LazyBailout) \
119 V(LoadContextSlot) \ 119 V(LoadContextSlot) \
120 V(LoadElements) \ 120 V(LoadElements) \
121 V(LoadExternalArrayPointer) \
121 V(LoadFunctionPrototype) \ 122 V(LoadFunctionPrototype) \
122 V(LoadGlobal) \ 123 V(LoadGlobal) \
123 V(LoadKeyedFastElement) \ 124 V(LoadKeyedFastElement) \
124 V(LoadKeyedGeneric) \ 125 V(LoadKeyedGeneric) \
125 V(LoadNamedField) \ 126 V(LoadNamedField) \
126 V(LoadNamedGeneric) \ 127 V(LoadNamedGeneric) \
127 V(LoadPixelArrayElement) \ 128 V(LoadPixelArrayElement) \
128 V(LoadPixelArrayExternalPointer) \
129 V(ModI) \ 129 V(ModI) \
130 V(MulI) \ 130 V(MulI) \
131 V(NumberTagD) \ 131 V(NumberTagD) \
132 V(NumberTagI) \ 132 V(NumberTagI) \
133 V(NumberUntagD) \ 133 V(NumberUntagD) \
134 V(ObjectLiteral) \ 134 V(ObjectLiteral) \
135 V(OsrEntry) \ 135 V(OsrEntry) \
136 V(OuterContext) \ 136 V(OuterContext) \
137 V(Parameter) \ 137 V(Parameter) \
138 V(PixelArrayLength) \
139 V(Power) \ 138 V(Power) \
140 V(PushArgument) \ 139 V(PushArgument) \
141 V(RegExpLiteral) \ 140 V(RegExpLiteral) \
142 V(Return) \ 141 V(Return) \
143 V(ShiftI) \ 142 V(ShiftI) \
144 V(SmiTag) \ 143 V(SmiTag) \
145 V(SmiUntag) \ 144 V(SmiUntag) \
146 V(StackCheck) \ 145 V(StackCheck) \
147 V(StoreContextSlot) \ 146 V(StoreContextSlot) \
148 V(StoreGlobal) \ 147 V(StoreGlobal) \
149 V(StoreKeyedFastElement) \ 148 V(StoreKeyedFastElement) \
150 V(StoreKeyedGeneric) \ 149 V(StoreKeyedGeneric) \
151 V(StoreNamedField) \ 150 V(StoreNamedField) \
152 V(StoreNamedGeneric) \ 151 V(StoreNamedGeneric) \
152 V(StorePixelArrayElement) \
153 V(StringCharCodeAt) \ 153 V(StringCharCodeAt) \
154 V(StringCharFromCode) \
154 V(StringLength) \ 155 V(StringLength) \
155 V(SubI) \ 156 V(SubI) \
156 V(TaggedToI) \ 157 V(TaggedToI) \
157 V(Throw) \ 158 V(Throw) \
158 V(Typeof) \ 159 V(Typeof) \
159 V(TypeofIs) \ 160 V(TypeofIs) \
160 V(TypeofIsAndBranch) \ 161 V(TypeofIsAndBranch) \
161 V(UnaryMathOperation) \ 162 V(UnaryMathOperation) \
162 V(UnknownOSRValue) \ 163 V(UnknownOSRValue) \
163 V(ValueOf) 164 V(ValueOf)
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 738 }
738 739
739 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 740 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
740 "has-instance-type-and-branch") 741 "has-instance-type-and-branch")
741 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) 742 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
742 743
743 virtual void PrintDataTo(StringStream* stream); 744 virtual void PrintDataTo(StringStream* stream);
744 }; 745 };
745 746
746 747
748 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
749 public:
750 explicit LGetCachedArrayIndex(LOperand* value) {
751 inputs_[0] = value;
752 }
753
754 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
755 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
756 };
757
758
747 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { 759 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
748 public: 760 public:
749 explicit LHasCachedArrayIndex(LOperand* value) { 761 explicit LHasCachedArrayIndex(LOperand* value) {
750 inputs_[0] = value; 762 inputs_[0] = value;
751 } 763 }
752 764
753 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") 765 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
754 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) 766 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
755 }; 767 };
756 768
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 public: 1030 public:
1019 explicit LJSArrayLength(LOperand* value) { 1031 explicit LJSArrayLength(LOperand* value) {
1020 inputs_[0] = value; 1032 inputs_[0] = value;
1021 } 1033 }
1022 1034
1023 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") 1035 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1024 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) 1036 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1025 }; 1037 };
1026 1038
1027 1039
1028 class LPixelArrayLength: public LTemplateInstruction<1, 1, 0> { 1040 class LExternalArrayLength: public LTemplateInstruction<1, 1, 0> {
1029 public: 1041 public:
1030 explicit LPixelArrayLength(LOperand* value) { 1042 explicit LExternalArrayLength(LOperand* value) {
1031 inputs_[0] = value; 1043 inputs_[0] = value;
1032 } 1044 }
1033 1045
1034 DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel-array-length") 1046 DECLARE_CONCRETE_INSTRUCTION(ExternalArrayLength, "external-array-length")
1035 DECLARE_HYDROGEN_ACCESSOR(PixelArrayLength) 1047 DECLARE_HYDROGEN_ACCESSOR(ExternalArrayLength)
1036 }; 1048 };
1037 1049
1038 1050
1039 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { 1051 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
1040 public: 1052 public:
1041 explicit LFixedArrayLength(LOperand* value) { 1053 explicit LFixedArrayLength(LOperand* value) {
1042 inputs_[0] = value; 1054 inputs_[0] = value;
1043 } 1055 }
1044 1056
1045 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") 1057 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 class LLoadElements: public LTemplateInstruction<1, 1, 0> { 1205 class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1194 public: 1206 public:
1195 explicit LLoadElements(LOperand* object) { 1207 explicit LLoadElements(LOperand* object) {
1196 inputs_[0] = object; 1208 inputs_[0] = object;
1197 } 1209 }
1198 1210
1199 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1211 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1200 }; 1212 };
1201 1213
1202 1214
1203 class LLoadPixelArrayExternalPointer: public LTemplateInstruction<1, 1, 0> { 1215 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1204 public: 1216 public:
1205 explicit LLoadPixelArrayExternalPointer(LOperand* object) { 1217 explicit LLoadExternalArrayPointer(LOperand* object) {
1206 inputs_[0] = object; 1218 inputs_[0] = object;
1207 } 1219 }
1208 1220
1209 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer, 1221 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1210 "load-pixel-array-external-pointer") 1222 "load-external-array-pointer")
1211 }; 1223 };
1212 1224
1213 1225
1214 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { 1226 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1215 public: 1227 public:
1216 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { 1228 LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1217 inputs_[0] = elements; 1229 inputs_[0] = elements;
1218 inputs_[1] = key; 1230 inputs_[1] = key;
1219 } 1231 }
1220 1232
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 1594
1583 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1595 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1584 1596
1585 bool needs_check() const { return needs_check_; } 1597 bool needs_check() const { return needs_check_; }
1586 1598
1587 private: 1599 private:
1588 bool needs_check_; 1600 bool needs_check_;
1589 }; 1601 };
1590 1602
1591 1603
1592 class LStoreNamed: public LTemplateInstruction<0, 2, 1> { 1604 class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1593 public: 1605 public:
1594 LStoreNamed(LOperand* obj, LOperand* val) { 1606 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) {
1595 inputs_[0] = obj; 1607 inputs_[0] = obj;
1596 inputs_[1] = val; 1608 inputs_[1] = val;
1597 }
1598
1599 DECLARE_INSTRUCTION(StoreNamed)
1600 DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
1601
1602 virtual void PrintDataTo(StringStream* stream);
1603
1604 LOperand* object() { return inputs_[0]; }
1605 LOperand* value() { return inputs_[1]; }
1606 Handle<Object> name() const { return hydrogen()->name(); }
1607 };
1608
1609
1610 class LStoreNamedField: public LStoreNamed {
1611 public:
1612 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
1613 : LStoreNamed(obj, val) {
1614 temps_[0] = temp; 1609 temps_[0] = temp;
1615 } 1610 }
1616 1611
1617 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1612 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1618 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 1613 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1619 1614
1615 virtual void PrintDataTo(StringStream* stream);
1616
1617 LOperand* object() { return inputs_[0]; }
1618 LOperand* value() { return inputs_[1]; }
1619
1620 Handle<Object> name() const { return hydrogen()->name(); }
1620 bool is_in_object() { return hydrogen()->is_in_object(); } 1621 bool is_in_object() { return hydrogen()->is_in_object(); }
1621 int offset() { return hydrogen()->offset(); } 1622 int offset() { return hydrogen()->offset(); }
1622 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } 1623 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1623 Handle<Map> transition() const { return hydrogen()->transition(); } 1624 Handle<Map> transition() const { return hydrogen()->transition(); }
1624 }; 1625 };
1625 1626
1626 1627
1627 class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> { 1628 class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> {
1628 public: 1629 public:
1629 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) { 1630 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
1630 inputs_[0] = context; 1631 inputs_[0] = context;
1631 inputs_[1] = object; 1632 inputs_[1] = object;
1632 inputs_[2] = value; 1633 inputs_[2] = value;
1633 } 1634 }
1634 1635
1635 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1636 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1636 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 1637 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1637 1638
1639 virtual void PrintDataTo(StringStream* stream);
1640
1638 LOperand* context() { return inputs_[0]; } 1641 LOperand* context() { return inputs_[0]; }
1639 LOperand* object() { return inputs_[1]; } 1642 LOperand* object() { return inputs_[1]; }
1640 LOperand* value() { return inputs_[2]; } 1643 LOperand* value() { return inputs_[2]; }
1641 Handle<Object> name() const { return hydrogen()->name(); } 1644 Handle<Object> name() const { return hydrogen()->name(); }
1642 }; 1645 };
1643 1646
1644 1647
1645 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> { 1648 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1646 public: 1649 public:
1647 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { 1650 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) {
1648 inputs_[0] = obj; 1651 inputs_[0] = obj;
1649 inputs_[1] = key; 1652 inputs_[1] = key;
1650 inputs_[2] = val; 1653 inputs_[2] = val;
1651 } 1654 }
1652 1655
1653 DECLARE_INSTRUCTION(StoreKeyed) 1656 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1657 "store-keyed-fast-element")
1658 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1654 1659
1655 virtual void PrintDataTo(StringStream* stream); 1660 virtual void PrintDataTo(StringStream* stream);
1656 1661
1657 LOperand* object() { return inputs_[0]; } 1662 LOperand* object() { return inputs_[0]; }
1658 LOperand* key() { return inputs_[1]; } 1663 LOperand* key() { return inputs_[1]; }
1659 LOperand* value() { return inputs_[2]; } 1664 LOperand* value() { return inputs_[2]; }
1660 }; 1665 };
1661 1666
1662 1667
1663 class LStoreKeyedFastElement: public LStoreKeyed { 1668 class LStorePixelArrayElement: public LTemplateInstruction<0, 3, 1> {
1664 public: 1669 public:
1665 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) 1670 LStorePixelArrayElement(LOperand* external_pointer,
1666 : LStoreKeyed(obj, key, val) {} 1671 LOperand* key,
1672 LOperand* val,
1673 LOperand* clamped) {
1674 inputs_[0] = external_pointer;
1675 inputs_[1] = key;
1676 inputs_[2] = val;
1677 temps_[0] = clamped;
1678 }
1667 1679
1668 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1680 DECLARE_CONCRETE_INSTRUCTION(StorePixelArrayElement,
1669 "store-keyed-fast-element") 1681 "store-pixel-array-element")
1670 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) 1682 DECLARE_HYDROGEN_ACCESSOR(StorePixelArrayElement)
1683
1684 LOperand* external_pointer() { return inputs_[0]; }
1685 LOperand* key() { return inputs_[1]; }
1686 LOperand* value() { return inputs_[2]; }
1671 }; 1687 };
1672 1688
1673 1689
1674 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> { 1690 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
1675 public: 1691 public:
1676 LStoreKeyedGeneric(LOperand* context, 1692 LStoreKeyedGeneric(LOperand* context,
1677 LOperand* object, 1693 LOperand* object,
1678 LOperand* key, 1694 LOperand* key,
1679 LOperand* value) { 1695 LOperand* value) {
1680 inputs_[0] = context; 1696 inputs_[0] = context;
1681 inputs_[1] = object; 1697 inputs_[1] = object;
1682 inputs_[2] = key; 1698 inputs_[2] = key;
1683 inputs_[3] = value; 1699 inputs_[3] = value;
1684 } 1700 }
1685 1701
1686 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 1702 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1687 1703
1704 virtual void PrintDataTo(StringStream* stream);
1705
1688 LOperand* context() { return inputs_[0]; } 1706 LOperand* context() { return inputs_[0]; }
1689 LOperand* object() { return inputs_[1]; } 1707 LOperand* object() { return inputs_[1]; }
1690 LOperand* key() { return inputs_[2]; } 1708 LOperand* key() { return inputs_[2]; }
1691 LOperand* value() { return inputs_[3]; } 1709 LOperand* value() { return inputs_[3]; }
1692 }; 1710 };
1693 1711
1694 1712
1695 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { 1713 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1696 public: 1714 public:
1697 LStringCharCodeAt(LOperand* string, LOperand* index) { 1715 LStringCharCodeAt(LOperand* string, LOperand* index) {
1698 inputs_[0] = string; 1716 inputs_[0] = string;
1699 inputs_[1] = index; 1717 inputs_[1] = index;
1700 } 1718 }
1701 1719
1702 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") 1720 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1703 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) 1721 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1704 1722
1705 LOperand* string() { return inputs_[0]; } 1723 LOperand* string() { return inputs_[0]; }
1706 LOperand* index() { return inputs_[1]; } 1724 LOperand* index() { return inputs_[1]; }
1707 }; 1725 };
1708 1726
1709 1727
1728 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1729 public:
1730 explicit LStringCharFromCode(LOperand* char_code) {
1731 inputs_[0] = char_code;
1732 }
1733
1734 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1735 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1736
1737 LOperand* char_code() { return inputs_[0]; }
1738 };
1739
1740
1710 class LStringLength: public LTemplateInstruction<1, 1, 0> { 1741 class LStringLength: public LTemplateInstruction<1, 1, 0> {
1711 public: 1742 public:
1712 explicit LStringLength(LOperand* string) { 1743 explicit LStringLength(LOperand* string) {
1713 inputs_[0] = string; 1744 inputs_[0] = string;
1714 } 1745 }
1715 1746
1716 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") 1747 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1717 DECLARE_HYDROGEN_ACCESSOR(StringLength) 1748 DECLARE_HYDROGEN_ACCESSOR(StringLength)
1718 1749
1719 LOperand* string() { return inputs_[0]; } 1750 LOperand* string() { return inputs_[0]; }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 1933
1903 class LStackCheck: public LTemplateInstruction<0, 0, 0> { 1934 class LStackCheck: public LTemplateInstruction<0, 0, 0> {
1904 public: 1935 public:
1905 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 1936 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
1906 }; 1937 };
1907 1938
1908 1939
1909 class LChunkBuilder; 1940 class LChunkBuilder;
1910 class LChunk: public ZoneObject { 1941 class LChunk: public ZoneObject {
1911 public: 1942 public:
1912 explicit LChunk(HGraph* graph) 1943 explicit LChunk(CompilationInfo* info, HGraph* graph)
1913 : spill_slot_count_(0), 1944 : spill_slot_count_(0),
1945 info_(info),
1914 graph_(graph), 1946 graph_(graph),
1915 instructions_(32), 1947 instructions_(32),
1916 pointer_maps_(8), 1948 pointer_maps_(8),
1917 inlined_closures_(1) { } 1949 inlined_closures_(1) { }
1918 1950
1919 void AddInstruction(LInstruction* instruction, HBasicBlock* block); 1951 void AddInstruction(LInstruction* instruction, HBasicBlock* block);
1920 LConstantOperand* DefineConstantOperand(HConstant* constant); 1952 LConstantOperand* DefineConstantOperand(HConstant* constant);
1921 Handle<Object> LookupLiteral(LConstantOperand* operand) const; 1953 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
1922 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; 1954 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
1923 1955
1924 int GetNextSpillIndex(bool is_double); 1956 int GetNextSpillIndex(bool is_double);
1925 LOperand* GetNextSpillSlot(bool is_double); 1957 LOperand* GetNextSpillSlot(bool is_double);
1926 1958
1927 int ParameterAt(int index); 1959 int ParameterAt(int index);
1928 int GetParameterStackSlot(int index) const; 1960 int GetParameterStackSlot(int index) const;
1929 int spill_slot_count() const { return spill_slot_count_; } 1961 int spill_slot_count() const { return spill_slot_count_; }
1962 CompilationInfo* info() const { return info_; }
1930 HGraph* graph() const { return graph_; } 1963 HGraph* graph() const { return graph_; }
1931 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } 1964 const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
1932 void AddGapMove(int index, LOperand* from, LOperand* to); 1965 void AddGapMove(int index, LOperand* from, LOperand* to);
1933 LGap* GetGapAt(int index) const; 1966 LGap* GetGapAt(int index) const;
1934 bool IsGapAt(int index) const; 1967 bool IsGapAt(int index) const;
1935 int NearestGapPos(int index) const; 1968 int NearestGapPos(int index) const;
1936 void MarkEmptyBlocks(); 1969 void MarkEmptyBlocks();
1937 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } 1970 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
1938 LLabel* GetLabel(int block_id) const { 1971 LLabel* GetLabel(int block_id) const {
1939 HBasicBlock* block = graph_->blocks()->at(block_id); 1972 HBasicBlock* block = graph_->blocks()->at(block_id);
(...skipping 16 matching lines...) Expand all
1956 const ZoneList<Handle<JSFunction> >* inlined_closures() const { 1989 const ZoneList<Handle<JSFunction> >* inlined_closures() const {
1957 return &inlined_closures_; 1990 return &inlined_closures_;
1958 } 1991 }
1959 1992
1960 void AddInlinedClosure(Handle<JSFunction> closure) { 1993 void AddInlinedClosure(Handle<JSFunction> closure) {
1961 inlined_closures_.Add(closure); 1994 inlined_closures_.Add(closure);
1962 } 1995 }
1963 1996
1964 private: 1997 private:
1965 int spill_slot_count_; 1998 int spill_slot_count_;
1999 CompilationInfo* info_;
1966 HGraph* const graph_; 2000 HGraph* const graph_;
1967 ZoneList<LInstruction*> instructions_; 2001 ZoneList<LInstruction*> instructions_;
1968 ZoneList<LPointerMap*> pointer_maps_; 2002 ZoneList<LPointerMap*> pointer_maps_;
1969 ZoneList<Handle<JSFunction> > inlined_closures_; 2003 ZoneList<Handle<JSFunction> > inlined_closures_;
1970 }; 2004 };
1971 2005
1972 2006
1973 class LChunkBuilder BASE_EMBEDDED { 2007 class LChunkBuilder BASE_EMBEDDED {
1974 public: 2008 public:
1975 LChunkBuilder(HGraph* graph, LAllocator* allocator) 2009 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
1976 : chunk_(NULL), 2010 : chunk_(NULL),
2011 info_(info),
1977 graph_(graph), 2012 graph_(graph),
1978 status_(UNUSED), 2013 status_(UNUSED),
1979 current_instruction_(NULL), 2014 current_instruction_(NULL),
1980 current_block_(NULL), 2015 current_block_(NULL),
1981 next_block_(NULL), 2016 next_block_(NULL),
1982 argument_count_(0), 2017 argument_count_(0),
1983 allocator_(allocator), 2018 allocator_(allocator),
1984 position_(RelocInfo::kNoPosition), 2019 position_(RelocInfo::kNoPosition),
1985 instruction_pending_deoptimization_environment_(NULL), 2020 instruction_pending_deoptimization_environment_(NULL),
1986 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 2021 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
1987 2022
1988 // Build the sequence for the graph. 2023 // Build the sequence for the graph.
1989 LChunk* Build(); 2024 LChunk* Build();
1990 2025
1991 // Declare methods that deal with the individual node types. 2026 // Declare methods that deal with the individual node types.
1992 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2027 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
1993 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2028 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
1994 #undef DECLARE_DO 2029 #undef DECLARE_DO
1995 2030
1996 private: 2031 private:
1997 enum Status { 2032 enum Status {
1998 UNUSED, 2033 UNUSED,
1999 BUILDING, 2034 BUILDING,
2000 DONE, 2035 DONE,
2001 ABORTED 2036 ABORTED
2002 }; 2037 };
2003 2038
2004 LChunk* chunk() const { return chunk_; } 2039 LChunk* chunk() const { return chunk_; }
2040 CompilationInfo* info() const { return info_; }
2005 HGraph* graph() const { return graph_; } 2041 HGraph* graph() const { return graph_; }
2006 2042
2007 bool is_unused() const { return status_ == UNUSED; } 2043 bool is_unused() const { return status_ == UNUSED; }
2008 bool is_building() const { return status_ == BUILDING; } 2044 bool is_building() const { return status_ == BUILDING; }
2009 bool is_done() const { return status_ == DONE; } 2045 bool is_done() const { return status_ == DONE; }
2010 bool is_aborted() const { return status_ == ABORTED; } 2046 bool is_aborted() const { return status_ == ABORTED; }
2011 2047
2012 void Abort(const char* format, ...); 2048 void Abort(const char* format, ...);
2013 2049
2014 // Methods for getting operands for Use / Define / Temp. 2050 // Methods for getting operands for Use / Define / Temp.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2137
2102 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 2138 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2103 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); 2139 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2104 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 2140 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2105 LInstruction* DoArithmeticD(Token::Value op, 2141 LInstruction* DoArithmeticD(Token::Value op,
2106 HArithmeticBinaryOperation* instr); 2142 HArithmeticBinaryOperation* instr);
2107 LInstruction* DoArithmeticT(Token::Value op, 2143 LInstruction* DoArithmeticT(Token::Value op,
2108 HArithmeticBinaryOperation* instr); 2144 HArithmeticBinaryOperation* instr);
2109 2145
2110 LChunk* chunk_; 2146 LChunk* chunk_;
2147 CompilationInfo* info_;
2111 HGraph* const graph_; 2148 HGraph* const graph_;
2112 Status status_; 2149 Status status_;
2113 HInstruction* current_instruction_; 2150 HInstruction* current_instruction_;
2114 HBasicBlock* current_block_; 2151 HBasicBlock* current_block_;
2115 HBasicBlock* next_block_; 2152 HBasicBlock* next_block_;
2116 int argument_count_; 2153 int argument_count_;
2117 LAllocator* allocator_; 2154 LAllocator* allocator_;
2118 int position_; 2155 int position_;
2119 LInstruction* instruction_pending_deoptimization_environment_; 2156 LInstruction* instruction_pending_deoptimization_environment_;
2120 int pending_deoptimization_ast_id_; 2157 int pending_deoptimization_ast_id_;
2121 2158
2122 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2159 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2123 }; 2160 };
2124 2161
2125 #undef DECLARE_HYDROGEN_ACCESSOR 2162 #undef DECLARE_HYDROGEN_ACCESSOR
2126 #undef DECLARE_INSTRUCTION 2163 #undef DECLARE_INSTRUCTION
2127 #undef DECLARE_CONCRETE_INSTRUCTION 2164 #undef DECLARE_CONCRETE_INSTRUCTION
2128 2165
2129 } } // namespace v8::internal 2166 } } // namespace v8::internal
2130 2167
2131 #endif // V8_IA32_LITHIUM_IA32_H_ 2168 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698