| 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 <cstring> | 8 #include <cstring> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 | 10 |
| (...skipping 7039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7050 HObjectAccess access_; | 7050 HObjectAccess access_; |
| 7051 HValue* dominator_; | 7051 HValue* dominator_; |
| 7052 uint32_t bit_field_; | 7052 uint32_t bit_field_; |
| 7053 }; | 7053 }; |
| 7054 | 7054 |
| 7055 | 7055 |
| 7056 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> { | 7056 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> { |
| 7057 public: | 7057 public: |
| 7058 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, | 7058 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, |
| 7059 Handle<String>, HValue*, | 7059 Handle<String>, HValue*, |
| 7060 StrictMode); | 7060 LanguageMode); |
| 7061 HValue* object() const { return OperandAt(0); } | 7061 HValue* object() const { return OperandAt(0); } |
| 7062 HValue* value() const { return OperandAt(1); } | 7062 HValue* value() const { return OperandAt(1); } |
| 7063 HValue* context() const { return OperandAt(2); } | 7063 HValue* context() const { return OperandAt(2); } |
| 7064 Handle<String> name() const { return name_; } | 7064 Handle<String> name() const { return name_; } |
| 7065 StrictMode strict_mode() const { return strict_mode_; } | 7065 LanguageMode language_mode() const { return language_mode_; } |
| 7066 | 7066 |
| 7067 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 7067 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 7068 | 7068 |
| 7069 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7069 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7070 return Representation::Tagged(); | 7070 return Representation::Tagged(); |
| 7071 } | 7071 } |
| 7072 | 7072 |
| 7073 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) | 7073 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) |
| 7074 | 7074 |
| 7075 private: | 7075 private: |
| 7076 HStoreNamedGeneric(HValue* context, | 7076 HStoreNamedGeneric(HValue* context, HValue* object, Handle<String> name, |
| 7077 HValue* object, | 7077 HValue* value, LanguageMode language_mode) |
| 7078 Handle<String> name, | 7078 : name_(name), language_mode_(language_mode) { |
| 7079 HValue* value, | |
| 7080 StrictMode strict_mode) | |
| 7081 : name_(name), | |
| 7082 strict_mode_(strict_mode) { | |
| 7083 SetOperandAt(0, object); | 7079 SetOperandAt(0, object); |
| 7084 SetOperandAt(1, value); | 7080 SetOperandAt(1, value); |
| 7085 SetOperandAt(2, context); | 7081 SetOperandAt(2, context); |
| 7086 SetAllSideEffects(); | 7082 SetAllSideEffects(); |
| 7087 } | 7083 } |
| 7088 | 7084 |
| 7089 Handle<String> name_; | 7085 Handle<String> name_; |
| 7090 StrictMode strict_mode_; | 7086 LanguageMode language_mode_; |
| 7091 }; | 7087 }; |
| 7092 | 7088 |
| 7093 | 7089 |
| 7094 class HStoreKeyed FINAL | 7090 class HStoreKeyed FINAL |
| 7095 : public HTemplateInstruction<3>, public ArrayInstructionInterface { | 7091 : public HTemplateInstruction<3>, public ArrayInstructionInterface { |
| 7096 public: | 7092 public: |
| 7097 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, | 7093 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7098 ElementsKind); | 7094 ElementsKind); |
| 7099 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, | 7095 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, |
| 7100 ElementsKind, StoreFieldOrKeyedMode); | 7096 ElementsKind, StoreFieldOrKeyedMode); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7271 | 7267 |
| 7272 uint32_t base_offset_; | 7268 uint32_t base_offset_; |
| 7273 uint32_t bit_field_; | 7269 uint32_t bit_field_; |
| 7274 HValue* dominator_; | 7270 HValue* dominator_; |
| 7275 }; | 7271 }; |
| 7276 | 7272 |
| 7277 | 7273 |
| 7278 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> { | 7274 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> { |
| 7279 public: | 7275 public: |
| 7280 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, | 7276 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, |
| 7281 HValue*, HValue*, StrictMode); | 7277 HValue*, HValue*, LanguageMode); |
| 7282 | 7278 |
| 7283 HValue* object() const { return OperandAt(0); } | 7279 HValue* object() const { return OperandAt(0); } |
| 7284 HValue* key() const { return OperandAt(1); } | 7280 HValue* key() const { return OperandAt(1); } |
| 7285 HValue* value() const { return OperandAt(2); } | 7281 HValue* value() const { return OperandAt(2); } |
| 7286 HValue* context() const { return OperandAt(3); } | 7282 HValue* context() const { return OperandAt(3); } |
| 7287 StrictMode strict_mode() const { return strict_mode_; } | 7283 LanguageMode language_mode() const { return language_mode_; } |
| 7288 | 7284 |
| 7289 Representation RequiredInputRepresentation(int index) OVERRIDE { | 7285 Representation RequiredInputRepresentation(int index) OVERRIDE { |
| 7290 // tagged[tagged] = tagged | 7286 // tagged[tagged] = tagged |
| 7291 return Representation::Tagged(); | 7287 return Representation::Tagged(); |
| 7292 } | 7288 } |
| 7293 | 7289 |
| 7294 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 7290 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
| 7295 | 7291 |
| 7296 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) | 7292 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) |
| 7297 | 7293 |
| 7298 private: | 7294 private: |
| 7299 HStoreKeyedGeneric(HValue* context, | 7295 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key, |
| 7300 HValue* object, | 7296 HValue* value, LanguageMode language_mode) |
| 7301 HValue* key, | 7297 : language_mode_(language_mode) { |
| 7302 HValue* value, | |
| 7303 StrictMode strict_mode) | |
| 7304 : strict_mode_(strict_mode) { | |
| 7305 SetOperandAt(0, object); | 7298 SetOperandAt(0, object); |
| 7306 SetOperandAt(1, key); | 7299 SetOperandAt(1, key); |
| 7307 SetOperandAt(2, value); | 7300 SetOperandAt(2, value); |
| 7308 SetOperandAt(3, context); | 7301 SetOperandAt(3, context); |
| 7309 SetAllSideEffects(); | 7302 SetAllSideEffects(); |
| 7310 } | 7303 } |
| 7311 | 7304 |
| 7312 StrictMode strict_mode_; | 7305 LanguageMode language_mode_; |
| 7313 }; | 7306 }; |
| 7314 | 7307 |
| 7315 | 7308 |
| 7316 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { | 7309 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { |
| 7317 public: | 7310 public: |
| 7318 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, | 7311 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, |
| 7319 HValue* context, HValue* object, | 7312 HValue* context, HValue* object, |
| 7320 Handle<Map> original_map, | 7313 Handle<Map> original_map, |
| 7321 Handle<Map> transitioned_map) { | 7314 Handle<Map> transitioned_map) { |
| 7322 return new(zone) HTransitionElementsKind(context, object, | 7315 return new(zone) HTransitionElementsKind(context, object, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7591 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 7584 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
| 7592 bool pretenure() const { return PretenureField::decode(bit_field_); } | 7585 bool pretenure() const { return PretenureField::decode(bit_field_); } |
| 7593 bool has_no_literals() const { | 7586 bool has_no_literals() const { |
| 7594 return HasNoLiteralsField::decode(bit_field_); | 7587 return HasNoLiteralsField::decode(bit_field_); |
| 7595 } | 7588 } |
| 7596 bool is_arrow() const { return IsArrowFunction(kind()); } | 7589 bool is_arrow() const { return IsArrowFunction(kind()); } |
| 7597 bool is_generator() const { return IsGeneratorFunction(kind()); } | 7590 bool is_generator() const { return IsGeneratorFunction(kind()); } |
| 7598 bool is_concise_method() const { return IsConciseMethod(kind()); } | 7591 bool is_concise_method() const { return IsConciseMethod(kind()); } |
| 7599 bool is_default_constructor() const { return IsDefaultConstructor(kind()); } | 7592 bool is_default_constructor() const { return IsDefaultConstructor(kind()); } |
| 7600 FunctionKind kind() const { return FunctionKindField::decode(bit_field_); } | 7593 FunctionKind kind() const { return FunctionKindField::decode(bit_field_); } |
| 7601 StrictMode strict_mode() const { return StrictModeField::decode(bit_field_); } | 7594 LanguageMode language_mode() const { |
| 7595 return LanguageModeField::decode(bit_field_); |
| 7596 } |
| 7602 | 7597 |
| 7603 private: | 7598 private: |
| 7604 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared, | 7599 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared, |
| 7605 bool pretenure) | 7600 bool pretenure) |
| 7606 : HTemplateInstruction<1>(HType::JSObject()), | 7601 : HTemplateInstruction<1>(HType::JSObject()), |
| 7607 shared_info_(shared), | 7602 shared_info_(shared), |
| 7608 bit_field_(FunctionKindField::encode(shared->kind()) | | 7603 bit_field_(FunctionKindField::encode(shared->kind()) | |
| 7609 PretenureField::encode(pretenure) | | 7604 PretenureField::encode(pretenure) | |
| 7610 HasNoLiteralsField::encode(shared->num_literals() == 0) | | 7605 HasNoLiteralsField::encode(shared->num_literals() == 0) | |
| 7611 StrictModeField::encode(shared->strict_mode())) { | 7606 LanguageModeField::encode(shared->language_mode())) { |
| 7612 SetOperandAt(0, context); | 7607 SetOperandAt(0, context); |
| 7613 set_representation(Representation::Tagged()); | 7608 set_representation(Representation::Tagged()); |
| 7614 SetChangesFlag(kNewSpacePromotion); | 7609 SetChangesFlag(kNewSpacePromotion); |
| 7615 } | 7610 } |
| 7616 | 7611 |
| 7617 bool IsDeletable() const OVERRIDE { return true; } | 7612 bool IsDeletable() const OVERRIDE { return true; } |
| 7618 | 7613 |
| 7619 class FunctionKindField : public BitField<FunctionKind, 0, 4> {}; | 7614 class FunctionKindField : public BitField<FunctionKind, 0, 4> {}; |
| 7620 class PretenureField : public BitField<bool, 5, 1> {}; | 7615 class PretenureField : public BitField<bool, 5, 1> {}; |
| 7621 class HasNoLiteralsField : public BitField<bool, 6, 1> {}; | 7616 class HasNoLiteralsField : public BitField<bool, 6, 1> {}; |
| 7622 class StrictModeField : public BitField<StrictMode, 7, 1> {}; | 7617 STATIC_ASSERT(LANGUAGE_END == 2); |
| 7618 class LanguageModeField : public BitField<LanguageMode, 7, 1> {}; |
| 7623 | 7619 |
| 7624 Handle<SharedFunctionInfo> shared_info_; | 7620 Handle<SharedFunctionInfo> shared_info_; |
| 7625 uint32_t bit_field_; | 7621 uint32_t bit_field_; |
| 7626 }; | 7622 }; |
| 7627 | 7623 |
| 7628 | 7624 |
| 7629 class HTypeof FINAL : public HTemplateInstruction<2> { | 7625 class HTypeof FINAL : public HTemplateInstruction<2> { |
| 7630 public: | 7626 public: |
| 7631 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); | 7627 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); |
| 7632 | 7628 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7999 }; | 7995 }; |
| 8000 | 7996 |
| 8001 | 7997 |
| 8002 | 7998 |
| 8003 #undef DECLARE_INSTRUCTION | 7999 #undef DECLARE_INSTRUCTION |
| 8004 #undef DECLARE_CONCRETE_INSTRUCTION | 8000 #undef DECLARE_CONCRETE_INSTRUCTION |
| 8005 | 8001 |
| 8006 } } // namespace v8::internal | 8002 } } // namespace v8::internal |
| 8007 | 8003 |
| 8008 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 8004 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |