OLD | NEW |
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 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
| 8 #include <iosfwd> |
| 9 |
8 #include "src/v8.h" | 10 #include "src/v8.h" |
9 | 11 |
10 #include "src/allocation.h" | 12 #include "src/allocation.h" |
11 #include "src/base/bits.h" | 13 #include "src/base/bits.h" |
12 #include "src/code-stubs.h" | 14 #include "src/code-stubs.h" |
13 #include "src/conversions.h" | 15 #include "src/conversions.h" |
14 #include "src/data-flow.h" | 16 #include "src/data-flow.h" |
15 #include "src/deoptimizer.h" | 17 #include "src/deoptimizer.h" |
16 #include "src/feedback-slots.h" | 18 #include "src/feedback-slots.h" |
17 #include "src/hydrogen-types.h" | 19 #include "src/hydrogen-types.h" |
(...skipping 10 matching lines...) Expand all Loading... |
28 class HBasicBlock; | 30 class HBasicBlock; |
29 class HDiv; | 31 class HDiv; |
30 class HEnvironment; | 32 class HEnvironment; |
31 class HInferRepresentationPhase; | 33 class HInferRepresentationPhase; |
32 class HInstruction; | 34 class HInstruction; |
33 class HLoopInformation; | 35 class HLoopInformation; |
34 class HStoreNamedField; | 36 class HStoreNamedField; |
35 class HValue; | 37 class HValue; |
36 class LInstruction; | 38 class LInstruction; |
37 class LChunkBuilder; | 39 class LChunkBuilder; |
38 class OStream; | |
39 | 40 |
40 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ | 41 #define HYDROGEN_ABSTRACT_INSTRUCTION_LIST(V) \ |
41 V(ArithmeticBinaryOperation) \ | 42 V(ArithmeticBinaryOperation) \ |
42 V(BinaryOperation) \ | 43 V(BinaryOperation) \ |
43 V(BitwiseBinaryOperation) \ | 44 V(BitwiseBinaryOperation) \ |
44 V(ControlInstruction) \ | 45 V(ControlInstruction) \ |
45 V(Instruction) | 46 V(Instruction) |
46 | 47 |
47 | 48 |
48 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ | 49 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 friend class HPositionInfo; | 461 friend class HPositionInfo; |
461 friend class LCodeGenBase; | 462 friend class LCodeGenBase; |
462 | 463 |
463 // If FLAG_hydrogen_track_positions is set contains bitfields InliningIdField | 464 // If FLAG_hydrogen_track_positions is set contains bitfields InliningIdField |
464 // and PositionField. | 465 // and PositionField. |
465 // Otherwise contains absolute offset from the script start. | 466 // Otherwise contains absolute offset from the script start. |
466 int value_; | 467 int value_; |
467 }; | 468 }; |
468 | 469 |
469 | 470 |
470 OStream& operator<<(OStream& os, const HSourcePosition& p); | 471 std::ostream& operator<<(std::ostream& os, const HSourcePosition& p); |
471 | 472 |
472 | 473 |
473 class HValue : public ZoneObject { | 474 class HValue : public ZoneObject { |
474 public: | 475 public: |
475 static const int kNoNumber = -1; | 476 static const int kNoNumber = -1; |
476 | 477 |
477 enum Flag { | 478 enum Flag { |
478 kFlexibleRepresentation, | 479 kFlexibleRepresentation, |
479 kCannotBeTagged, | 480 kCannotBeTagged, |
480 // Participate in Global Value Numbering, i.e. elimination of | 481 // Participate in Global Value Numbering, i.e. elimination of |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 // then return it. Return NULL to have the instruction deleted. | 764 // then return it. Return NULL to have the instruction deleted. |
764 virtual HValue* Canonicalize() { return this; } | 765 virtual HValue* Canonicalize() { return this; } |
765 | 766 |
766 bool Equals(HValue* other); | 767 bool Equals(HValue* other); |
767 virtual intptr_t Hashcode(); | 768 virtual intptr_t Hashcode(); |
768 | 769 |
769 // Compute unique ids upfront that is safe wrt GC and concurrent compilation. | 770 // Compute unique ids upfront that is safe wrt GC and concurrent compilation. |
770 virtual void FinalizeUniqueness() { } | 771 virtual void FinalizeUniqueness() { } |
771 | 772 |
772 // Printing support. | 773 // Printing support. |
773 virtual OStream& PrintTo(OStream& os) const = 0; // NOLINT | 774 virtual std::ostream& PrintTo(std::ostream& os) const = 0; // NOLINT |
774 | 775 |
775 const char* Mnemonic() const; | 776 const char* Mnemonic() const; |
776 | 777 |
777 // Type information helpers. | 778 // Type information helpers. |
778 bool HasMonomorphicJSObjectType(); | 779 bool HasMonomorphicJSObjectType(); |
779 | 780 |
780 // TODO(mstarzinger): For now instructions can override this function to | 781 // TODO(mstarzinger): For now instructions can override this function to |
781 // specify statically known types, once HType can convey more information | 782 // specify statically known types, once HType can convey more information |
782 // it should be based on the HType. | 783 // it should be based on the HType. |
783 virtual Handle<Map> GetMonomorphicJSObjectMap() { return Handle<Map>(); } | 784 virtual Handle<Map> GetMonomorphicJSObjectMap() { return Handle<Map>(); } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 #undef ADD_FLAG | 881 #undef ADD_FLAG |
881 return result; | 882 return result; |
882 } | 883 } |
883 | 884 |
884 // A flag mask to mark an instruction as having arbitrary side effects. | 885 // A flag mask to mark an instruction as having arbitrary side effects. |
885 static GVNFlagSet AllSideEffectsFlagSet() { | 886 static GVNFlagSet AllSideEffectsFlagSet() { |
886 GVNFlagSet result = AllFlagSet(); | 887 GVNFlagSet result = AllFlagSet(); |
887 result.Remove(kOsrEntries); | 888 result.Remove(kOsrEntries); |
888 return result; | 889 return result; |
889 } | 890 } |
890 friend OStream& operator<<(OStream& os, const ChangesOf& v); | 891 friend std::ostream& operator<<(std::ostream& os, const ChangesOf& v); |
891 | 892 |
892 // A flag mask of all side effects that can make observable changes in | 893 // A flag mask of all side effects that can make observable changes in |
893 // an executing program (i.e. are not safe to repeat, move or remove); | 894 // an executing program (i.e. are not safe to repeat, move or remove); |
894 static GVNFlagSet AllObservableSideEffectsFlagSet() { | 895 static GVNFlagSet AllObservableSideEffectsFlagSet() { |
895 GVNFlagSet result = AllFlagSet(); | 896 GVNFlagSet result = AllFlagSet(); |
896 result.Remove(kNewSpacePromotion); | 897 result.Remove(kNewSpacePromotion); |
897 result.Remove(kElementsKind); | 898 result.Remove(kElementsKind); |
898 result.Remove(kElementsPointer); | 899 result.Remove(kElementsPointer); |
899 result.Remove(kMaps); | 900 result.Remove(kMaps); |
900 return result; | 901 return result; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 const HValue* value; | 942 const HValue* value; |
942 }; | 943 }; |
943 | 944 |
944 | 945 |
945 struct ChangesOf { | 946 struct ChangesOf { |
946 explicit ChangesOf(const HValue* const v) : value(v) {} | 947 explicit ChangesOf(const HValue* const v) : value(v) {} |
947 const HValue* value; | 948 const HValue* value; |
948 }; | 949 }; |
949 | 950 |
950 | 951 |
951 OStream& operator<<(OStream& os, const HValue& v); | 952 std::ostream& operator<<(std::ostream& os, const HValue& v); |
952 OStream& operator<<(OStream& os, const NameOf& v); | 953 std::ostream& operator<<(std::ostream& os, const NameOf& v); |
953 OStream& operator<<(OStream& os, const TypeOf& v); | 954 std::ostream& operator<<(std::ostream& os, const TypeOf& v); |
954 OStream& operator<<(OStream& os, const ChangesOf& v); | 955 std::ostream& operator<<(std::ostream& os, const ChangesOf& v); |
955 | 956 |
956 | 957 |
957 #define DECLARE_INSTRUCTION_FACTORY_P0(I) \ | 958 #define DECLARE_INSTRUCTION_FACTORY_P0(I) \ |
958 static I* New(Zone* zone, HValue* context) { \ | 959 static I* New(Zone* zone, HValue* context) { \ |
959 return new(zone) I(); \ | 960 return new(zone) I(); \ |
960 } | 961 } |
961 | 962 |
962 #define DECLARE_INSTRUCTION_FACTORY_P1(I, P1) \ | 963 #define DECLARE_INSTRUCTION_FACTORY_P1(I, P1) \ |
963 static I* New(Zone* zone, HValue* context, P1 p1) { \ | 964 static I* New(Zone* zone, HValue* context, P1 p1) { \ |
964 return new(zone) I(p1); \ | 965 return new(zone) I(p1); \ |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 | 1141 |
1141 intptr_t data_; | 1142 intptr_t data_; |
1142 }; | 1143 }; |
1143 | 1144 |
1144 | 1145 |
1145 class HInstruction : public HValue { | 1146 class HInstruction : public HValue { |
1146 public: | 1147 public: |
1147 HInstruction* next() const { return next_; } | 1148 HInstruction* next() const { return next_; } |
1148 HInstruction* previous() const { return previous_; } | 1149 HInstruction* previous() const { return previous_; } |
1149 | 1150 |
1150 virtual OStream& PrintTo(OStream& os) const OVERRIDE; // NOLINT | 1151 virtual std::ostream& PrintTo(std::ostream& os) const OVERRIDE; // NOLINT |
1151 virtual OStream& PrintDataTo(OStream& os) const; // NOLINT | 1152 virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT |
1152 | 1153 |
1153 bool IsLinked() const { return block() != NULL; } | 1154 bool IsLinked() const { return block() != NULL; } |
1154 void Unlink(); | 1155 void Unlink(); |
1155 | 1156 |
1156 void InsertBefore(HInstruction* next); | 1157 void InsertBefore(HInstruction* next); |
1157 | 1158 |
1158 template<class T> T* Prepend(T* instr) { | 1159 template<class T> T* Prepend(T* instr) { |
1159 instr->InsertBefore(this); | 1160 instr->InsertBefore(this); |
1160 return instr; | 1161 return instr; |
1161 } | 1162 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 EmbeddedContainer<HValue*, V> inputs_; | 1252 EmbeddedContainer<HValue*, V> inputs_; |
1252 }; | 1253 }; |
1253 | 1254 |
1254 | 1255 |
1255 class HControlInstruction : public HInstruction { | 1256 class HControlInstruction : public HInstruction { |
1256 public: | 1257 public: |
1257 virtual HBasicBlock* SuccessorAt(int i) const = 0; | 1258 virtual HBasicBlock* SuccessorAt(int i) const = 0; |
1258 virtual int SuccessorCount() const = 0; | 1259 virtual int SuccessorCount() const = 0; |
1259 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0; | 1260 virtual void SetSuccessorAt(int i, HBasicBlock* block) = 0; |
1260 | 1261 |
1261 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1262 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1262 | 1263 |
1263 virtual bool KnownSuccessorBlock(HBasicBlock** block) { | 1264 virtual bool KnownSuccessorBlock(HBasicBlock** block) { |
1264 *block = NULL; | 1265 *block = NULL; |
1265 return false; | 1266 return false; |
1266 } | 1267 } |
1267 | 1268 |
1268 HBasicBlock* FirstSuccessor() { | 1269 HBasicBlock* FirstSuccessor() { |
1269 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL; | 1270 return SuccessorCount() > 0 ? SuccessorAt(0) : NULL; |
1270 } | 1271 } |
1271 HBasicBlock* SecondSuccessor() { | 1272 HBasicBlock* SecondSuccessor() { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 set_representation(Representation::Tagged()); | 1342 set_representation(Representation::Tagged()); |
1342 } | 1343 } |
1343 | 1344 |
1344 HValue* value() const { return OperandAt(0); } | 1345 HValue* value() const { return OperandAt(0); } |
1345 | 1346 |
1346 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } | 1347 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } |
1347 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1348 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1348 return Representation::None(); | 1349 return Representation::None(); |
1349 } | 1350 } |
1350 | 1351 |
1351 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1352 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1352 | 1353 |
1353 DECLARE_CONCRETE_INSTRUCTION(DummyUse); | 1354 DECLARE_CONCRETE_INSTRUCTION(DummyUse); |
1354 }; | 1355 }; |
1355 | 1356 |
1356 | 1357 |
1357 // Inserts an int3/stop break instruction for debugging purposes. | 1358 // Inserts an int3/stop break instruction for debugging purposes. |
1358 class HDebugBreak FINAL : public HTemplateInstruction<0> { | 1359 class HDebugBreak FINAL : public HTemplateInstruction<0> { |
1359 public: | 1360 public: |
1360 DECLARE_INSTRUCTION_FACTORY_P0(HDebugBreak); | 1361 DECLARE_INSTRUCTION_FACTORY_P0(HDebugBreak); |
1361 | 1362 |
(...skipping 13 matching lines...) Expand all Loading... |
1375 | 1376 |
1376 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { | 1377 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { |
1377 *block = FirstSuccessor(); | 1378 *block = FirstSuccessor(); |
1378 return true; | 1379 return true; |
1379 } | 1380 } |
1380 | 1381 |
1381 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1382 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1382 return Representation::None(); | 1383 return Representation::None(); |
1383 } | 1384 } |
1384 | 1385 |
1385 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1386 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1386 | 1387 |
1387 DECLARE_CONCRETE_INSTRUCTION(Goto) | 1388 DECLARE_CONCRETE_INSTRUCTION(Goto) |
1388 }; | 1389 }; |
1389 | 1390 |
1390 | 1391 |
1391 class HDeoptimize FINAL : public HTemplateControlInstruction<1, 0> { | 1392 class HDeoptimize FINAL : public HTemplateControlInstruction<1, 0> { |
1392 public: | 1393 public: |
1393 static HDeoptimize* New(Zone* zone, | 1394 static HDeoptimize* New(Zone* zone, |
1394 HValue* context, | 1395 HValue* context, |
1395 const char* reason, | 1396 const char* reason, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 class HUnaryControlInstruction : public HTemplateControlInstruction<2, 1> { | 1429 class HUnaryControlInstruction : public HTemplateControlInstruction<2, 1> { |
1429 public: | 1430 public: |
1430 HUnaryControlInstruction(HValue* value, | 1431 HUnaryControlInstruction(HValue* value, |
1431 HBasicBlock* true_target, | 1432 HBasicBlock* true_target, |
1432 HBasicBlock* false_target) { | 1433 HBasicBlock* false_target) { |
1433 SetOperandAt(0, value); | 1434 SetOperandAt(0, value); |
1434 SetSuccessorAt(0, true_target); | 1435 SetSuccessorAt(0, true_target); |
1435 SetSuccessorAt(1, false_target); | 1436 SetSuccessorAt(1, false_target); |
1436 } | 1437 } |
1437 | 1438 |
1438 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1439 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1439 | 1440 |
1440 HValue* value() const { return OperandAt(0); } | 1441 HValue* value() const { return OperandAt(0); } |
1441 }; | 1442 }; |
1442 | 1443 |
1443 | 1444 |
1444 class HBranch FINAL : public HUnaryControlInstruction { | 1445 class HBranch FINAL : public HUnaryControlInstruction { |
1445 public: | 1446 public: |
1446 DECLARE_INSTRUCTION_FACTORY_P1(HBranch, HValue*); | 1447 DECLARE_INSTRUCTION_FACTORY_P1(HBranch, HValue*); |
1447 DECLARE_INSTRUCTION_FACTORY_P2(HBranch, HValue*, | 1448 DECLARE_INSTRUCTION_FACTORY_P2(HBranch, HValue*, |
1448 ToBooleanStub::Types); | 1449 ToBooleanStub::Types); |
1449 DECLARE_INSTRUCTION_FACTORY_P4(HBranch, HValue*, | 1450 DECLARE_INSTRUCTION_FACTORY_P4(HBranch, HValue*, |
1450 ToBooleanStub::Types, | 1451 ToBooleanStub::Types, |
1451 HBasicBlock*, HBasicBlock*); | 1452 HBasicBlock*, HBasicBlock*); |
1452 | 1453 |
1453 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1454 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1454 return Representation::None(); | 1455 return Representation::None(); |
1455 } | 1456 } |
1456 virtual Representation observed_input_representation(int index) OVERRIDE; | 1457 virtual Representation observed_input_representation(int index) OVERRIDE; |
1457 | 1458 |
1458 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; | 1459 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; |
1459 | 1460 |
1460 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1461 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1461 | 1462 |
1462 ToBooleanStub::Types expected_input_types() const { | 1463 ToBooleanStub::Types expected_input_types() const { |
1463 return expected_input_types_; | 1464 return expected_input_types_; |
1464 } | 1465 } |
1465 | 1466 |
1466 DECLARE_CONCRETE_INSTRUCTION(Branch) | 1467 DECLARE_CONCRETE_INSTRUCTION(Branch) |
1467 | 1468 |
1468 private: | 1469 private: |
1469 HBranch(HValue* value, | 1470 HBranch(HValue* value, |
1470 ToBooleanStub::Types expected_input_types = ToBooleanStub::Types(), | 1471 ToBooleanStub::Types expected_input_types = ToBooleanStub::Types(), |
(...skipping 16 matching lines...) Expand all Loading... |
1487 | 1488 |
1488 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { | 1489 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE { |
1489 if (known_successor_index() != kNoKnownSuccessorIndex) { | 1490 if (known_successor_index() != kNoKnownSuccessorIndex) { |
1490 *block = SuccessorAt(known_successor_index()); | 1491 *block = SuccessorAt(known_successor_index()); |
1491 return true; | 1492 return true; |
1492 } | 1493 } |
1493 *block = NULL; | 1494 *block = NULL; |
1494 return false; | 1495 return false; |
1495 } | 1496 } |
1496 | 1497 |
1497 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1498 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1498 | 1499 |
1499 static const int kNoKnownSuccessorIndex = -1; | 1500 static const int kNoKnownSuccessorIndex = -1; |
1500 int known_successor_index() const { return known_successor_index_; } | 1501 int known_successor_index() const { return known_successor_index_; } |
1501 void set_known_successor_index(int known_successor_index) { | 1502 void set_known_successor_index(int known_successor_index) { |
1502 known_successor_index_ = known_successor_index; | 1503 known_successor_index_ = known_successor_index; |
1503 } | 1504 } |
1504 | 1505 |
1505 Unique<Map> map() const { return map_; } | 1506 Unique<Map> map() const { return map_; } |
1506 bool map_is_stable() const { return map_is_stable_; } | 1507 bool map_is_stable() const { return map_is_stable_; } |
1507 | 1508 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 public: | 1562 public: |
1562 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HReturn, HValue*, HValue*); | 1563 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HReturn, HValue*, HValue*); |
1563 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HReturn, HValue*); | 1564 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HReturn, HValue*); |
1564 | 1565 |
1565 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1566 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1566 // TODO(titzer): require an Int32 input for faster returns. | 1567 // TODO(titzer): require an Int32 input for faster returns. |
1567 if (index == 2) return Representation::Smi(); | 1568 if (index == 2) return Representation::Smi(); |
1568 return Representation::Tagged(); | 1569 return Representation::Tagged(); |
1569 } | 1570 } |
1570 | 1571 |
1571 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1572 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1572 | 1573 |
1573 HValue* value() const { return OperandAt(0); } | 1574 HValue* value() const { return OperandAt(0); } |
1574 HValue* context() const { return OperandAt(1); } | 1575 HValue* context() const { return OperandAt(1); } |
1575 HValue* parameter_count() const { return OperandAt(2); } | 1576 HValue* parameter_count() const { return OperandAt(2); } |
1576 | 1577 |
1577 DECLARE_CONCRETE_INSTRUCTION(Return) | 1578 DECLARE_CONCRETE_INSTRUCTION(Return) |
1578 | 1579 |
1579 private: | 1580 private: |
1580 HReturn(HValue* context, HValue* value, HValue* parameter_count = 0) { | 1581 HReturn(HValue* context, HValue* value, HValue* parameter_count = 0) { |
1581 SetOperandAt(0, value); | 1582 SetOperandAt(0, value); |
(...skipping 22 matching lines...) Expand all Loading... |
1604 explicit HUnaryOperation(HValue* value, HType type = HType::Tagged()) | 1605 explicit HUnaryOperation(HValue* value, HType type = HType::Tagged()) |
1605 : HTemplateInstruction<1>(type) { | 1606 : HTemplateInstruction<1>(type) { |
1606 SetOperandAt(0, value); | 1607 SetOperandAt(0, value); |
1607 } | 1608 } |
1608 | 1609 |
1609 static HUnaryOperation* cast(HValue* value) { | 1610 static HUnaryOperation* cast(HValue* value) { |
1610 return reinterpret_cast<HUnaryOperation*>(value); | 1611 return reinterpret_cast<HUnaryOperation*>(value); |
1611 } | 1612 } |
1612 | 1613 |
1613 HValue* value() const { return OperandAt(0); } | 1614 HValue* value() const { return OperandAt(0); } |
1614 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1615 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1615 }; | 1616 }; |
1616 | 1617 |
1617 | 1618 |
1618 class HUseConst FINAL : public HUnaryOperation { | 1619 class HUseConst FINAL : public HUnaryOperation { |
1619 public: | 1620 public: |
1620 DECLARE_INSTRUCTION_FACTORY_P1(HUseConst, HValue*); | 1621 DECLARE_INSTRUCTION_FACTORY_P1(HUseConst, HValue*); |
1621 | 1622 |
1622 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1623 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1623 return Representation::None(); | 1624 return Representation::None(); |
1624 } | 1625 } |
1625 | 1626 |
1626 DECLARE_CONCRETE_INSTRUCTION(UseConst) | 1627 DECLARE_CONCRETE_INSTRUCTION(UseConst) |
1627 | 1628 |
1628 private: | 1629 private: |
1629 explicit HUseConst(HValue* old_value) : HUnaryOperation(old_value) { } | 1630 explicit HUseConst(HValue* old_value) : HUnaryOperation(old_value) { } |
1630 }; | 1631 }; |
1631 | 1632 |
1632 | 1633 |
1633 class HForceRepresentation FINAL : public HTemplateInstruction<1> { | 1634 class HForceRepresentation FINAL : public HTemplateInstruction<1> { |
1634 public: | 1635 public: |
1635 static HInstruction* New(Zone* zone, HValue* context, HValue* value, | 1636 static HInstruction* New(Zone* zone, HValue* context, HValue* value, |
1636 Representation required_representation); | 1637 Representation required_representation); |
1637 | 1638 |
1638 HValue* value() const { return OperandAt(0); } | 1639 HValue* value() const { return OperandAt(0); } |
1639 | 1640 |
1640 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1641 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1641 return representation(); // Same as the output representation. | 1642 return representation(); // Same as the output representation. |
1642 } | 1643 } |
1643 | 1644 |
1644 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1645 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1645 | 1646 |
1646 DECLARE_CONCRETE_INSTRUCTION(ForceRepresentation) | 1647 DECLARE_CONCRETE_INSTRUCTION(ForceRepresentation) |
1647 | 1648 |
1648 private: | 1649 private: |
1649 HForceRepresentation(HValue* value, Representation required_representation) { | 1650 HForceRepresentation(HValue* value, Representation required_representation) { |
1650 SetOperandAt(0, value); | 1651 SetOperandAt(0, value); |
1651 set_representation(required_representation); | 1652 set_representation(required_representation); |
1652 } | 1653 } |
1653 }; | 1654 }; |
1654 | 1655 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 Representation to() const { return representation(); } | 1691 Representation to() const { return representation(); } |
1691 bool deoptimize_on_minus_zero() const { | 1692 bool deoptimize_on_minus_zero() const { |
1692 return CheckFlag(kBailoutOnMinusZero); | 1693 return CheckFlag(kBailoutOnMinusZero); |
1693 } | 1694 } |
1694 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1695 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1695 return from(); | 1696 return from(); |
1696 } | 1697 } |
1697 | 1698 |
1698 virtual Range* InferRange(Zone* zone) OVERRIDE; | 1699 virtual Range* InferRange(Zone* zone) OVERRIDE; |
1699 | 1700 |
1700 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1701 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1701 | 1702 |
1702 DECLARE_CONCRETE_INSTRUCTION(Change) | 1703 DECLARE_CONCRETE_INSTRUCTION(Change) |
1703 | 1704 |
1704 protected: | 1705 protected: |
1705 virtual bool DataEquals(HValue* other) OVERRIDE { return true; } | 1706 virtual bool DataEquals(HValue* other) OVERRIDE { return true; } |
1706 | 1707 |
1707 private: | 1708 private: |
1708 virtual bool IsDeletable() const OVERRIDE { | 1709 virtual bool IsDeletable() const OVERRIDE { |
1709 return !from().IsTagged() || value()->type().IsSmi(); | 1710 return !from().IsTagged() || value()->type().IsSmi(); |
1710 } | 1711 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1809 RemovableSimulate removable) | 1810 RemovableSimulate removable) |
1810 : ast_id_(ast_id), | 1811 : ast_id_(ast_id), |
1811 pop_count_(pop_count), | 1812 pop_count_(pop_count), |
1812 values_(2, zone), | 1813 values_(2, zone), |
1813 assigned_indexes_(2, zone), | 1814 assigned_indexes_(2, zone), |
1814 zone_(zone), | 1815 zone_(zone), |
1815 removable_(removable), | 1816 removable_(removable), |
1816 done_with_replay_(false) {} | 1817 done_with_replay_(false) {} |
1817 ~HSimulate() {} | 1818 ~HSimulate() {} |
1818 | 1819 |
1819 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1820 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1820 | 1821 |
1821 bool HasAstId() const { return !ast_id_.IsNone(); } | 1822 bool HasAstId() const { return !ast_id_.IsNone(); } |
1822 BailoutId ast_id() const { return ast_id_; } | 1823 BailoutId ast_id() const { return ast_id_; } |
1823 void set_ast_id(BailoutId id) { | 1824 void set_ast_id(BailoutId id) { |
1824 DCHECK(!HasAstId()); | 1825 DCHECK(!HasAstId()); |
1825 ast_id_ = id; | 1826 ast_id_ = id; |
1826 } | 1827 } |
1827 | 1828 |
1828 int pop_count() const { return pop_count_; } | 1829 int pop_count() const { return pop_count_; } |
1829 const ZoneList<HValue*>* values() const { return &values_; } | 1830 const ZoneList<HValue*>* values() const { return &values_; } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 int index() const { return index_; } | 1916 int index() const { return index_; } |
1916 HSimulate* next_simulate() { return next_simulate_; } | 1917 HSimulate* next_simulate() { return next_simulate_; } |
1917 void set_next_simulate(HSimulate* simulate) { | 1918 void set_next_simulate(HSimulate* simulate) { |
1918 next_simulate_ = simulate; | 1919 next_simulate_ = simulate; |
1919 } | 1920 } |
1920 | 1921 |
1921 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 1922 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
1922 return Representation::None(); | 1923 return Representation::None(); |
1923 } | 1924 } |
1924 | 1925 |
1925 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 1926 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
1926 | 1927 |
1927 #ifdef DEBUG | 1928 #ifdef DEBUG |
1928 void set_closure(Handle<JSFunction> closure) { | 1929 void set_closure(Handle<JSFunction> closure) { |
1929 DCHECK(closure_.is_null()); | 1930 DCHECK(closure_.is_null()); |
1930 DCHECK(!closure.is_null()); | 1931 DCHECK(!closure.is_null()); |
1931 closure_ = closure; | 1932 closure_ = closure; |
1932 } | 1933 } |
1933 Handle<JSFunction> closure() const { return closure_; } | 1934 Handle<JSFunction> closure() const { return closure_; } |
1934 #endif | 1935 #endif |
1935 | 1936 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 InliningKind inlining_kind, Variable* arguments_var, | 2009 InliningKind inlining_kind, Variable* arguments_var, |
2009 HArgumentsObject* arguments_object) { | 2010 HArgumentsObject* arguments_object) { |
2010 return new (zone) HEnterInlined(return_id, closure, closure_context, | 2011 return new (zone) HEnterInlined(return_id, closure, closure_context, |
2011 arguments_count, function, inlining_kind, | 2012 arguments_count, function, inlining_kind, |
2012 arguments_var, arguments_object, zone); | 2013 arguments_var, arguments_object, zone); |
2013 } | 2014 } |
2014 | 2015 |
2015 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); | 2016 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); |
2016 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; } | 2017 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; } |
2017 | 2018 |
2018 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2019 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2019 | 2020 |
2020 Handle<JSFunction> closure() const { return closure_; } | 2021 Handle<JSFunction> closure() const { return closure_; } |
2021 HConstant* closure_context() const { return closure_context_; } | 2022 HConstant* closure_context() const { return closure_context_; } |
2022 int arguments_count() const { return arguments_count_; } | 2023 int arguments_count() const { return arguments_count_; } |
2023 bool arguments_pushed() const { return arguments_pushed_; } | 2024 bool arguments_pushed() const { return arguments_pushed_; } |
2024 void set_arguments_pushed() { arguments_pushed_ = true; } | 2025 void set_arguments_pushed() { arguments_pushed_ = true; } |
2025 FunctionLiteral* function() const { return function_; } | 2026 FunctionLiteral* function() const { return function_; } |
2026 InliningKind inlining_kind() const { return inlining_kind_; } | 2027 InliningKind inlining_kind() const { return inlining_kind_; } |
2027 BailoutId ReturnId() const { return return_id_; } | 2028 BailoutId ReturnId() const { return return_id_; } |
2028 | 2029 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 HUnaryCall(HValue* value, int argument_count) | 2243 HUnaryCall(HValue* value, int argument_count) |
2243 : HCall<1>(argument_count) { | 2244 : HCall<1>(argument_count) { |
2244 SetOperandAt(0, value); | 2245 SetOperandAt(0, value); |
2245 } | 2246 } |
2246 | 2247 |
2247 virtual Representation RequiredInputRepresentation( | 2248 virtual Representation RequiredInputRepresentation( |
2248 int index) FINAL OVERRIDE { | 2249 int index) FINAL OVERRIDE { |
2249 return Representation::Tagged(); | 2250 return Representation::Tagged(); |
2250 } | 2251 } |
2251 | 2252 |
2252 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2253 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2253 | 2254 |
2254 HValue* value() const { return OperandAt(0); } | 2255 HValue* value() const { return OperandAt(0); } |
2255 }; | 2256 }; |
2256 | 2257 |
2257 | 2258 |
2258 class HBinaryCall : public HCall<2> { | 2259 class HBinaryCall : public HCall<2> { |
2259 public: | 2260 public: |
2260 HBinaryCall(HValue* first, HValue* second, int argument_count) | 2261 HBinaryCall(HValue* first, HValue* second, int argument_count) |
2261 : HCall<2>(argument_count) { | 2262 : HCall<2>(argument_count) { |
2262 SetOperandAt(0, first); | 2263 SetOperandAt(0, first); |
2263 SetOperandAt(1, second); | 2264 SetOperandAt(1, second); |
2264 } | 2265 } |
2265 | 2266 |
2266 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2267 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2267 | 2268 |
2268 virtual Representation RequiredInputRepresentation( | 2269 virtual Representation RequiredInputRepresentation( |
2269 int index) FINAL OVERRIDE { | 2270 int index) FINAL OVERRIDE { |
2270 return Representation::Tagged(); | 2271 return Representation::Tagged(); |
2271 } | 2272 } |
2272 | 2273 |
2273 HValue* first() const { return OperandAt(0); } | 2274 HValue* first() const { return OperandAt(0); } |
2274 HValue* second() const { return OperandAt(1); } | 2275 HValue* second() const { return OperandAt(1); } |
2275 }; | 2276 }; |
2276 | 2277 |
2277 | 2278 |
2278 class HCallJSFunction FINAL : public HCall<1> { | 2279 class HCallJSFunction FINAL : public HCall<1> { |
2279 public: | 2280 public: |
2280 static HCallJSFunction* New(Zone* zone, | 2281 static HCallJSFunction* New(Zone* zone, |
2281 HValue* context, | 2282 HValue* context, |
2282 HValue* function, | 2283 HValue* function, |
2283 int argument_count, | 2284 int argument_count, |
2284 bool pass_argument_count); | 2285 bool pass_argument_count); |
2285 | 2286 |
2286 HValue* function() const { return OperandAt(0); } | 2287 HValue* function() const { return OperandAt(0); } |
2287 | 2288 |
2288 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2289 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2289 | 2290 |
2290 virtual Representation RequiredInputRepresentation( | 2291 virtual Representation RequiredInputRepresentation( |
2291 int index) FINAL OVERRIDE { | 2292 int index) FINAL OVERRIDE { |
2292 DCHECK(index == 0); | 2293 DCHECK(index == 0); |
2293 return Representation::Tagged(); | 2294 return Representation::Tagged(); |
2294 } | 2295 } |
2295 | 2296 |
2296 bool pass_argument_count() const { return pass_argument_count_; } | 2297 bool pass_argument_count() const { return pass_argument_count_; } |
2297 | 2298 |
2298 virtual bool HasStackCheck() FINAL OVERRIDE { | 2299 virtual bool HasStackCheck() FINAL OVERRIDE { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 virtual int argument_delta() const OVERRIDE { | 2362 virtual int argument_delta() const OVERRIDE { |
2362 return -argument_count_; | 2363 return -argument_count_; |
2363 } | 2364 } |
2364 | 2365 |
2365 CallInterfaceDescriptor descriptor() const { return descriptor_; } | 2366 CallInterfaceDescriptor descriptor() const { return descriptor_; } |
2366 | 2367 |
2367 HValue* target() { | 2368 HValue* target() { |
2368 return OperandAt(0); | 2369 return OperandAt(0); |
2369 } | 2370 } |
2370 | 2371 |
2371 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2372 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2372 | 2373 |
2373 private: | 2374 private: |
2374 // The argument count includes the receiver. | 2375 // The argument count includes the receiver. |
2375 HCallWithDescriptor(HValue* target, int argument_count, | 2376 HCallWithDescriptor(HValue* target, int argument_count, |
2376 CallInterfaceDescriptor descriptor, | 2377 CallInterfaceDescriptor descriptor, |
2377 const Vector<HValue*>& operands, Zone* zone) | 2378 const Vector<HValue*>& operands, Zone* zone) |
2378 : descriptor_(descriptor), | 2379 : descriptor_(descriptor), |
2379 values_(descriptor.GetEnvironmentLength() + 1, zone) { | 2380 values_(descriptor.GetEnvironmentLength() + 1, zone) { |
2380 argument_count_ = argument_count; | 2381 argument_count_ = argument_count; |
2381 AddOperand(target, zone); | 2382 AddOperand(target, zone); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2494 class HCallNewArray FINAL : public HBinaryCall { | 2495 class HCallNewArray FINAL : public HBinaryCall { |
2495 public: | 2496 public: |
2496 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray, | 2497 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallNewArray, |
2497 HValue*, | 2498 HValue*, |
2498 int, | 2499 int, |
2499 ElementsKind); | 2500 ElementsKind); |
2500 | 2501 |
2501 HValue* context() { return first(); } | 2502 HValue* context() { return first(); } |
2502 HValue* constructor() { return second(); } | 2503 HValue* constructor() { return second(); } |
2503 | 2504 |
2504 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2505 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2505 | 2506 |
2506 ElementsKind elements_kind() const { return elements_kind_; } | 2507 ElementsKind elements_kind() const { return elements_kind_; } |
2507 | 2508 |
2508 DECLARE_CONCRETE_INSTRUCTION(CallNewArray) | 2509 DECLARE_CONCRETE_INSTRUCTION(CallNewArray) |
2509 | 2510 |
2510 private: | 2511 private: |
2511 HCallNewArray(HValue* context, HValue* constructor, int argument_count, | 2512 HCallNewArray(HValue* context, HValue* constructor, int argument_count, |
2512 ElementsKind elements_kind) | 2513 ElementsKind elements_kind) |
2513 : HBinaryCall(context, constructor, argument_count), | 2514 : HBinaryCall(context, constructor, argument_count), |
2514 elements_kind_(elements_kind) {} | 2515 elements_kind_(elements_kind) {} |
2515 | 2516 |
2516 ElementsKind elements_kind_; | 2517 ElementsKind elements_kind_; |
2517 }; | 2518 }; |
2518 | 2519 |
2519 | 2520 |
2520 class HCallRuntime FINAL : public HCall<1> { | 2521 class HCallRuntime FINAL : public HCall<1> { |
2521 public: | 2522 public: |
2522 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallRuntime, | 2523 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallRuntime, |
2523 Handle<String>, | 2524 Handle<String>, |
2524 const Runtime::Function*, | 2525 const Runtime::Function*, |
2525 int); | 2526 int); |
2526 | 2527 |
2527 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2528 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2528 | 2529 |
2529 HValue* context() { return OperandAt(0); } | 2530 HValue* context() { return OperandAt(0); } |
2530 const Runtime::Function* function() const { return c_function_; } | 2531 const Runtime::Function* function() const { return c_function_; } |
2531 Handle<String> name() const { return name_; } | 2532 Handle<String> name() const { return name_; } |
2532 SaveFPRegsMode save_doubles() const { return save_doubles_; } | 2533 SaveFPRegsMode save_doubles() const { return save_doubles_; } |
2533 void set_save_doubles(SaveFPRegsMode save_doubles) { | 2534 void set_save_doubles(SaveFPRegsMode save_doubles) { |
2534 save_doubles_ = save_doubles; | 2535 save_doubles_ = save_doubles; |
2535 } | 2536 } |
2536 | 2537 |
2537 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 2538 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2584 class HUnaryMathOperation FINAL : public HTemplateInstruction<2> { | 2585 class HUnaryMathOperation FINAL : public HTemplateInstruction<2> { |
2585 public: | 2586 public: |
2586 static HInstruction* New(Zone* zone, | 2587 static HInstruction* New(Zone* zone, |
2587 HValue* context, | 2588 HValue* context, |
2588 HValue* value, | 2589 HValue* value, |
2589 BuiltinFunctionId op); | 2590 BuiltinFunctionId op); |
2590 | 2591 |
2591 HValue* context() const { return OperandAt(0); } | 2592 HValue* context() const { return OperandAt(0); } |
2592 HValue* value() const { return OperandAt(1); } | 2593 HValue* value() const { return OperandAt(1); } |
2593 | 2594 |
2594 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2595 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2595 | 2596 |
2596 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 2597 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
2597 if (index == 0) { | 2598 if (index == 0) { |
2598 return Representation::Tagged(); | 2599 return Representation::Tagged(); |
2599 } else { | 2600 } else { |
2600 switch (op_) { | 2601 switch (op_) { |
2601 case kMathFloor: | 2602 case kMathFloor: |
2602 case kMathRound: | 2603 case kMathRound: |
2603 case kMathFround: | 2604 case kMathFround: |
2604 case kMathSqrt: | 2605 case kMathSqrt: |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2754 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } | 2755 virtual bool HasEscapingOperandAt(int index) OVERRIDE { return false; } |
2755 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 2756 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
2756 return Representation::Tagged(); | 2757 return Representation::Tagged(); |
2757 } | 2758 } |
2758 | 2759 |
2759 virtual HType CalculateInferredType() OVERRIDE { | 2760 virtual HType CalculateInferredType() OVERRIDE { |
2760 if (value()->type().IsHeapObject()) return value()->type(); | 2761 if (value()->type().IsHeapObject()) return value()->type(); |
2761 return HType::HeapObject(); | 2762 return HType::HeapObject(); |
2762 } | 2763 } |
2763 | 2764 |
2764 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2765 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2765 | 2766 |
2766 HValue* value() const { return OperandAt(0); } | 2767 HValue* value() const { return OperandAt(0); } |
2767 HValue* typecheck() const { return OperandAt(1); } | 2768 HValue* typecheck() const { return OperandAt(1); } |
2768 | 2769 |
2769 const UniqueSet<Map>* maps() const { return maps_; } | 2770 const UniqueSet<Map>* maps() const { return maps_; } |
2770 void set_maps(const UniqueSet<Map>* maps) { maps_ = maps; } | 2771 void set_maps(const UniqueSet<Map>* maps) { maps_ = maps; } |
2771 | 2772 |
2772 bool maps_are_stable() const { return maps_are_stable_; } | 2773 bool maps_are_stable() const { return maps_are_stable_; } |
2773 | 2774 |
2774 bool HasMigrationTarget() const { return has_migration_target_; } | 2775 bool HasMigrationTarget() const { return has_migration_target_; } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2862 return new(zone) HCheckValue(value, target, object_in_new_space); | 2863 return new(zone) HCheckValue(value, target, object_in_new_space); |
2863 } | 2864 } |
2864 | 2865 |
2865 virtual void FinalizeUniqueness() OVERRIDE { | 2866 virtual void FinalizeUniqueness() OVERRIDE { |
2866 object_ = Unique<HeapObject>(object_.handle()); | 2867 object_ = Unique<HeapObject>(object_.handle()); |
2867 } | 2868 } |
2868 | 2869 |
2869 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 2870 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
2870 return Representation::Tagged(); | 2871 return Representation::Tagged(); |
2871 } | 2872 } |
2872 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2873 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2873 | 2874 |
2874 virtual HValue* Canonicalize() OVERRIDE; | 2875 virtual HValue* Canonicalize() OVERRIDE; |
2875 | 2876 |
2876 #ifdef DEBUG | 2877 #ifdef DEBUG |
2877 virtual void Verify() OVERRIDE; | 2878 virtual void Verify() OVERRIDE; |
2878 #endif | 2879 #endif |
2879 | 2880 |
2880 Unique<HeapObject> object() const { return object_; } | 2881 Unique<HeapObject> object() const { return object_; } |
2881 bool object_in_new_space() const { return object_in_new_space_; } | 2882 bool object_in_new_space() const { return object_in_new_space_; } |
2882 | 2883 |
(...skipping 25 matching lines...) Expand all Loading... |
2908 enum Check { | 2909 enum Check { |
2909 IS_SPEC_OBJECT, | 2910 IS_SPEC_OBJECT, |
2910 IS_JS_ARRAY, | 2911 IS_JS_ARRAY, |
2911 IS_STRING, | 2912 IS_STRING, |
2912 IS_INTERNALIZED_STRING, | 2913 IS_INTERNALIZED_STRING, |
2913 LAST_INTERVAL_CHECK = IS_JS_ARRAY | 2914 LAST_INTERVAL_CHECK = IS_JS_ARRAY |
2914 }; | 2915 }; |
2915 | 2916 |
2916 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); | 2917 DECLARE_INSTRUCTION_FACTORY_P2(HCheckInstanceType, HValue*, Check); |
2917 | 2918 |
2918 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 2919 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
2919 | 2920 |
2920 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 2921 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
2921 return Representation::Tagged(); | 2922 return Representation::Tagged(); |
2922 } | 2923 } |
2923 | 2924 |
2924 virtual HType CalculateInferredType() OVERRIDE { | 2925 virtual HType CalculateInferredType() OVERRIDE { |
2925 switch (check_) { | 2926 switch (check_) { |
2926 case IS_SPEC_OBJECT: return HType::JSObject(); | 2927 case IS_SPEC_OBJECT: return HType::JSObject(); |
2927 case IS_JS_ARRAY: return HType::JSArray(); | 2928 case IS_JS_ARRAY: return HType::JSArray(); |
2928 case IS_STRING: return HType::String(); | 2929 case IS_STRING: return HType::String(); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 } | 3302 } |
3302 bool IsLimitedInductionVariable() { | 3303 bool IsLimitedInductionVariable() { |
3303 return IsInductionVariable() && | 3304 return IsInductionVariable() && |
3304 induction_variable_data_->limit() != NULL; | 3305 induction_variable_data_->limit() != NULL; |
3305 } | 3306 } |
3306 void DetectInductionVariable() { | 3307 void DetectInductionVariable() { |
3307 DCHECK(induction_variable_data_ == NULL); | 3308 DCHECK(induction_variable_data_ == NULL); |
3308 induction_variable_data_ = InductionVariableData::ExaminePhi(this); | 3309 induction_variable_data_ = InductionVariableData::ExaminePhi(this); |
3309 } | 3310 } |
3310 | 3311 |
3311 virtual OStream& PrintTo(OStream& os) const OVERRIDE; // NOLINT | 3312 virtual std::ostream& PrintTo(std::ostream& os) const OVERRIDE; // NOLINT |
3312 | 3313 |
3313 #ifdef DEBUG | 3314 #ifdef DEBUG |
3314 virtual void Verify() OVERRIDE; | 3315 virtual void Verify() OVERRIDE; |
3315 #endif | 3316 #endif |
3316 | 3317 |
3317 void InitRealUses(int id); | 3318 void InitRealUses(int id); |
3318 void AddNonPhiUsesFrom(HPhi* other); | 3319 void AddNonPhiUsesFrom(HPhi* other); |
3319 void AddIndirectUsesTo(int* use_count); | 3320 void AddIndirectUsesTo(int* use_count); |
3320 | 3321 |
3321 int tagged_non_phi_uses() const { | 3322 int tagged_non_phi_uses() const { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3453 | 3454 |
3454 void ReuseSideEffectsFromStore(HInstruction* store) { | 3455 void ReuseSideEffectsFromStore(HInstruction* store) { |
3455 DCHECK(store->HasObservableSideEffects()); | 3456 DCHECK(store->HasObservableSideEffects()); |
3456 DCHECK(store->IsStoreNamedField()); | 3457 DCHECK(store->IsStoreNamedField()); |
3457 changes_flags_.Add(store->ChangesFlags()); | 3458 changes_flags_.Add(store->ChangesFlags()); |
3458 } | 3459 } |
3459 | 3460 |
3460 // Replay effects of this instruction on the given environment. | 3461 // Replay effects of this instruction on the given environment. |
3461 void ReplayEnvironment(HEnvironment* env); | 3462 void ReplayEnvironment(HEnvironment* env); |
3462 | 3463 |
3463 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 3464 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
3464 | 3465 |
3465 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) | 3466 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) |
3466 | 3467 |
3467 private: | 3468 private: |
3468 int capture_id_; | 3469 int capture_id_; |
3469 | 3470 |
3470 // Note that we cannot DCE captured objects as they are used to replay | 3471 // Note that we cannot DCE captured objects as they are used to replay |
3471 // the environment. This method is here as an explicit reminder. | 3472 // the environment. This method is here as an explicit reminder. |
3472 // TODO(mstarzinger): Turn HSimulates into full snapshots maybe? | 3473 // TODO(mstarzinger): Turn HSimulates into full snapshots maybe? |
3473 virtual bool IsDeletable() const FINAL OVERRIDE { return false; } | 3474 virtual bool IsDeletable() const FINAL OVERRIDE { return false; } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3567 | 3568 |
3568 virtual Representation KnownOptimalRepresentation() OVERRIDE { | 3569 virtual Representation KnownOptimalRepresentation() OVERRIDE { |
3569 if (HasSmiValue() && SmiValuesAre31Bits()) return Representation::Smi(); | 3570 if (HasSmiValue() && SmiValuesAre31Bits()) return Representation::Smi(); |
3570 if (HasInteger32Value()) return Representation::Integer32(); | 3571 if (HasInteger32Value()) return Representation::Integer32(); |
3571 if (HasNumberValue()) return Representation::Double(); | 3572 if (HasNumberValue()) return Representation::Double(); |
3572 if (HasExternalReferenceValue()) return Representation::External(); | 3573 if (HasExternalReferenceValue()) return Representation::External(); |
3573 return Representation::Tagged(); | 3574 return Representation::Tagged(); |
3574 } | 3575 } |
3575 | 3576 |
3576 virtual bool EmitAtUses() OVERRIDE; | 3577 virtual bool EmitAtUses() OVERRIDE; |
3577 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 3578 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
3578 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; | 3579 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; |
3579 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); | 3580 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); |
3580 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); | 3581 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); |
3581 bool HasInteger32Value() const { return has_int32_value_; } | 3582 bool HasInteger32Value() const { return has_int32_value_; } |
3582 int32_t Integer32Value() const { | 3583 int32_t Integer32Value() const { |
3583 DCHECK(HasInteger32Value()); | 3584 DCHECK(HasInteger32Value()); |
3584 return int32_value_; | 3585 return int32_value_; |
3585 } | 3586 } |
3586 bool HasSmiValue() const { return has_smi_value_; } | 3587 bool HasSmiValue() const { return has_smi_value_; } |
3587 bool HasDoubleValue() const { return has_double_value_; } | 3588 bool HasDoubleValue() const { return has_double_value_; } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3831 } | 3832 } |
3832 | 3833 |
3833 virtual void InferRepresentation( | 3834 virtual void InferRepresentation( |
3834 HInferRepresentationPhase* h_infer) OVERRIDE; | 3835 HInferRepresentationPhase* h_infer) OVERRIDE; |
3835 virtual Representation RepresentationFromInputs() OVERRIDE; | 3836 virtual Representation RepresentationFromInputs() OVERRIDE; |
3836 Representation RepresentationFromOutput(); | 3837 Representation RepresentationFromOutput(); |
3837 virtual void AssumeRepresentation(Representation r) OVERRIDE; | 3838 virtual void AssumeRepresentation(Representation r) OVERRIDE; |
3838 | 3839 |
3839 virtual bool IsCommutative() const { return false; } | 3840 virtual bool IsCommutative() const { return false; } |
3840 | 3841 |
3841 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 3842 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
3842 | 3843 |
3843 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 3844 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
3844 if (index == 0) return Representation::Tagged(); | 3845 if (index == 0) return Representation::Tagged(); |
3845 return representation(); | 3846 return representation(); |
3846 } | 3847 } |
3847 | 3848 |
3848 void SetOperandPositions(Zone* zone, | 3849 void SetOperandPositions(Zone* zone, |
3849 HSourcePosition left_pos, | 3850 HSourcePosition left_pos, |
3850 HSourcePosition right_pos) { | 3851 HSourcePosition right_pos) { |
3851 set_operand_position(zone, 1, left_pos); | 3852 set_operand_position(zone, 1, left_pos); |
(...skipping 27 matching lines...) Expand all Loading... |
3879 | 3880 |
3880 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 3881 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
3881 return Representation::Tagged(); | 3882 return Representation::Tagged(); |
3882 } | 3883 } |
3883 | 3884 |
3884 HValue* receiver() const { return OperandAt(0); } | 3885 HValue* receiver() const { return OperandAt(0); } |
3885 HValue* function() const { return OperandAt(1); } | 3886 HValue* function() const { return OperandAt(1); } |
3886 | 3887 |
3887 virtual HValue* Canonicalize() OVERRIDE; | 3888 virtual HValue* Canonicalize() OVERRIDE; |
3888 | 3889 |
3889 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 3890 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
3890 bool known_function() const { return known_function_; } | 3891 bool known_function() const { return known_function_; } |
3891 | 3892 |
3892 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver) | 3893 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver) |
3893 | 3894 |
3894 private: | 3895 private: |
3895 HWrapReceiver(HValue* receiver, HValue* function) { | 3896 HWrapReceiver(HValue* receiver, HValue* function) { |
3896 known_function_ = function->IsConstant() && | 3897 known_function_ = function->IsConstant() && |
3897 HConstant::cast(function)->handle(function->isolate())->IsJSFunction(); | 3898 HConstant::cast(function)->handle(function->isolate())->IsJSFunction(); |
3898 set_representation(Representation::Tagged()); | 3899 set_representation(Representation::Tagged()); |
3899 SetOperandAt(0, receiver); | 3900 SetOperandAt(0, receiver); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 } | 3989 } |
3989 | 3990 |
3990 virtual bool IsDeletable() const OVERRIDE { return true; } | 3991 virtual bool IsDeletable() const OVERRIDE { return true; } |
3991 }; | 3992 }; |
3992 | 3993 |
3993 | 3994 |
3994 class HAccessArgumentsAt FINAL : public HTemplateInstruction<3> { | 3995 class HAccessArgumentsAt FINAL : public HTemplateInstruction<3> { |
3995 public: | 3996 public: |
3996 DECLARE_INSTRUCTION_FACTORY_P3(HAccessArgumentsAt, HValue*, HValue*, HValue*); | 3997 DECLARE_INSTRUCTION_FACTORY_P3(HAccessArgumentsAt, HValue*, HValue*, HValue*); |
3997 | 3998 |
3998 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 3999 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
3999 | 4000 |
4000 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4001 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4001 // The arguments elements is considered tagged. | 4002 // The arguments elements is considered tagged. |
4002 return index == 0 | 4003 return index == 0 |
4003 ? Representation::Tagged() | 4004 ? Representation::Tagged() |
4004 : Representation::Integer32(); | 4005 : Representation::Integer32(); |
4005 } | 4006 } |
4006 | 4007 |
4007 HValue* arguments() const { return OperandAt(0); } | 4008 HValue* arguments() const { return OperandAt(0); } |
4008 HValue* length() const { return OperandAt(1); } | 4009 HValue* length() const { return OperandAt(1); } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4052 offset_ = 0; | 4053 offset_ = 0; |
4053 scale_ = 0; | 4054 scale_ = 0; |
4054 return false; | 4055 return false; |
4055 } | 4056 } |
4056 } | 4057 } |
4057 | 4058 |
4058 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4059 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4059 return representation(); | 4060 return representation(); |
4060 } | 4061 } |
4061 | 4062 |
4062 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4063 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4063 virtual void InferRepresentation( | 4064 virtual void InferRepresentation( |
4064 HInferRepresentationPhase* h_infer) OVERRIDE; | 4065 HInferRepresentationPhase* h_infer) OVERRIDE; |
4065 | 4066 |
4066 HValue* index() const { return OperandAt(0); } | 4067 HValue* index() const { return OperandAt(0); } |
4067 HValue* length() const { return OperandAt(1); } | 4068 HValue* length() const { return OperandAt(1); } |
4068 bool allow_equality() const { return allow_equality_; } | 4069 bool allow_equality() const { return allow_equality_; } |
4069 void set_allow_equality(bool v) { allow_equality_ = v; } | 4070 void set_allow_equality(bool v) { allow_equality_ = v; } |
4070 | 4071 |
4071 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } | 4072 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
4072 virtual bool IsPurelyInformativeDefinition() OVERRIDE { | 4073 virtual bool IsPurelyInformativeDefinition() OVERRIDE { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4123 | 4124 |
4124 HValue* base_index() const { return OperandAt(0); } | 4125 HValue* base_index() const { return OperandAt(0); } |
4125 HBoundsCheck* bounds_check() { return HBoundsCheck::cast(OperandAt(1)); } | 4126 HBoundsCheck* bounds_check() { return HBoundsCheck::cast(OperandAt(1)); } |
4126 | 4127 |
4127 DECLARE_CONCRETE_INSTRUCTION(BoundsCheckBaseIndexInformation) | 4128 DECLARE_CONCRETE_INSTRUCTION(BoundsCheckBaseIndexInformation) |
4128 | 4129 |
4129 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4130 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4130 return representation(); | 4131 return representation(); |
4131 } | 4132 } |
4132 | 4133 |
4133 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4134 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4134 | 4135 |
4135 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } | 4136 virtual int RedefinedOperandIndex() OVERRIDE { return 0; } |
4136 virtual bool IsPurelyInformativeDefinition() OVERRIDE { return true; } | 4137 virtual bool IsPurelyInformativeDefinition() OVERRIDE { return true; } |
4137 }; | 4138 }; |
4138 | 4139 |
4139 | 4140 |
4140 class HBitwiseBinaryOperation : public HBinaryOperation { | 4141 class HBitwiseBinaryOperation : public HBinaryOperation { |
4141 public: | 4142 public: |
4142 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, | 4143 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right, |
4143 HType type = HType::TaggedNumber()) | 4144 HType type = HType::TaggedNumber()) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4249 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCompareGeneric, HValue*, | 4250 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCompareGeneric, HValue*, |
4250 HValue*, Token::Value); | 4251 HValue*, Token::Value); |
4251 | 4252 |
4252 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4253 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4253 return index == 0 | 4254 return index == 0 |
4254 ? Representation::Tagged() | 4255 ? Representation::Tagged() |
4255 : representation(); | 4256 : representation(); |
4256 } | 4257 } |
4257 | 4258 |
4258 Token::Value token() const { return token_; } | 4259 Token::Value token() const { return token_; } |
4259 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4260 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4260 | 4261 |
4261 DECLARE_CONCRETE_INSTRUCTION(CompareGeneric) | 4262 DECLARE_CONCRETE_INSTRUCTION(CompareGeneric) |
4262 | 4263 |
4263 private: | 4264 private: |
4264 HCompareGeneric(HValue* context, | 4265 HCompareGeneric(HValue* context, |
4265 HValue* left, | 4266 HValue* left, |
4266 HValue* right, | 4267 HValue* right, |
4267 Token::Value token) | 4268 Token::Value token) |
4268 : HBinaryOperation(context, left, right, HType::Boolean()), | 4269 : HBinaryOperation(context, left, right, HType::Boolean()), |
4269 token_(token) { | 4270 token_(token) { |
(...skipping 29 matching lines...) Expand all Loading... |
4299 | 4300 |
4300 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4301 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4301 return representation(); | 4302 return representation(); |
4302 } | 4303 } |
4303 virtual Representation observed_input_representation(int index) OVERRIDE { | 4304 virtual Representation observed_input_representation(int index) OVERRIDE { |
4304 return observed_input_representation_[index]; | 4305 return observed_input_representation_[index]; |
4305 } | 4306 } |
4306 | 4307 |
4307 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; | 4308 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; |
4308 | 4309 |
4309 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4310 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4310 | 4311 |
4311 void SetOperandPositions(Zone* zone, | 4312 void SetOperandPositions(Zone* zone, |
4312 HSourcePosition left_pos, | 4313 HSourcePosition left_pos, |
4313 HSourcePosition right_pos) { | 4314 HSourcePosition right_pos) { |
4314 set_operand_position(zone, 0, left_pos); | 4315 set_operand_position(zone, 0, left_pos); |
4315 set_operand_position(zone, 1, right_pos); | 4316 set_operand_position(zone, 1, right_pos); |
4316 } | 4317 } |
4317 | 4318 |
4318 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch) | 4319 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch) |
4319 | 4320 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4395 | 4396 |
4396 static const int kNoKnownSuccessorIndex = -1; | 4397 static const int kNoKnownSuccessorIndex = -1; |
4397 int known_successor_index() const { return known_successor_index_; } | 4398 int known_successor_index() const { return known_successor_index_; } |
4398 void set_known_successor_index(int known_successor_index) { | 4399 void set_known_successor_index(int known_successor_index) { |
4399 known_successor_index_ = known_successor_index; | 4400 known_successor_index_ = known_successor_index; |
4400 } | 4401 } |
4401 | 4402 |
4402 HValue* left() const { return OperandAt(0); } | 4403 HValue* left() const { return OperandAt(0); } |
4403 HValue* right() const { return OperandAt(1); } | 4404 HValue* right() const { return OperandAt(1); } |
4404 | 4405 |
4405 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4406 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4406 | 4407 |
4407 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4408 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4408 return Representation::Tagged(); | 4409 return Representation::Tagged(); |
4409 } | 4410 } |
4410 | 4411 |
4411 virtual Representation observed_input_representation(int index) OVERRIDE { | 4412 virtual Representation observed_input_representation(int index) OVERRIDE { |
4412 return Representation::Tagged(); | 4413 return Representation::Tagged(); |
4413 } | 4414 } |
4414 | 4415 |
4415 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch) | 4416 DECLARE_CONCRETE_INSTRUCTION(CompareObjectEqAndBranch) |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4539 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HStringCompareAndBranch, | 4540 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HStringCompareAndBranch, |
4540 HValue*, | 4541 HValue*, |
4541 HValue*, | 4542 HValue*, |
4542 Token::Value); | 4543 Token::Value); |
4543 | 4544 |
4544 HValue* context() { return OperandAt(0); } | 4545 HValue* context() { return OperandAt(0); } |
4545 HValue* left() { return OperandAt(1); } | 4546 HValue* left() { return OperandAt(1); } |
4546 HValue* right() { return OperandAt(2); } | 4547 HValue* right() { return OperandAt(2); } |
4547 Token::Value token() const { return token_; } | 4548 Token::Value token() const { return token_; } |
4548 | 4549 |
4549 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4550 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4550 | 4551 |
4551 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4552 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4552 return Representation::Tagged(); | 4553 return Representation::Tagged(); |
4553 } | 4554 } |
4554 | 4555 |
4555 Representation GetInputRepresentation() const { | 4556 Representation GetInputRepresentation() const { |
4556 return Representation::Tagged(); | 4557 return Representation::Tagged(); |
4557 } | 4558 } |
4558 | 4559 |
4559 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch) | 4560 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4593 class HHasInstanceTypeAndBranch FINAL : public HUnaryControlInstruction { | 4594 class HHasInstanceTypeAndBranch FINAL : public HUnaryControlInstruction { |
4594 public: | 4595 public: |
4595 DECLARE_INSTRUCTION_FACTORY_P2( | 4596 DECLARE_INSTRUCTION_FACTORY_P2( |
4596 HHasInstanceTypeAndBranch, HValue*, InstanceType); | 4597 HHasInstanceTypeAndBranch, HValue*, InstanceType); |
4597 DECLARE_INSTRUCTION_FACTORY_P3( | 4598 DECLARE_INSTRUCTION_FACTORY_P3( |
4598 HHasInstanceTypeAndBranch, HValue*, InstanceType, InstanceType); | 4599 HHasInstanceTypeAndBranch, HValue*, InstanceType, InstanceType); |
4599 | 4600 |
4600 InstanceType from() { return from_; } | 4601 InstanceType from() { return from_; } |
4601 InstanceType to() { return to_; } | 4602 InstanceType to() { return to_; } |
4602 | 4603 |
4603 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4604 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4604 | 4605 |
4605 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4606 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4606 return Representation::Tagged(); | 4607 return Representation::Tagged(); |
4607 } | 4608 } |
4608 | 4609 |
4609 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; | 4610 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; |
4610 | 4611 |
4611 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch) | 4612 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch) |
4612 | 4613 |
4613 private: | 4614 private: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4665 public: | 4666 public: |
4666 DECLARE_INSTRUCTION_FACTORY_P2(HClassOfTestAndBranch, HValue*, | 4667 DECLARE_INSTRUCTION_FACTORY_P2(HClassOfTestAndBranch, HValue*, |
4667 Handle<String>); | 4668 Handle<String>); |
4668 | 4669 |
4669 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch) | 4670 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch) |
4670 | 4671 |
4671 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4672 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4672 return Representation::Tagged(); | 4673 return Representation::Tagged(); |
4673 } | 4674 } |
4674 | 4675 |
4675 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4676 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4676 | 4677 |
4677 Handle<String> class_name() const { return class_name_; } | 4678 Handle<String> class_name() const { return class_name_; } |
4678 | 4679 |
4679 private: | 4680 private: |
4680 HClassOfTestAndBranch(HValue* value, Handle<String> class_name) | 4681 HClassOfTestAndBranch(HValue* value, Handle<String> class_name) |
4681 : HUnaryControlInstruction(value, NULL, NULL), | 4682 : HUnaryControlInstruction(value, NULL, NULL), |
4682 class_name_(class_name) { } | 4683 class_name_(class_name) { } |
4683 | 4684 |
4684 Handle<String> class_name_; | 4685 Handle<String> class_name_; |
4685 }; | 4686 }; |
4686 | 4687 |
4687 | 4688 |
4688 class HTypeofIsAndBranch FINAL : public HUnaryControlInstruction { | 4689 class HTypeofIsAndBranch FINAL : public HUnaryControlInstruction { |
4689 public: | 4690 public: |
4690 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); | 4691 DECLARE_INSTRUCTION_FACTORY_P2(HTypeofIsAndBranch, HValue*, Handle<String>); |
4691 | 4692 |
4692 Handle<String> type_literal() const { return type_literal_.handle(); } | 4693 Handle<String> type_literal() const { return type_literal_.handle(); } |
4693 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4694 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4694 | 4695 |
4695 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) | 4696 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch) |
4696 | 4697 |
4697 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4698 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4698 return Representation::None(); | 4699 return Representation::None(); |
4699 } | 4700 } |
4700 | 4701 |
4701 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; | 4702 virtual bool KnownSuccessorBlock(HBasicBlock** block) OVERRIDE; |
4702 | 4703 |
4703 virtual void FinalizeUniqueness() OVERRIDE { | 4704 virtual void FinalizeUniqueness() OVERRIDE { |
(...skipping 10 matching lines...) Expand all Loading... |
4714 | 4715 |
4715 | 4716 |
4716 class HInstanceOf FINAL : public HBinaryOperation { | 4717 class HInstanceOf FINAL : public HBinaryOperation { |
4717 public: | 4718 public: |
4718 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); | 4719 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HInstanceOf, HValue*, HValue*); |
4719 | 4720 |
4720 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 4721 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
4721 return Representation::Tagged(); | 4722 return Representation::Tagged(); |
4722 } | 4723 } |
4723 | 4724 |
4724 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 4725 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
4725 | 4726 |
4726 DECLARE_CONCRETE_INSTRUCTION(InstanceOf) | 4727 DECLARE_CONCRETE_INSTRUCTION(InstanceOf) |
4727 | 4728 |
4728 private: | 4729 private: |
4729 HInstanceOf(HValue* context, HValue* left, HValue* right) | 4730 HInstanceOf(HValue* context, HValue* left, HValue* right) |
4730 : HBinaryOperation(context, left, right, HType::Boolean()) { | 4731 : HBinaryOperation(context, left, right, HType::Boolean()) { |
4731 set_representation(Representation::Tagged()); | 4732 set_representation(Representation::Tagged()); |
4732 SetAllSideEffects(); | 4733 SetAllSideEffects(); |
4733 } | 4734 } |
4734 }; | 4735 }; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5073 Token::Value op, | 5074 Token::Value op, |
5074 HValue* left, | 5075 HValue* left, |
5075 HValue* right); | 5076 HValue* right); |
5076 | 5077 |
5077 Token::Value op() const { return op_; } | 5078 Token::Value op() const { return op_; } |
5078 | 5079 |
5079 virtual bool IsCommutative() const OVERRIDE { return true; } | 5080 virtual bool IsCommutative() const OVERRIDE { return true; } |
5080 | 5081 |
5081 virtual HValue* Canonicalize() OVERRIDE; | 5082 virtual HValue* Canonicalize() OVERRIDE; |
5082 | 5083 |
5083 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5084 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5084 | 5085 |
5085 DECLARE_CONCRETE_INSTRUCTION(Bitwise) | 5086 DECLARE_CONCRETE_INSTRUCTION(Bitwise) |
5086 | 5087 |
5087 protected: | 5088 protected: |
5088 virtual bool DataEquals(HValue* other) OVERRIDE { | 5089 virtual bool DataEquals(HValue* other) OVERRIDE { |
5089 return op() == HBitwise::cast(other)->op(); | 5090 return op() == HBitwise::cast(other)->op(); |
5090 } | 5091 } |
5091 | 5092 |
5092 virtual Range* InferRange(Zone* zone) OVERRIDE; | 5093 virtual Range* InferRange(Zone* zone) OVERRIDE; |
5093 | 5094 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5296 }; | 5297 }; |
5297 | 5298 |
5298 DECLARE_INSTRUCTION_FACTORY_P1(HParameter, unsigned); | 5299 DECLARE_INSTRUCTION_FACTORY_P1(HParameter, unsigned); |
5299 DECLARE_INSTRUCTION_FACTORY_P2(HParameter, unsigned, ParameterKind); | 5300 DECLARE_INSTRUCTION_FACTORY_P2(HParameter, unsigned, ParameterKind); |
5300 DECLARE_INSTRUCTION_FACTORY_P3(HParameter, unsigned, ParameterKind, | 5301 DECLARE_INSTRUCTION_FACTORY_P3(HParameter, unsigned, ParameterKind, |
5301 Representation); | 5302 Representation); |
5302 | 5303 |
5303 unsigned index() const { return index_; } | 5304 unsigned index() const { return index_; } |
5304 ParameterKind kind() const { return kind_; } | 5305 ParameterKind kind() const { return kind_; } |
5305 | 5306 |
5306 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5307 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5307 | 5308 |
5308 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5309 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5309 return Representation::None(); | 5310 return Representation::None(); |
5310 } | 5311 } |
5311 | 5312 |
5312 DECLARE_CONCRETE_INSTRUCTION(Parameter) | 5313 DECLARE_CONCRETE_INSTRUCTION(Parameter) |
5313 | 5314 |
5314 private: | 5315 private: |
5315 explicit HParameter(unsigned index, | 5316 explicit HParameter(unsigned index, |
5316 ParameterKind kind = STACK_PARAMETER) | 5317 ParameterKind kind = STACK_PARAMETER) |
(...skipping 15 matching lines...) Expand all Loading... |
5332 }; | 5333 }; |
5333 | 5334 |
5334 | 5335 |
5335 class HCallStub FINAL : public HUnaryCall { | 5336 class HCallStub FINAL : public HUnaryCall { |
5336 public: | 5337 public: |
5337 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallStub, CodeStub::Major, int); | 5338 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallStub, CodeStub::Major, int); |
5338 CodeStub::Major major_key() { return major_key_; } | 5339 CodeStub::Major major_key() { return major_key_; } |
5339 | 5340 |
5340 HValue* context() { return value(); } | 5341 HValue* context() { return value(); } |
5341 | 5342 |
5342 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5343 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5343 | 5344 |
5344 DECLARE_CONCRETE_INSTRUCTION(CallStub) | 5345 DECLARE_CONCRETE_INSTRUCTION(CallStub) |
5345 | 5346 |
5346 private: | 5347 private: |
5347 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) | 5348 HCallStub(HValue* context, CodeStub::Major major_key, int argument_count) |
5348 : HUnaryCall(context, argument_count), | 5349 : HUnaryCall(context, argument_count), |
5349 major_key_(major_key) { | 5350 major_key_(major_key) { |
5350 } | 5351 } |
5351 | 5352 |
5352 CodeStub::Major major_key_; | 5353 CodeStub::Major major_key_; |
5353 }; | 5354 }; |
5354 | 5355 |
5355 | 5356 |
5356 class HTailCallThroughMegamorphicCache FINAL : public HTemplateInstruction<3> { | 5357 class HTailCallThroughMegamorphicCache FINAL : public HTemplateInstruction<3> { |
5357 public: | 5358 public: |
5358 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HTailCallThroughMegamorphicCache, | 5359 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HTailCallThroughMegamorphicCache, |
5359 HValue*, HValue*, Code::Flags); | 5360 HValue*, HValue*, Code::Flags); |
5360 | 5361 |
5361 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5362 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5362 return Representation::Tagged(); | 5363 return Representation::Tagged(); |
5363 } | 5364 } |
5364 | 5365 |
5365 HValue* context() const { return OperandAt(0); } | 5366 HValue* context() const { return OperandAt(0); } |
5366 HValue* receiver() const { return OperandAt(1); } | 5367 HValue* receiver() const { return OperandAt(1); } |
5367 HValue* name() const { return OperandAt(2); } | 5368 HValue* name() const { return OperandAt(2); } |
5368 Code::Flags flags() const { return flags_; } | 5369 Code::Flags flags() const { return flags_; } |
5369 | 5370 |
5370 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5371 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5371 | 5372 |
5372 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) | 5373 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) |
5373 | 5374 |
5374 private: | 5375 private: |
5375 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, | 5376 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, |
5376 HValue* name, Code::Flags flags) | 5377 HValue* name, Code::Flags flags) |
5377 : flags_(flags) { | 5378 : flags_(flags) { |
5378 SetOperandAt(0, context); | 5379 SetOperandAt(0, context); |
5379 SetOperandAt(1, receiver); | 5380 SetOperandAt(1, receiver); |
5380 SetOperandAt(2, name); | 5381 SetOperandAt(2, name); |
5381 } | 5382 } |
5382 | 5383 |
5383 Code::Flags flags_; | 5384 Code::Flags flags_; |
5384 }; | 5385 }; |
5385 | 5386 |
5386 | 5387 |
5387 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { | 5388 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { |
5388 public: | 5389 public: |
5389 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); | 5390 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); |
5390 | 5391 |
5391 virtual OStream& PrintDataTo(OStream& os) const; // NOLINT | 5392 virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT |
5392 | 5393 |
5393 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5394 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5394 return Representation::None(); | 5395 return Representation::None(); |
5395 } | 5396 } |
5396 | 5397 |
5397 void set_incoming_value(HPhi* value) { incoming_value_ = value; } | 5398 void set_incoming_value(HPhi* value) { incoming_value_ = value; } |
5398 HPhi* incoming_value() { return incoming_value_; } | 5399 HPhi* incoming_value() { return incoming_value_; } |
5399 HEnvironment *environment() { return environment_; } | 5400 HEnvironment *environment() { return environment_; } |
5400 int index() { return index_; } | 5401 int index() { return index_; } |
5401 | 5402 |
(...skipping 19 matching lines...) Expand all Loading... |
5421 | 5422 |
5422 | 5423 |
5423 class HLoadGlobalCell FINAL : public HTemplateInstruction<0> { | 5424 class HLoadGlobalCell FINAL : public HTemplateInstruction<0> { |
5424 public: | 5425 public: |
5425 DECLARE_INSTRUCTION_FACTORY_P2(HLoadGlobalCell, Handle<Cell>, | 5426 DECLARE_INSTRUCTION_FACTORY_P2(HLoadGlobalCell, Handle<Cell>, |
5426 PropertyDetails); | 5427 PropertyDetails); |
5427 | 5428 |
5428 Unique<Cell> cell() const { return cell_; } | 5429 Unique<Cell> cell() const { return cell_; } |
5429 bool RequiresHoleCheck() const; | 5430 bool RequiresHoleCheck() const; |
5430 | 5431 |
5431 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5432 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5432 | 5433 |
5433 virtual intptr_t Hashcode() OVERRIDE { | 5434 virtual intptr_t Hashcode() OVERRIDE { |
5434 return cell_.Hashcode(); | 5435 return cell_.Hashcode(); |
5435 } | 5436 } |
5436 | 5437 |
5437 virtual void FinalizeUniqueness() OVERRIDE { | 5438 virtual void FinalizeUniqueness() OVERRIDE { |
5438 cell_ = Unique<Cell>(cell_.handle()); | 5439 cell_ = Unique<Cell>(cell_.handle()); |
5439 } | 5440 } |
5440 | 5441 |
5441 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5442 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5478 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | 5479 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); |
5479 return slot_; | 5480 return slot_; |
5480 } | 5481 } |
5481 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 5482 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
5482 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 5483 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
5483 DCHECK(FLAG_vector_ics); | 5484 DCHECK(FLAG_vector_ics); |
5484 feedback_vector_ = vector; | 5485 feedback_vector_ = vector; |
5485 slot_ = slot; | 5486 slot_ = slot; |
5486 } | 5487 } |
5487 | 5488 |
5488 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5489 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5489 | 5490 |
5490 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5491 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5491 return Representation::Tagged(); | 5492 return Representation::Tagged(); |
5492 } | 5493 } |
5493 | 5494 |
5494 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) | 5495 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) |
5495 | 5496 |
5496 private: | 5497 private: |
5497 HLoadGlobalGeneric(HValue* context, HValue* global_object, | 5498 HLoadGlobalGeneric(HValue* context, HValue* global_object, |
5498 Handle<String> name, bool for_typeof) | 5499 Handle<String> name, bool for_typeof) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5588 return (flags_ & CLEAR_NEXT_MAP_WORD) != 0; | 5589 return (flags_ & CLEAR_NEXT_MAP_WORD) != 0; |
5589 } | 5590 } |
5590 | 5591 |
5591 void MakeDoubleAligned() { | 5592 void MakeDoubleAligned() { |
5592 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); | 5593 flags_ = static_cast<HAllocate::Flags>(flags_ | ALLOCATE_DOUBLE_ALIGNED); |
5593 } | 5594 } |
5594 | 5595 |
5595 virtual bool HandleSideEffectDominator(GVNFlag side_effect, | 5596 virtual bool HandleSideEffectDominator(GVNFlag side_effect, |
5596 HValue* dominator) OVERRIDE; | 5597 HValue* dominator) OVERRIDE; |
5597 | 5598 |
5598 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5599 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5599 | 5600 |
5600 DECLARE_CONCRETE_INSTRUCTION(Allocate) | 5601 DECLARE_CONCRETE_INSTRUCTION(Allocate) |
5601 | 5602 |
5602 private: | 5603 private: |
5603 enum Flags { | 5604 enum Flags { |
5604 ALLOCATE_IN_NEW_SPACE = 1 << 0, | 5605 ALLOCATE_IN_NEW_SPACE = 1 << 0, |
5605 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, | 5606 ALLOCATE_IN_OLD_DATA_SPACE = 1 << 1, |
5606 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, | 5607 ALLOCATE_IN_OLD_POINTER_SPACE = 1 << 2, |
5607 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, | 5608 ALLOCATE_DOUBLE_ALIGNED = 1 << 3, |
5608 PREFILL_WITH_FILLER = 1 << 4, | 5609 PREFILL_WITH_FILLER = 1 << 4, |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5735 return new(zone) HInnerAllocatedObject(value, offset, type); | 5736 return new(zone) HInnerAllocatedObject(value, offset, type); |
5736 } | 5737 } |
5737 | 5738 |
5738 HValue* base_object() const { return OperandAt(0); } | 5739 HValue* base_object() const { return OperandAt(0); } |
5739 HValue* offset() const { return OperandAt(1); } | 5740 HValue* offset() const { return OperandAt(1); } |
5740 | 5741 |
5741 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5742 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5742 return index == 0 ? Representation::Tagged() : Representation::Integer32(); | 5743 return index == 0 ? Representation::Tagged() : Representation::Integer32(); |
5743 } | 5744 } |
5744 | 5745 |
5745 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5746 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5746 | 5747 |
5747 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject) | 5748 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject) |
5748 | 5749 |
5749 private: | 5750 private: |
5750 HInnerAllocatedObject(HValue* value, | 5751 HInnerAllocatedObject(HValue* value, |
5751 HValue* offset, | 5752 HValue* offset, |
5752 HType type) : HTemplateInstruction<2>(type) { | 5753 HType type) : HTemplateInstruction<2>(type) { |
5753 DCHECK(value->IsAllocate()); | 5754 DCHECK(value->IsAllocate()); |
5754 DCHECK(type.IsHeapObject()); | 5755 DCHECK(type.IsHeapObject()); |
5755 SetOperandAt(0, value); | 5756 SetOperandAt(0, value); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5833 return StoringValueNeedsWriteBarrier(value()); | 5834 return StoringValueNeedsWriteBarrier(value()); |
5834 } | 5835 } |
5835 | 5836 |
5836 virtual void FinalizeUniqueness() OVERRIDE { | 5837 virtual void FinalizeUniqueness() OVERRIDE { |
5837 cell_ = Unique<PropertyCell>(cell_.handle()); | 5838 cell_ = Unique<PropertyCell>(cell_.handle()); |
5838 } | 5839 } |
5839 | 5840 |
5840 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5841 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5841 return Representation::Tagged(); | 5842 return Representation::Tagged(); |
5842 } | 5843 } |
5843 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5844 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5844 | 5845 |
5845 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) | 5846 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell) |
5846 | 5847 |
5847 private: | 5848 private: |
5848 HStoreGlobalCell(HValue* value, | 5849 HStoreGlobalCell(HValue* value, |
5849 Handle<PropertyCell> cell, | 5850 Handle<PropertyCell> cell, |
5850 PropertyDetails details) | 5851 PropertyDetails details) |
5851 : HUnaryOperation(value), | 5852 : HUnaryOperation(value), |
5852 cell_(Unique<PropertyCell>::CreateUninitialized(cell)), | 5853 cell_(Unique<PropertyCell>::CreateUninitialized(cell)), |
5853 details_(details) { | 5854 details_(details) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5889 } | 5890 } |
5890 | 5891 |
5891 bool RequiresHoleCheck() const { | 5892 bool RequiresHoleCheck() const { |
5892 return mode_ != kNoCheck; | 5893 return mode_ != kNoCheck; |
5893 } | 5894 } |
5894 | 5895 |
5895 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5896 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5896 return Representation::Tagged(); | 5897 return Representation::Tagged(); |
5897 } | 5898 } |
5898 | 5899 |
5899 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5900 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5900 | 5901 |
5901 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot) | 5902 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot) |
5902 | 5903 |
5903 protected: | 5904 protected: |
5904 virtual bool DataEquals(HValue* other) OVERRIDE { | 5905 virtual bool DataEquals(HValue* other) OVERRIDE { |
5905 HLoadContextSlot* b = HLoadContextSlot::cast(other); | 5906 HLoadContextSlot* b = HLoadContextSlot::cast(other); |
5906 return (slot_index() == b->slot_index()); | 5907 return (slot_index() == b->slot_index()); |
5907 } | 5908 } |
5908 | 5909 |
5909 private: | 5910 private: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5946 } | 5947 } |
5947 | 5948 |
5948 bool RequiresHoleCheck() { | 5949 bool RequiresHoleCheck() { |
5949 return mode_ != kNoCheck; | 5950 return mode_ != kNoCheck; |
5950 } | 5951 } |
5951 | 5952 |
5952 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 5953 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
5953 return Representation::Tagged(); | 5954 return Representation::Tagged(); |
5954 } | 5955 } |
5955 | 5956 |
5956 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 5957 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5957 | 5958 |
5958 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot) | 5959 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot) |
5959 | 5960 |
5960 private: | 5961 private: |
5961 HStoreContextSlot(HValue* context, int slot_index, Mode mode, HValue* value) | 5962 HStoreContextSlot(HValue* context, int slot_index, Mode mode, HValue* value) |
5962 : slot_index_(slot_index), mode_(mode) { | 5963 : slot_index_(slot_index), mode_(mode) { |
5963 SetOperandAt(0, context); | 5964 SetOperandAt(0, context); |
5964 SetOperandAt(1, value); | 5965 SetOperandAt(1, value); |
5965 SetChangesFlag(kContextSlots); | 5966 SetChangesFlag(kContextSlots); |
5966 } | 5967 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6329 class ImmutableField : public BitField<bool, 7, 1> {}; | 6330 class ImmutableField : public BitField<bool, 7, 1> {}; |
6330 class ExistingInobjectPropertyField : public BitField<bool, 8, 1> {}; | 6331 class ExistingInobjectPropertyField : public BitField<bool, 8, 1> {}; |
6331 class OffsetField : public BitField<int, 9, 23> {}; | 6332 class OffsetField : public BitField<int, 9, 23> {}; |
6332 | 6333 |
6333 uint32_t value_; // encodes portion, representation, immutable, and offset | 6334 uint32_t value_; // encodes portion, representation, immutable, and offset |
6334 Handle<String> name_; | 6335 Handle<String> name_; |
6335 | 6336 |
6336 friend class HLoadNamedField; | 6337 friend class HLoadNamedField; |
6337 friend class HStoreNamedField; | 6338 friend class HStoreNamedField; |
6338 friend class SideEffectsTracker; | 6339 friend class SideEffectsTracker; |
6339 friend OStream& operator<<(OStream& os, const HObjectAccess& access); | 6340 friend std::ostream& operator<<(std::ostream& os, |
| 6341 const HObjectAccess& access); |
6340 | 6342 |
6341 inline Portion portion() const { | 6343 inline Portion portion() const { |
6342 return PortionField::decode(value_); | 6344 return PortionField::decode(value_); |
6343 } | 6345 } |
6344 }; | 6346 }; |
6345 | 6347 |
6346 | 6348 |
6347 OStream& operator<<(OStream& os, const HObjectAccess& access); | 6349 std::ostream& operator<<(std::ostream& os, const HObjectAccess& access); |
6348 | 6350 |
6349 | 6351 |
6350 class HLoadNamedField FINAL : public HTemplateInstruction<2> { | 6352 class HLoadNamedField FINAL : public HTemplateInstruction<2> { |
6351 public: | 6353 public: |
6352 DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, | 6354 DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, |
6353 HValue*, HObjectAccess); | 6355 HValue*, HObjectAccess); |
6354 DECLARE_INSTRUCTION_FACTORY_P5(HLoadNamedField, HValue*, HValue*, | 6356 DECLARE_INSTRUCTION_FACTORY_P5(HLoadNamedField, HValue*, HValue*, |
6355 HObjectAccess, const UniqueSet<Map>*, HType); | 6357 HObjectAccess, const UniqueSet<Map>*, HType); |
6356 | 6358 |
6357 HValue* object() const { return OperandAt(0); } | 6359 HValue* object() const { return OperandAt(0); } |
(...skipping 14 matching lines...) Expand all Loading... |
6372 return !access().IsInobject() || access().offset() >= size; | 6374 return !access().IsInobject() || access().offset() >= size; |
6373 } | 6375 } |
6374 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6376 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6375 if (index == 0 && access().IsExternalMemory()) { | 6377 if (index == 0 && access().IsExternalMemory()) { |
6376 // object must be external in case of external memory access | 6378 // object must be external in case of external memory access |
6377 return Representation::External(); | 6379 return Representation::External(); |
6378 } | 6380 } |
6379 return Representation::Tagged(); | 6381 return Representation::Tagged(); |
6380 } | 6382 } |
6381 virtual Range* InferRange(Zone* zone) OVERRIDE; | 6383 virtual Range* InferRange(Zone* zone) OVERRIDE; |
6382 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6384 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6383 | 6385 |
6384 bool CanBeReplacedWith(HValue* other) const { | 6386 bool CanBeReplacedWith(HValue* other) const { |
6385 if (!CheckFlag(HValue::kCantBeReplaced)) return false; | 6387 if (!CheckFlag(HValue::kCantBeReplaced)) return false; |
6386 if (!type().Equals(other->type())) return false; | 6388 if (!type().Equals(other->type())) return false; |
6387 if (!representation().Equals(other->representation())) return false; | 6389 if (!representation().Equals(other->representation())) return false; |
6388 if (!other->IsLoadNamedField()) return true; | 6390 if (!other->IsLoadNamedField()) return true; |
6389 HLoadNamedField* that = HLoadNamedField::cast(other); | 6391 HLoadNamedField* that = HLoadNamedField::cast(other); |
6390 if (this->maps_ == that->maps_) return true; | 6392 if (this->maps_ == that->maps_) return true; |
6391 if (this->maps_ == NULL || that->maps_ == NULL) return false; | 6393 if (this->maps_ == NULL || that->maps_ == NULL) return false; |
6392 return this->maps_->IsSubset(that->maps_); | 6394 return this->maps_->IsSubset(that->maps_); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6484 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6486 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
6485 DCHECK(FLAG_vector_ics); | 6487 DCHECK(FLAG_vector_ics); |
6486 feedback_vector_ = vector; | 6488 feedback_vector_ = vector; |
6487 slot_ = slot; | 6489 slot_ = slot; |
6488 } | 6490 } |
6489 | 6491 |
6490 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6492 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6491 return Representation::Tagged(); | 6493 return Representation::Tagged(); |
6492 } | 6494 } |
6493 | 6495 |
6494 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6496 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6495 | 6497 |
6496 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6498 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
6497 | 6499 |
6498 private: | 6500 private: |
6499 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) | 6501 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) |
6500 : name_(name), | 6502 : name_(name), |
6501 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { | 6503 slot_(FeedbackSlotInterface::kInvalidFeedbackSlot) { |
6502 SetOperandAt(0, context); | 6504 SetOperandAt(0, context); |
6503 SetOperandAt(1, object); | 6505 SetOperandAt(1, object); |
6504 set_representation(Representation::Tagged()); | 6506 set_representation(Representation::Tagged()); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6615 return ArrayInstructionInterface::KeyedAccessIndexRequirement( | 6617 return ArrayInstructionInterface::KeyedAccessIndexRequirement( |
6616 OperandAt(1)->representation()); | 6618 OperandAt(1)->representation()); |
6617 } | 6619 } |
6618 return Representation::None(); | 6620 return Representation::None(); |
6619 } | 6621 } |
6620 | 6622 |
6621 virtual Representation observed_input_representation(int index) OVERRIDE { | 6623 virtual Representation observed_input_representation(int index) OVERRIDE { |
6622 return RequiredInputRepresentation(index); | 6624 return RequiredInputRepresentation(index); |
6623 } | 6625 } |
6624 | 6626 |
6625 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6627 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6626 | 6628 |
6627 bool UsesMustHandleHole() const; | 6629 bool UsesMustHandleHole() const; |
6628 bool AllUsesCanTreatHoleAsNaN() const; | 6630 bool AllUsesCanTreatHoleAsNaN() const; |
6629 bool RequiresHoleCheck() const; | 6631 bool RequiresHoleCheck() const; |
6630 | 6632 |
6631 virtual Range* InferRange(Zone* zone) OVERRIDE; | 6633 virtual Range* InferRange(Zone* zone) OVERRIDE; |
6632 | 6634 |
6633 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed) | 6635 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed) |
6634 | 6636 |
6635 protected: | 6637 protected: |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6758 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); | 6760 slot_ != FeedbackSlotInterface::kInvalidFeedbackSlot); |
6759 return slot_; | 6761 return slot_; |
6760 } | 6762 } |
6761 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } | 6763 Handle<FixedArray> feedback_vector() const { return feedback_vector_; } |
6762 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { | 6764 void SetVectorAndSlot(Handle<FixedArray> vector, int slot) { |
6763 DCHECK(FLAG_vector_ics); | 6765 DCHECK(FLAG_vector_ics); |
6764 feedback_vector_ = vector; | 6766 feedback_vector_ = vector; |
6765 slot_ = slot; | 6767 slot_ = slot; |
6766 } | 6768 } |
6767 | 6769 |
6768 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6770 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6769 | 6771 |
6770 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6772 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6771 // tagged[tagged] | 6773 // tagged[tagged] |
6772 return Representation::Tagged(); | 6774 return Representation::Tagged(); |
6773 } | 6775 } |
6774 | 6776 |
6775 virtual HValue* Canonicalize() OVERRIDE; | 6777 virtual HValue* Canonicalize() OVERRIDE; |
6776 | 6778 |
6777 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6779 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
6778 | 6780 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6841 } | 6843 } |
6842 return Representation::Tagged(); | 6844 return Representation::Tagged(); |
6843 } | 6845 } |
6844 virtual bool HandleSideEffectDominator(GVNFlag side_effect, | 6846 virtual bool HandleSideEffectDominator(GVNFlag side_effect, |
6845 HValue* dominator) OVERRIDE { | 6847 HValue* dominator) OVERRIDE { |
6846 DCHECK(side_effect == kNewSpacePromotion); | 6848 DCHECK(side_effect == kNewSpacePromotion); |
6847 if (!FLAG_use_write_barrier_elimination) return false; | 6849 if (!FLAG_use_write_barrier_elimination) return false; |
6848 dominator_ = dominator; | 6850 dominator_ = dominator; |
6849 return false; | 6851 return false; |
6850 } | 6852 } |
6851 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6853 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6852 | 6854 |
6853 HValue* object() const { return OperandAt(0); } | 6855 HValue* object() const { return OperandAt(0); } |
6854 HValue* value() const { return OperandAt(1); } | 6856 HValue* value() const { return OperandAt(1); } |
6855 HValue* transition() const { return OperandAt(2); } | 6857 HValue* transition() const { return OperandAt(2); } |
6856 | 6858 |
6857 HObjectAccess access() const { return access_; } | 6859 HObjectAccess access() const { return access_; } |
6858 HValue* dominator() const { return dominator_; } | 6860 HValue* dominator() const { return dominator_; } |
6859 bool has_transition() const { return has_transition_; } | 6861 bool has_transition() const { return has_transition_; } |
6860 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } | 6862 StoreFieldOrKeyedMode store_mode() const { return store_mode_; } |
6861 | 6863 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6951 public: | 6953 public: |
6952 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, | 6954 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, |
6953 Handle<String>, HValue*, | 6955 Handle<String>, HValue*, |
6954 StrictMode); | 6956 StrictMode); |
6955 HValue* object() const { return OperandAt(0); } | 6957 HValue* object() const { return OperandAt(0); } |
6956 HValue* value() const { return OperandAt(1); } | 6958 HValue* value() const { return OperandAt(1); } |
6957 HValue* context() const { return OperandAt(2); } | 6959 HValue* context() const { return OperandAt(2); } |
6958 Handle<String> name() const { return name_; } | 6960 Handle<String> name() const { return name_; } |
6959 StrictMode strict_mode() const { return strict_mode_; } | 6961 StrictMode strict_mode() const { return strict_mode_; } |
6960 | 6962 |
6961 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 6963 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
6962 | 6964 |
6963 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 6965 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
6964 return Representation::Tagged(); | 6966 return Representation::Tagged(); |
6965 } | 6967 } |
6966 | 6968 |
6967 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) | 6969 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) |
6968 | 6970 |
6969 private: | 6971 private: |
6970 HStoreNamedGeneric(HValue* context, | 6972 HStoreNamedGeneric(HValue* context, |
6971 HValue* object, | 6973 HValue* object, |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7097 ReceiverObjectNeedsWriteBarrier(elements(), value(), dominator()); | 7099 ReceiverObjectNeedsWriteBarrier(elements(), value(), dominator()); |
7098 } | 7100 } |
7099 } | 7101 } |
7100 | 7102 |
7101 PointersToHereCheck PointersToHereCheckForValue() const { | 7103 PointersToHereCheck PointersToHereCheckForValue() const { |
7102 return PointersToHereCheckForObject(value(), dominator()); | 7104 return PointersToHereCheckForObject(value(), dominator()); |
7103 } | 7105 } |
7104 | 7106 |
7105 bool NeedsCanonicalization(); | 7107 bool NeedsCanonicalization(); |
7106 | 7108 |
7107 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7109 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7108 | 7110 |
7109 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) | 7111 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed) |
7110 | 7112 |
7111 private: | 7113 private: |
7112 HStoreKeyed(HValue* obj, HValue* key, HValue* val, | 7114 HStoreKeyed(HValue* obj, HValue* key, HValue* val, |
7113 ElementsKind elements_kind, | 7115 ElementsKind elements_kind, |
7114 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE, | 7116 StoreFieldOrKeyedMode store_mode = INITIALIZING_STORE, |
7115 int offset = kDefaultKeyedHeaderOffsetSentinel) | 7117 int offset = kDefaultKeyedHeaderOffsetSentinel) |
7116 : elements_kind_(elements_kind), | 7118 : elements_kind_(elements_kind), |
7117 base_offset_(offset == kDefaultKeyedHeaderOffsetSentinel | 7119 base_offset_(offset == kDefaultKeyedHeaderOffsetSentinel |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7170 HValue* key() const { return OperandAt(1); } | 7172 HValue* key() const { return OperandAt(1); } |
7171 HValue* value() const { return OperandAt(2); } | 7173 HValue* value() const { return OperandAt(2); } |
7172 HValue* context() const { return OperandAt(3); } | 7174 HValue* context() const { return OperandAt(3); } |
7173 StrictMode strict_mode() const { return strict_mode_; } | 7175 StrictMode strict_mode() const { return strict_mode_; } |
7174 | 7176 |
7175 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7177 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7176 // tagged[tagged] = tagged | 7178 // tagged[tagged] = tagged |
7177 return Representation::Tagged(); | 7179 return Representation::Tagged(); |
7178 } | 7180 } |
7179 | 7181 |
7180 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7182 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7181 | 7183 |
7182 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) | 7184 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) |
7183 | 7185 |
7184 private: | 7186 private: |
7185 HStoreKeyedGeneric(HValue* context, | 7187 HStoreKeyedGeneric(HValue* context, |
7186 HValue* object, | 7188 HValue* object, |
7187 HValue* key, | 7189 HValue* key, |
7188 HValue* value, | 7190 HValue* value, |
7189 StrictMode strict_mode) | 7191 StrictMode strict_mode) |
7190 : strict_mode_(strict_mode) { | 7192 : strict_mode_(strict_mode) { |
(...skipping 23 matching lines...) Expand all Loading... |
7214 return Representation::Tagged(); | 7216 return Representation::Tagged(); |
7215 } | 7217 } |
7216 | 7218 |
7217 HValue* object() const { return OperandAt(0); } | 7219 HValue* object() const { return OperandAt(0); } |
7218 HValue* context() const { return OperandAt(1); } | 7220 HValue* context() const { return OperandAt(1); } |
7219 Unique<Map> original_map() const { return original_map_; } | 7221 Unique<Map> original_map() const { return original_map_; } |
7220 Unique<Map> transitioned_map() const { return transitioned_map_; } | 7222 Unique<Map> transitioned_map() const { return transitioned_map_; } |
7221 ElementsKind from_kind() const { return from_kind_; } | 7223 ElementsKind from_kind() const { return from_kind_; } |
7222 ElementsKind to_kind() const { return to_kind_; } | 7224 ElementsKind to_kind() const { return to_kind_; } |
7223 | 7225 |
7224 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7226 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7225 | 7227 |
7226 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) | 7228 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) |
7227 | 7229 |
7228 protected: | 7230 protected: |
7229 virtual bool DataEquals(HValue* other) OVERRIDE { | 7231 virtual bool DataEquals(HValue* other) OVERRIDE { |
7230 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); | 7232 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); |
7231 return original_map_ == instr->original_map_ && | 7233 return original_map_ == instr->original_map_ && |
7232 transitioned_map_ == instr->transitioned_map_; | 7234 transitioned_map_ == instr->transitioned_map_; |
7233 } | 7235 } |
7234 | 7236 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7272 Handle<AllocationSite> allocation_site = | 7274 Handle<AllocationSite> allocation_site = |
7273 Handle<AllocationSite>::null()); | 7275 Handle<AllocationSite>::null()); |
7274 | 7276 |
7275 StringAddFlags flags() const { return flags_; } | 7277 StringAddFlags flags() const { return flags_; } |
7276 PretenureFlag pretenure_flag() const { return pretenure_flag_; } | 7278 PretenureFlag pretenure_flag() const { return pretenure_flag_; } |
7277 | 7279 |
7278 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7280 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7279 return Representation::Tagged(); | 7281 return Representation::Tagged(); |
7280 } | 7282 } |
7281 | 7283 |
7282 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7284 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7283 | 7285 |
7284 DECLARE_CONCRETE_INSTRUCTION(StringAdd) | 7286 DECLARE_CONCRETE_INSTRUCTION(StringAdd) |
7285 | 7287 |
7286 protected: | 7288 protected: |
7287 virtual bool DataEquals(HValue* other) OVERRIDE { | 7289 virtual bool DataEquals(HValue* other) OVERRIDE { |
7288 return flags_ == HStringAdd::cast(other)->flags_ && | 7290 return flags_ == HStringAdd::cast(other)->flags_ && |
7289 pretenure_flag_ == HStringAdd::cast(other)->pretenure_flag_; | 7291 pretenure_flag_ == HStringAdd::cast(other)->pretenure_flag_; |
7290 } | 7292 } |
7291 | 7293 |
7292 private: | 7294 private: |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7512 }; | 7514 }; |
7513 | 7515 |
7514 | 7516 |
7515 class HTypeof FINAL : public HTemplateInstruction<2> { | 7517 class HTypeof FINAL : public HTemplateInstruction<2> { |
7516 public: | 7518 public: |
7517 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); | 7519 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); |
7518 | 7520 |
7519 HValue* context() const { return OperandAt(0); } | 7521 HValue* context() const { return OperandAt(0); } |
7520 HValue* value() const { return OperandAt(1); } | 7522 HValue* value() const { return OperandAt(1); } |
7521 | 7523 |
7522 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7524 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7523 | 7525 |
7524 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7526 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7525 return Representation::Tagged(); | 7527 return Representation::Tagged(); |
7526 } | 7528 } |
7527 | 7529 |
7528 DECLARE_CONCRETE_INSTRUCTION(Typeof) | 7530 DECLARE_CONCRETE_INSTRUCTION(Typeof) |
7529 | 7531 |
7530 private: | 7532 private: |
7531 explicit HTypeof(HValue* context, HValue* value) { | 7533 explicit HTypeof(HValue* context, HValue* value) { |
7532 SetOperandAt(0, context); | 7534 SetOperandAt(0, context); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7696 | 7698 |
7697 | 7699 |
7698 class HCheckMapValue FINAL : public HTemplateInstruction<2> { | 7700 class HCheckMapValue FINAL : public HTemplateInstruction<2> { |
7699 public: | 7701 public: |
7700 DECLARE_INSTRUCTION_FACTORY_P2(HCheckMapValue, HValue*, HValue*); | 7702 DECLARE_INSTRUCTION_FACTORY_P2(HCheckMapValue, HValue*, HValue*); |
7701 | 7703 |
7702 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7704 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7703 return Representation::Tagged(); | 7705 return Representation::Tagged(); |
7704 } | 7706 } |
7705 | 7707 |
7706 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7708 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7707 | 7709 |
7708 virtual HType CalculateInferredType() OVERRIDE { | 7710 virtual HType CalculateInferredType() OVERRIDE { |
7709 if (value()->type().IsHeapObject()) return value()->type(); | 7711 if (value()->type().IsHeapObject()) return value()->type(); |
7710 return HType::HeapObject(); | 7712 return HType::HeapObject(); |
7711 } | 7713 } |
7712 | 7714 |
7713 HValue* value() const { return OperandAt(0); } | 7715 HValue* value() const { return OperandAt(0); } |
7714 HValue* map() const { return OperandAt(1); } | 7716 HValue* map() const { return OperandAt(1); } |
7715 | 7717 |
7716 virtual HValue* Canonicalize() OVERRIDE; | 7718 virtual HValue* Canonicalize() OVERRIDE; |
(...skipping 24 matching lines...) Expand all Loading... |
7741 public: | 7743 public: |
7742 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HForInPrepareMap, HValue*); | 7744 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HForInPrepareMap, HValue*); |
7743 | 7745 |
7744 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7746 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7745 return Representation::Tagged(); | 7747 return Representation::Tagged(); |
7746 } | 7748 } |
7747 | 7749 |
7748 HValue* context() const { return OperandAt(0); } | 7750 HValue* context() const { return OperandAt(0); } |
7749 HValue* enumerable() const { return OperandAt(1); } | 7751 HValue* enumerable() const { return OperandAt(1); } |
7750 | 7752 |
7751 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7753 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7752 | 7754 |
7753 virtual HType CalculateInferredType() OVERRIDE { | 7755 virtual HType CalculateInferredType() OVERRIDE { |
7754 return HType::Tagged(); | 7756 return HType::Tagged(); |
7755 } | 7757 } |
7756 | 7758 |
7757 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap); | 7759 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap); |
7758 | 7760 |
7759 private: | 7761 private: |
7760 HForInPrepareMap(HValue* context, | 7762 HForInPrepareMap(HValue* context, |
7761 HValue* object) { | 7763 HValue* object) { |
(...skipping 18 matching lines...) Expand all Loading... |
7780 int idx() const { return idx_; } | 7782 int idx() const { return idx_; } |
7781 | 7783 |
7782 HForInCacheArray* index_cache() { | 7784 HForInCacheArray* index_cache() { |
7783 return index_cache_; | 7785 return index_cache_; |
7784 } | 7786 } |
7785 | 7787 |
7786 void set_index_cache(HForInCacheArray* index_cache) { | 7788 void set_index_cache(HForInCacheArray* index_cache) { |
7787 index_cache_ = index_cache; | 7789 index_cache_ = index_cache; |
7788 } | 7790 } |
7789 | 7791 |
7790 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7792 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7791 | 7793 |
7792 virtual HType CalculateInferredType() OVERRIDE { | 7794 virtual HType CalculateInferredType() OVERRIDE { |
7793 return HType::Tagged(); | 7795 return HType::Tagged(); |
7794 } | 7796 } |
7795 | 7797 |
7796 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray); | 7798 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray); |
7797 | 7799 |
7798 private: | 7800 private: |
7799 HForInCacheArray(HValue* enumerable, | 7801 HForInCacheArray(HValue* enumerable, |
7800 HValue* keys, | 7802 HValue* keys, |
(...skipping 24 matching lines...) Expand all Loading... |
7825 if (index == 1) { | 7827 if (index == 1) { |
7826 return Representation::Smi(); | 7828 return Representation::Smi(); |
7827 } else { | 7829 } else { |
7828 return Representation::Tagged(); | 7830 return Representation::Tagged(); |
7829 } | 7831 } |
7830 } | 7832 } |
7831 | 7833 |
7832 HValue* object() const { return OperandAt(0); } | 7834 HValue* object() const { return OperandAt(0); } |
7833 HValue* index() const { return OperandAt(1); } | 7835 HValue* index() const { return OperandAt(1); } |
7834 | 7836 |
7835 virtual OStream& PrintDataTo(OStream& os) const OVERRIDE; // NOLINT | 7837 virtual std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
7836 | 7838 |
7837 virtual HType CalculateInferredType() OVERRIDE { | 7839 virtual HType CalculateInferredType() OVERRIDE { |
7838 return HType::Tagged(); | 7840 return HType::Tagged(); |
7839 } | 7841 } |
7840 | 7842 |
7841 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 7843 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
7842 | 7844 |
7843 private: | 7845 private: |
7844 virtual bool IsDeletable() const OVERRIDE { return true; } | 7846 virtual bool IsDeletable() const OVERRIDE { return true; } |
7845 }; | 7847 }; |
(...skipping 24 matching lines...) Expand all Loading... |
7870 DECLARE_INSTRUCTION_FACTORY_P3(HAllocateBlockContext, HValue*, | 7872 DECLARE_INSTRUCTION_FACTORY_P3(HAllocateBlockContext, HValue*, |
7871 HValue*, Handle<ScopeInfo>); | 7873 HValue*, Handle<ScopeInfo>); |
7872 HValue* context() const { return OperandAt(0); } | 7874 HValue* context() const { return OperandAt(0); } |
7873 HValue* function() const { return OperandAt(1); } | 7875 HValue* function() const { return OperandAt(1); } |
7874 Handle<ScopeInfo> scope_info() const { return scope_info_; } | 7876 Handle<ScopeInfo> scope_info() const { return scope_info_; } |
7875 | 7877 |
7876 virtual Representation RequiredInputRepresentation(int index) { | 7878 virtual Representation RequiredInputRepresentation(int index) { |
7877 return Representation::Tagged(); | 7879 return Representation::Tagged(); |
7878 } | 7880 } |
7879 | 7881 |
7880 virtual OStream& PrintDataTo(OStream& os) const; // NOLINT | 7882 virtual std::ostream& PrintDataTo(std::ostream& os) const; // NOLINT |
7881 | 7883 |
7882 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext) | 7884 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext) |
7883 | 7885 |
7884 private: | 7886 private: |
7885 HAllocateBlockContext(HValue* context, | 7887 HAllocateBlockContext(HValue* context, |
7886 HValue* function, | 7888 HValue* function, |
7887 Handle<ScopeInfo> scope_info) | 7889 Handle<ScopeInfo> scope_info) |
7888 : scope_info_(scope_info) { | 7890 : scope_info_(scope_info) { |
7889 SetOperandAt(0, context); | 7891 SetOperandAt(0, context); |
7890 SetOperandAt(1, function); | 7892 SetOperandAt(1, function); |
7891 set_representation(Representation::Tagged()); | 7893 set_representation(Representation::Tagged()); |
7892 } | 7894 } |
7893 | 7895 |
7894 Handle<ScopeInfo> scope_info_; | 7896 Handle<ScopeInfo> scope_info_; |
7895 }; | 7897 }; |
7896 | 7898 |
7897 | 7899 |
7898 | 7900 |
7899 #undef DECLARE_INSTRUCTION | 7901 #undef DECLARE_INSTRUCTION |
7900 #undef DECLARE_CONCRETE_INSTRUCTION | 7902 #undef DECLARE_CONCRETE_INSTRUCTION |
7901 | 7903 |
7902 } } // namespace v8::internal | 7904 } } // namespace v8::internal |
7903 | 7905 |
7904 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7906 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |