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 7429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7440 | 7440 |
7441 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 7441 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
7442 return Representation::Tagged(); | 7442 return Representation::Tagged(); |
7443 } | 7443 } |
7444 | 7444 |
7445 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) | 7445 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) |
7446 | 7446 |
7447 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 7447 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
7448 bool pretenure() const { return pretenure_; } | 7448 bool pretenure() const { return pretenure_; } |
7449 bool has_no_literals() const { return has_no_literals_; } | 7449 bool has_no_literals() const { return has_no_literals_; } |
7450 bool is_generator() const { return is_generator_; } | 7450 bool is_arrow() const { return IsArrowFunction(kind_); } |
| 7451 bool is_generator() const { return IsGeneratorFunction(kind_); } |
| 7452 bool is_concise_method() const { return IsConciseMethod(kind_); } |
| 7453 FunctionKind kind() const { return kind_; } |
7451 StrictMode strict_mode() const { return strict_mode_; } | 7454 StrictMode strict_mode() const { return strict_mode_; } |
7452 | 7455 |
7453 private: | 7456 private: |
7454 HFunctionLiteral(HValue* context, | 7457 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared, |
7455 Handle<SharedFunctionInfo> shared, | |
7456 bool pretenure) | 7458 bool pretenure) |
7457 : HTemplateInstruction<1>(HType::JSObject()), | 7459 : HTemplateInstruction<1>(HType::JSObject()), |
7458 shared_info_(shared), | 7460 shared_info_(shared), |
| 7461 kind_(shared->kind()), |
7459 pretenure_(pretenure), | 7462 pretenure_(pretenure), |
7460 has_no_literals_(shared->num_literals() == 0), | 7463 has_no_literals_(shared->num_literals() == 0), |
7461 is_generator_(shared->is_generator()), | |
7462 strict_mode_(shared->strict_mode()) { | 7464 strict_mode_(shared->strict_mode()) { |
7463 SetOperandAt(0, context); | 7465 SetOperandAt(0, context); |
7464 set_representation(Representation::Tagged()); | 7466 set_representation(Representation::Tagged()); |
7465 SetChangesFlag(kNewSpacePromotion); | 7467 SetChangesFlag(kNewSpacePromotion); |
7466 } | 7468 } |
7467 | 7469 |
7468 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7470 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7469 | 7471 |
7470 Handle<SharedFunctionInfo> shared_info_; | 7472 Handle<SharedFunctionInfo> shared_info_; |
| 7473 FunctionKind kind_; |
7471 bool pretenure_ : 1; | 7474 bool pretenure_ : 1; |
7472 bool has_no_literals_ : 1; | 7475 bool has_no_literals_ : 1; |
7473 bool is_generator_ : 1; | |
7474 StrictMode strict_mode_; | 7476 StrictMode strict_mode_; |
7475 }; | 7477 }; |
7476 | 7478 |
7477 | 7479 |
7478 class HTypeof V8_FINAL : public HTemplateInstruction<2> { | 7480 class HTypeof V8_FINAL : public HTemplateInstruction<2> { |
7479 public: | 7481 public: |
7480 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); | 7482 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); |
7481 | 7483 |
7482 HValue* context() const { return OperandAt(0); } | 7484 HValue* context() const { return OperandAt(0); } |
7483 HValue* value() const { return OperandAt(1); } | 7485 HValue* value() const { return OperandAt(1); } |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7858 }; | 7860 }; |
7859 | 7861 |
7860 | 7862 |
7861 | 7863 |
7862 #undef DECLARE_INSTRUCTION | 7864 #undef DECLARE_INSTRUCTION |
7863 #undef DECLARE_CONCRETE_INSTRUCTION | 7865 #undef DECLARE_CONCRETE_INSTRUCTION |
7864 | 7866 |
7865 } } // namespace v8::internal | 7867 } } // namespace v8::internal |
7866 | 7868 |
7867 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7869 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |