OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 15 matching lines...) Expand all Loading... | |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
29 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 29 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
30 | 30 |
31 #include "v8.h" | 31 #include "v8.h" |
32 | 32 |
33 #include "allocation.h" | 33 #include "allocation.h" |
34 #include "code-stubs.h" | 34 #include "code-stubs.h" |
35 #include "data-flow.h" | 35 #include "data-flow.h" |
36 #include "deoptimizer.h" | |
36 #include "small-pointer-list.h" | 37 #include "small-pointer-list.h" |
37 #include "string-stream.h" | 38 #include "string-stream.h" |
38 #include "v8conversions.h" | 39 #include "v8conversions.h" |
39 #include "v8utils.h" | 40 #include "v8utils.h" |
40 #include "zone.h" | 41 #include "zone.h" |
41 | 42 |
42 namespace v8 { | 43 namespace v8 { |
43 namespace internal { | 44 namespace internal { |
44 | 45 |
45 // Forward declarations. | 46 // Forward declarations. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 V(ClassOfTestAndBranch) \ | 98 V(ClassOfTestAndBranch) \ |
98 V(CompareNumericAndBranch) \ | 99 V(CompareNumericAndBranch) \ |
99 V(CompareGeneric) \ | 100 V(CompareGeneric) \ |
100 V(CompareObjectEqAndBranch) \ | 101 V(CompareObjectEqAndBranch) \ |
101 V(CompareMap) \ | 102 V(CompareMap) \ |
102 V(CompareConstantEqAndBranch) \ | 103 V(CompareConstantEqAndBranch) \ |
103 V(Constant) \ | 104 V(Constant) \ |
104 V(Context) \ | 105 V(Context) \ |
105 V(DebugBreak) \ | 106 V(DebugBreak) \ |
106 V(DeclareGlobals) \ | 107 V(DeclareGlobals) \ |
107 V(Deoptimize) \ | |
108 V(Div) \ | 108 V(Div) \ |
109 V(DummyUse) \ | 109 V(DummyUse) \ |
110 V(ElementsKind) \ | 110 V(ElementsKind) \ |
111 V(EnterInlined) \ | 111 V(EnterInlined) \ |
112 V(EnvironmentMarker) \ | 112 V(EnvironmentMarker) \ |
113 V(ForceRepresentation) \ | 113 V(ForceRepresentation) \ |
114 V(FunctionLiteral) \ | 114 V(FunctionLiteral) \ |
115 V(GetCachedArrayIndex) \ | 115 V(GetCachedArrayIndex) \ |
116 V(GlobalObject) \ | 116 V(GlobalObject) \ |
117 V(GlobalReceiver) \ | 117 V(GlobalReceiver) \ |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 V(PushArgument) \ | 155 V(PushArgument) \ |
156 V(Random) \ | 156 V(Random) \ |
157 V(RegExpLiteral) \ | 157 V(RegExpLiteral) \ |
158 V(Return) \ | 158 V(Return) \ |
159 V(Ror) \ | 159 V(Ror) \ |
160 V(Sar) \ | 160 V(Sar) \ |
161 V(SeqStringSetChar) \ | 161 V(SeqStringSetChar) \ |
162 V(Shl) \ | 162 V(Shl) \ |
163 V(Shr) \ | 163 V(Shr) \ |
164 V(Simulate) \ | 164 V(Simulate) \ |
165 V(SoftDeoptimize) \ | 165 V(Deoptimize) \ |
Jakob Kummerow
2013/07/22 16:53:12
alphabetic order please
danno
2013/07/23 12:18:14
Done.
| |
166 V(StackCheck) \ | 166 V(StackCheck) \ |
167 V(StoreContextSlot) \ | 167 V(StoreContextSlot) \ |
168 V(StoreGlobalCell) \ | 168 V(StoreGlobalCell) \ |
169 V(StoreGlobalGeneric) \ | 169 V(StoreGlobalGeneric) \ |
170 V(StoreKeyed) \ | 170 V(StoreKeyed) \ |
171 V(StoreKeyedGeneric) \ | 171 V(StoreKeyedGeneric) \ |
172 V(StoreNamedField) \ | 172 V(StoreNamedField) \ |
173 V(StoreNamedGeneric) \ | 173 V(StoreNamedGeneric) \ |
174 V(StringAdd) \ | 174 V(StringAdd) \ |
175 V(StringCharCodeAt) \ | 175 V(StringCharCodeAt) \ |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1486 HValue* related_value) | 1486 HValue* related_value) |
1487 : relation_(relation) { | 1487 : relation_(relation) { |
1488 SetOperandAt(0, constrained_value); | 1488 SetOperandAt(0, constrained_value); |
1489 SetOperandAt(1, related_value); | 1489 SetOperandAt(1, related_value); |
1490 } | 1490 } |
1491 | 1491 |
1492 NumericRelation relation_; | 1492 NumericRelation relation_; |
1493 }; | 1493 }; |
1494 | 1494 |
1495 | 1495 |
1496 // We insert soft-deoptimize when we hit code with unknown typefeedback, | 1496 // We insert soft-deoptimize when we hit code with unknown typefeedback, |
Jakob Kummerow
2013/07/22 16:53:12
comment is outdated
danno
2013/07/23 12:18:14
Done.
| |
1497 // so that we get a chance of re-optimizing with useful typefeedback. | 1497 // so that we get a chance of re-optimizing with useful typefeedback. |
1498 // HSoftDeoptimize does not end a basic block as opposed to HDeoptimize. | 1498 // HDeoptimize does not end a basic block as opposed to HDeoptimize. |
1499 class HSoftDeoptimize: public HTemplateInstruction<0> { | 1499 class HDeoptimize: public HTemplateInstruction<0> { |
1500 public: | 1500 public: |
1501 explicit HDeoptimize(Deoptimizer::BailoutType type) : type_(type) {} | |
1502 | |
1501 virtual Representation RequiredInputRepresentation(int index) { | 1503 virtual Representation RequiredInputRepresentation(int index) { |
1502 return Representation::None(); | 1504 return Representation::None(); |
1503 } | 1505 } |
1504 | 1506 |
1505 DECLARE_CONCRETE_INSTRUCTION(SoftDeoptimize) | 1507 Deoptimizer::BailoutType type() { return type_; } |
1508 | |
1509 DECLARE_CONCRETE_INSTRUCTION(Deoptimize) | |
1510 | |
1511 private: | |
1512 Deoptimizer::BailoutType type_; | |
1506 }; | 1513 }; |
1507 | 1514 |
1508 | 1515 |
1509 // Inserts an int3/stop break instruction for debugging purposes. | 1516 // Inserts an int3/stop break instruction for debugging purposes. |
1510 class HDebugBreak: public HTemplateInstruction<0> { | 1517 class HDebugBreak: public HTemplateInstruction<0> { |
1511 public: | 1518 public: |
1512 virtual Representation RequiredInputRepresentation(int index) { | 1519 virtual Representation RequiredInputRepresentation(int index) { |
1513 return Representation::None(); | 1520 return Representation::None(); |
1514 } | 1521 } |
1515 | 1522 |
1516 DECLARE_CONCRETE_INSTRUCTION(DebugBreak) | 1523 DECLARE_CONCRETE_INSTRUCTION(DebugBreak) |
1517 }; | 1524 }; |
1518 | 1525 |
1519 | 1526 |
1520 class HDeoptimize: public HControlInstruction { | |
1521 public: | |
1522 HDeoptimize(int environment_length, | |
1523 int first_local_index, | |
1524 int first_expression_index, | |
1525 Zone* zone) | |
1526 : values_(environment_length, zone), | |
1527 first_local_index_(first_local_index), | |
1528 first_expression_index_(first_expression_index) { } | |
1529 | |
1530 virtual Representation RequiredInputRepresentation(int index) { | |
1531 return Representation::None(); | |
1532 } | |
1533 | |
1534 virtual int OperandCount() { return values_.length(); } | |
1535 virtual HValue* OperandAt(int index) const { return values_[index]; } | |
1536 virtual void PrintDataTo(StringStream* stream); | |
1537 | |
1538 virtual int SuccessorCount() { return 0; } | |
1539 virtual HBasicBlock* SuccessorAt(int i) { | |
1540 UNREACHABLE(); | |
1541 return NULL; | |
1542 } | |
1543 virtual void SetSuccessorAt(int i, HBasicBlock* block) { | |
1544 UNREACHABLE(); | |
1545 } | |
1546 | |
1547 void AddEnvironmentValue(HValue* value, Zone* zone) { | |
1548 values_.Add(NULL, zone); | |
1549 SetOperandAt(values_.length() - 1, value); | |
1550 } | |
1551 int first_local_index() { return first_local_index_; } | |
1552 int first_expression_index() { return first_expression_index_; } | |
1553 | |
1554 DECLARE_CONCRETE_INSTRUCTION(Deoptimize) | |
1555 | |
1556 enum UseEnvironment { | |
1557 kNoUses, | |
1558 kUseAll | |
1559 }; | |
1560 | |
1561 protected: | |
1562 virtual void InternalSetOperandAt(int index, HValue* value) { | |
1563 values_[index] = value; | |
1564 } | |
1565 | |
1566 private: | |
1567 ZoneList<HValue*> values_; | |
1568 int first_local_index_; | |
1569 int first_expression_index_; | |
1570 }; | |
1571 | |
1572 | |
1573 class HGoto: public HTemplateControlInstruction<1, 0> { | 1527 class HGoto: public HTemplateControlInstruction<1, 0> { |
1574 public: | 1528 public: |
1575 explicit HGoto(HBasicBlock* target) { | 1529 explicit HGoto(HBasicBlock* target) { |
1576 SetSuccessorAt(0, target); | 1530 SetSuccessorAt(0, target); |
1577 } | 1531 } |
1578 | 1532 |
1579 virtual Representation RequiredInputRepresentation(int index) { | 1533 virtual Representation RequiredInputRepresentation(int index) { |
1580 return Representation::None(); | 1534 return Representation::None(); |
1581 } | 1535 } |
1582 | 1536 |
(...skipping 5098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6681 virtual bool IsDeletable() const { return true; } | 6635 virtual bool IsDeletable() const { return true; } |
6682 }; | 6636 }; |
6683 | 6637 |
6684 | 6638 |
6685 #undef DECLARE_INSTRUCTION | 6639 #undef DECLARE_INSTRUCTION |
6686 #undef DECLARE_CONCRETE_INSTRUCTION | 6640 #undef DECLARE_CONCRETE_INSTRUCTION |
6687 | 6641 |
6688 } } // namespace v8::internal | 6642 } } // namespace v8::internal |
6689 | 6643 |
6690 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6644 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |