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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 V(LeaveInlined) \ | 110 V(LeaveInlined) \ |
111 V(LoadContextSlot) \ | 111 V(LoadContextSlot) \ |
112 V(LoadFieldByIndex) \ | 112 V(LoadFieldByIndex) \ |
113 V(LoadFunctionPrototype) \ | 113 V(LoadFunctionPrototype) \ |
114 V(LoadGlobalGeneric) \ | 114 V(LoadGlobalGeneric) \ |
115 V(LoadKeyed) \ | 115 V(LoadKeyed) \ |
116 V(LoadKeyedGeneric) \ | 116 V(LoadKeyedGeneric) \ |
117 V(LoadNamedField) \ | 117 V(LoadNamedField) \ |
118 V(LoadNamedGeneric) \ | 118 V(LoadNamedGeneric) \ |
119 V(LoadRoot) \ | 119 V(LoadRoot) \ |
120 V(MapEnumLength) \ | |
121 V(MathFloorOfDiv) \ | 120 V(MathFloorOfDiv) \ |
122 V(MathMinMax) \ | 121 V(MathMinMax) \ |
123 V(MaybeGrowElements) \ | 122 V(MaybeGrowElements) \ |
124 V(Mod) \ | 123 V(Mod) \ |
125 V(Mul) \ | 124 V(Mul) \ |
126 V(OsrEntry) \ | 125 V(OsrEntry) \ |
127 V(Parameter) \ | 126 V(Parameter) \ |
128 V(Power) \ | 127 V(Power) \ |
129 V(Prologue) \ | 128 V(Prologue) \ |
130 V(PushArguments) \ | 129 V(PushArguments) \ |
(...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2486 c_function_(c_function), | 2485 c_function_(c_function), |
2487 save_doubles_(kDontSaveFPRegs) { | 2486 save_doubles_(kDontSaveFPRegs) { |
2488 SetOperandAt(0, context); | 2487 SetOperandAt(0, context); |
2489 } | 2488 } |
2490 | 2489 |
2491 const Runtime::Function* c_function_; | 2490 const Runtime::Function* c_function_; |
2492 SaveFPRegsMode save_doubles_; | 2491 SaveFPRegsMode save_doubles_; |
2493 }; | 2492 }; |
2494 | 2493 |
2495 | 2494 |
2496 class HMapEnumLength final : public HUnaryOperation { | |
2497 public: | |
2498 DECLARE_INSTRUCTION_FACTORY_P1(HMapEnumLength, HValue*); | |
2499 | |
2500 Representation RequiredInputRepresentation(int index) override { | |
2501 return Representation::Tagged(); | |
2502 } | |
2503 | |
2504 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength) | |
2505 | |
2506 protected: | |
2507 bool DataEquals(HValue* other) override { return true; } | |
2508 | |
2509 private: | |
2510 explicit HMapEnumLength(HValue* value) | |
2511 : HUnaryOperation(value, HType::Smi()) { | |
2512 set_representation(Representation::Smi()); | |
2513 SetFlag(kUseGVN); | |
2514 SetDependsOnFlag(kMaps); | |
2515 } | |
2516 | |
2517 bool IsDeletable() const override { return true; } | |
2518 }; | |
2519 | |
2520 | |
2521 class HUnaryMathOperation final : public HTemplateInstruction<2> { | 2495 class HUnaryMathOperation final : public HTemplateInstruction<2> { |
2522 public: | 2496 public: |
2523 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, | 2497 static HInstruction* New(Isolate* isolate, Zone* zone, HValue* context, |
2524 HValue* value, BuiltinFunctionId op); | 2498 HValue* value, BuiltinFunctionId op); |
2525 | 2499 |
2526 HValue* context() const { return OperandAt(0); } | 2500 HValue* context() const { return OperandAt(0); } |
2527 HValue* value() const { return OperandAt(1); } | 2501 HValue* value() const { return OperandAt(1); } |
2528 | 2502 |
2529 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT | 2503 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT |
2530 | 2504 |
(...skipping 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6020 Map::kBitFieldOffset, | 5994 Map::kBitFieldOffset, |
6021 Representation::UInteger8()); | 5995 Representation::UInteger8()); |
6022 } | 5996 } |
6023 | 5997 |
6024 static HObjectAccess ForMapBitField2() { | 5998 static HObjectAccess ForMapBitField2() { |
6025 return HObjectAccess(kInobject, | 5999 return HObjectAccess(kInobject, |
6026 Map::kBitField2Offset, | 6000 Map::kBitField2Offset, |
6027 Representation::UInteger8()); | 6001 Representation::UInteger8()); |
6028 } | 6002 } |
6029 | 6003 |
| 6004 static HObjectAccess ForMapBitField3() { |
| 6005 return HObjectAccess(kInobject, Map::kBitField3Offset, |
| 6006 Representation::Integer32()); |
| 6007 } |
| 6008 |
6030 static HObjectAccess ForNameHashField() { | 6009 static HObjectAccess ForNameHashField() { |
6031 return HObjectAccess(kInobject, | 6010 return HObjectAccess(kInobject, |
6032 Name::kHashFieldOffset, | 6011 Name::kHashFieldOffset, |
6033 Representation::Integer32()); | 6012 Representation::Integer32()); |
6034 } | 6013 } |
6035 | 6014 |
6036 static HObjectAccess ForMapInstanceTypeAndBitField() { | 6015 static HObjectAccess ForMapInstanceTypeAndBitField() { |
6037 STATIC_ASSERT((Map::kInstanceTypeAndBitFieldOffset & 1) == 0); | 6016 STATIC_ASSERT((Map::kInstanceTypeAndBitFieldOffset & 1) == 0); |
6038 // Ensure the two fields share one 16-bit word, endian-independent. | 6017 // Ensure the two fields share one 16-bit word, endian-independent. |
6039 STATIC_ASSERT((Map::kBitFieldOffset & ~1) == | 6018 STATIC_ASSERT((Map::kBitFieldOffset & ~1) == |
(...skipping 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7809 | 7788 |
7810 | 7789 |
7811 | 7790 |
7812 #undef DECLARE_INSTRUCTION | 7791 #undef DECLARE_INSTRUCTION |
7813 #undef DECLARE_CONCRETE_INSTRUCTION | 7792 #undef DECLARE_CONCRETE_INSTRUCTION |
7814 | 7793 |
7815 } // namespace internal | 7794 } // namespace internal |
7816 } // namespace v8 | 7795 } // namespace v8 |
7817 | 7796 |
7818 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ | 7797 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |