Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: src/ast/ast.h

Issue 2597163002: Revert of [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/ast/ast-numbering.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_AST_AST_H_ 5 #ifndef V8_AST_AST_H_
6 #define V8_AST_AST_H_ 6 #define V8_AST_AST_H_
7 7
8 #include "src/ast/ast-types.h" 8 #include "src/ast/ast-types.h"
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/modules.h" 10 #include "src/ast/modules.h"
(...skipping 2558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2569 int SourceSize() const { return end_position() - start_position(); } 2569 int SourceSize() const { return end_position() - start_position(); }
2570 bool is_declaration() const { return function_type() == kDeclaration; } 2570 bool is_declaration() const { return function_type() == kDeclaration; }
2571 bool is_named_expression() const { 2571 bool is_named_expression() const {
2572 return function_type() == kNamedExpression; 2572 return function_type() == kNamedExpression;
2573 } 2573 }
2574 bool is_anonymous_expression() const { 2574 bool is_anonymous_expression() const {
2575 return function_type() == kAnonymousExpression; 2575 return function_type() == kAnonymousExpression;
2576 } 2576 }
2577 LanguageMode language_mode() const; 2577 LanguageMode language_mode() const;
2578 2578
2579 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
2580 FeedbackVectorSlotCache* cache) {
2581 // The + 1 is because we need an array with room for the literals
2582 // as well as the feedback vector.
2583 literal_feedback_slot_ =
2584 spec->AddCreateClosureSlot(materialized_literal_count_ + 1);
2585 }
2586
2587 FeedbackVectorSlot LiteralFeedbackSlot() const {
2588 return literal_feedback_slot_;
2589 }
2590
2591 static bool NeedsHomeObject(Expression* expr); 2579 static bool NeedsHomeObject(Expression* expr);
2592 2580
2593 int materialized_literal_count() { return materialized_literal_count_; } 2581 int materialized_literal_count() { return materialized_literal_count_; }
2594 int expected_property_count() { return expected_property_count_; } 2582 int expected_property_count() { return expected_property_count_; }
2595 int parameter_count() { return parameter_count_; } 2583 int parameter_count() { return parameter_count_; }
2596 int function_length() { return function_length_; } 2584 int function_length() { return function_length_; }
2597 2585
2598 bool AllowsLazyCompilation(); 2586 bool AllowsLazyCompilation();
2599 2587
2600 Handle<String> debug_name() const { 2588 Handle<String> debug_name() const {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2748 int yield_count_; 2736 int yield_count_;
2749 bool has_braces_; 2737 bool has_braces_;
2750 2738
2751 const AstString* raw_name_; 2739 const AstString* raw_name_;
2752 DeclarationScope* scope_; 2740 DeclarationScope* scope_;
2753 ZoneList<Statement*>* body_; 2741 ZoneList<Statement*>* body_;
2754 const AstString* raw_inferred_name_; 2742 const AstString* raw_inferred_name_;
2755 Handle<String> inferred_name_; 2743 Handle<String> inferred_name_;
2756 AstProperties ast_properties_; 2744 AstProperties ast_properties_;
2757 int function_literal_id_; 2745 int function_literal_id_;
2758 FeedbackVectorSlot literal_feedback_slot_;
2759 }; 2746 };
2760 2747
2761 // Property is used for passing information 2748 // Property is used for passing information
2762 // about a class literal's properties from the parser to the code generator. 2749 // about a class literal's properties from the parser to the code generator.
2763 class ClassLiteralProperty final : public LiteralProperty { 2750 class ClassLiteralProperty final : public LiteralProperty {
2764 public: 2751 public:
2765 enum Kind : uint8_t { METHOD, GETTER, SETTER, FIELD }; 2752 enum Kind : uint8_t { METHOD, GETTER, SETTER, FIELD };
2766 2753
2767 Kind kind() const { return kind_; } 2754 Kind kind() const { return kind_; }
2768 2755
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
2839 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {}; 2826 : public BitField<bool, Expression::kNextBitFieldIndex, 1> {};
2840 class HasStaticComputedNames 2827 class HasStaticComputedNames
2841 : public BitField<bool, HasNameStaticProperty::kNext, 1> {}; 2828 : public BitField<bool, HasNameStaticProperty::kNext, 1> {};
2842 }; 2829 };
2843 2830
2844 2831
2845 class NativeFunctionLiteral final : public Expression { 2832 class NativeFunctionLiteral final : public Expression {
2846 public: 2833 public:
2847 Handle<String> name() const { return name_->string(); } 2834 Handle<String> name() const { return name_->string(); }
2848 v8::Extension* extension() const { return extension_; } 2835 v8::Extension* extension() const { return extension_; }
2849 FeedbackVectorSlot LiteralFeedbackSlot() const {
2850 return literal_feedback_slot_;
2851 }
2852
2853 void AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
2854 FeedbackVectorSlotCache* cache) {
2855 // 0 is a magic number here. It means we are holding the literals
2856 // array for a native function literal, which needs to be
2857 // the empty literals array.
2858 // TODO(mvstanton): The FeedbackVectorSlotCache can be adapted
2859 // to always return the same slot for this case.
2860 literal_feedback_slot_ = spec->AddCreateClosureSlot(0);
2861 }
2862 2836
2863 private: 2837 private:
2864 friend class AstNodeFactory; 2838 friend class AstNodeFactory;
2865 2839
2866 NativeFunctionLiteral(const AstRawString* name, v8::Extension* extension, 2840 NativeFunctionLiteral(const AstRawString* name, v8::Extension* extension,
2867 int pos) 2841 int pos)
2868 : Expression(pos, kNativeFunctionLiteral), 2842 : Expression(pos, kNativeFunctionLiteral),
2869 name_(name), 2843 name_(name),
2870 extension_(extension) {} 2844 extension_(extension) {}
2871 2845
2872 const AstRawString* name_; 2846 const AstRawString* name_;
2873 v8::Extension* extension_; 2847 v8::Extension* extension_;
2874 FeedbackVectorSlot literal_feedback_slot_;
2875 }; 2848 };
2876 2849
2877 2850
2878 class ThisFunction final : public Expression { 2851 class ThisFunction final : public Expression {
2879 private: 2852 private:
2880 friend class AstNodeFactory; 2853 friend class AstNodeFactory;
2881 explicit ThisFunction(int pos) : Expression(pos, kThisFunction) {} 2854 explicit ThisFunction(int pos) : Expression(pos, kThisFunction) {}
2882 }; 2855 };
2883 2856
2884 2857
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
3630 : NULL; \ 3603 : NULL; \
3631 } 3604 }
3632 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) 3605 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS)
3633 #undef DECLARE_NODE_FUNCTIONS 3606 #undef DECLARE_NODE_FUNCTIONS
3634 3607
3635 3608
3636 } // namespace internal 3609 } // namespace internal
3637 } // namespace v8 3610 } // namespace v8
3638 3611
3639 #endif // V8_AST_AST_H_ 3612 #endif // V8_AST_AST_H_
OLDNEW
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/ast/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698