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 "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 7463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7474 | 7474 |
7475 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { | 7475 virtual Representation RequiredInputRepresentation(int index) OVERRIDE { |
7476 return Representation::Tagged(); | 7476 return Representation::Tagged(); |
7477 } | 7477 } |
7478 | 7478 |
7479 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) | 7479 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) |
7480 | 7480 |
7481 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 7481 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
7482 bool pretenure() const { return pretenure_; } | 7482 bool pretenure() const { return pretenure_; } |
7483 bool has_no_literals() const { return has_no_literals_; } | 7483 bool has_no_literals() const { return has_no_literals_; } |
7484 bool is_generator() const { return is_generator_; } | 7484 bool is_arrow() const { return IsArrowFunction(kind_); } |
| 7485 bool is_generator() const { return IsGeneratorFunction(kind_); } |
| 7486 bool is_concise_method() const { return IsConciseMethod(kind_); } |
| 7487 FunctionKind kind() const { return kind_; } |
7485 StrictMode strict_mode() const { return strict_mode_; } | 7488 StrictMode strict_mode() const { return strict_mode_; } |
7486 | 7489 |
7487 private: | 7490 private: |
7488 HFunctionLiteral(HValue* context, | 7491 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared, |
7489 Handle<SharedFunctionInfo> shared, | |
7490 bool pretenure) | 7492 bool pretenure) |
7491 : HTemplateInstruction<1>(HType::JSObject()), | 7493 : HTemplateInstruction<1>(HType::JSObject()), |
7492 shared_info_(shared), | 7494 shared_info_(shared), |
| 7495 kind_(shared->kind()), |
7493 pretenure_(pretenure), | 7496 pretenure_(pretenure), |
7494 has_no_literals_(shared->num_literals() == 0), | 7497 has_no_literals_(shared->num_literals() == 0), |
7495 is_generator_(shared->is_generator()), | |
7496 strict_mode_(shared->strict_mode()) { | 7498 strict_mode_(shared->strict_mode()) { |
7497 SetOperandAt(0, context); | 7499 SetOperandAt(0, context); |
7498 set_representation(Representation::Tagged()); | 7500 set_representation(Representation::Tagged()); |
7499 SetChangesFlag(kNewSpacePromotion); | 7501 SetChangesFlag(kNewSpacePromotion); |
7500 } | 7502 } |
7501 | 7503 |
7502 virtual bool IsDeletable() const OVERRIDE { return true; } | 7504 virtual bool IsDeletable() const OVERRIDE { return true; } |
7503 | 7505 |
7504 Handle<SharedFunctionInfo> shared_info_; | 7506 Handle<SharedFunctionInfo> shared_info_; |
| 7507 FunctionKind kind_; |
7505 bool pretenure_ : 1; | 7508 bool pretenure_ : 1; |
7506 bool has_no_literals_ : 1; | 7509 bool has_no_literals_ : 1; |
7507 bool is_generator_ : 1; | |
7508 StrictMode strict_mode_; | 7510 StrictMode strict_mode_; |
7509 }; | 7511 }; |
7510 | 7512 |
7511 | 7513 |
7512 class HTypeof FINAL : public HTemplateInstruction<2> { | 7514 class HTypeof FINAL : public HTemplateInstruction<2> { |
7513 public: | 7515 public: |
7514 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); | 7516 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); |
7515 | 7517 |
7516 HValue* context() const { return OperandAt(0); } | 7518 HValue* context() const { return OperandAt(0); } |
7517 HValue* value() const { return OperandAt(1); } | 7519 HValue* value() const { return OperandAt(1); } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7892 }; | 7894 }; |
7893 | 7895 |
7894 | 7896 |
7895 | 7897 |
7896 #undef DECLARE_INSTRUCTION | 7898 #undef DECLARE_INSTRUCTION |
7897 #undef DECLARE_CONCRETE_INSTRUCTION | 7899 #undef DECLARE_CONCRETE_INSTRUCTION |
7898 | 7900 |
7899 } } // namespace v8::internal | 7901 } } // namespace v8::internal |
7900 | 7902 |
7901 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7903 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |