| Index: src/ast.h
|
| diff --git a/src/ast.h b/src/ast.h
|
| index 94ece122c3b933f27638ff034d089f75763d9dd3..5f2e8334012d22188d86769fc7580f3169b14201 100644
|
| --- a/src/ast.h
|
| +++ b/src/ast.h
|
| @@ -2548,6 +2548,26 @@ class FunctionLiteral final : public Expression {
|
| dont_optimize_reason_ = reason;
|
| }
|
|
|
| + static int num_ids() { return parent_num_ids() + 1; }
|
| + TypeFeedbackId HomeObjectFeedbackId() { return TypeFeedbackId(local_id(0)); }
|
| +
|
| + // Type feedback information.
|
| + virtual FeedbackVectorRequirements ComputeFeedbackRequirements(
|
| + Isolate* isolate, const ICSlotCache* cache) override {
|
| + return FeedbackVectorRequirements(0, FLAG_vector_ics ? 1 : 0);
|
| + }
|
| + void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot,
|
| + ICSlotCache* cache) override {
|
| + DCHECK(!slot.IsInvalid());
|
| + home_object_feedback_slot_ = slot;
|
| + }
|
| + Code::Kind FeedbackICSlotKind(int index) override { return Code::LOAD_IC; }
|
| +
|
| + FeedbackVectorICSlot HomeObjectFeedbackSlot() {
|
| + DCHECK(!FLAG_vector_ics || !home_object_feedback_slot_.IsInvalid());
|
| + return home_object_feedback_slot_;
|
| + }
|
| +
|
| protected:
|
| FunctionLiteral(Zone* zone, const AstRawString* name,
|
| AstValueFactory* ast_value_factory, Scope* scope,
|
| @@ -2569,7 +2589,8 @@ class FunctionLiteral final : public Expression {
|
| expected_property_count_(expected_property_count),
|
| handler_count_(handler_count),
|
| parameter_count_(parameter_count),
|
| - function_token_position_(RelocInfo::kNoPosition) {
|
| + function_token_position_(RelocInfo::kNoPosition),
|
| + home_object_feedback_slot_(FeedbackVectorICSlot::Invalid()) {
|
| bitfield_ = IsExpression::encode(function_type != DECLARATION) |
|
| IsAnonymous::encode(function_type == ANONYMOUS_EXPRESSION) |
|
| Pretenure::encode(false) |
|
| @@ -2581,6 +2602,8 @@ class FunctionLiteral final : public Expression {
|
| DCHECK(IsValidFunctionKind(kind));
|
| }
|
|
|
| + static int parent_num_ids() { return Expression::num_ids(); }
|
| +
|
| private:
|
| const AstRawString* raw_name_;
|
| Handle<String> name_;
|
| @@ -2598,6 +2621,9 @@ class FunctionLiteral final : public Expression {
|
| int parameter_count_;
|
| int function_token_position_;
|
|
|
| + int local_id(int n) const { return base_id() + parent_num_ids() + n; }
|
| + FeedbackVectorICSlot home_object_feedback_slot_;
|
| +
|
| unsigned bitfield_;
|
| class IsExpression : public BitField<bool, 0, 1> {};
|
| class IsAnonymous : public BitField<bool, 1, 1> {};
|
| @@ -2699,40 +2725,21 @@ class SuperReference final : public Expression {
|
| DECLARE_NODE_TYPE(SuperReference)
|
|
|
| VariableProxy* this_var() const { return this_var_; }
|
| -
|
| - static int num_ids() { return parent_num_ids() + 1; }
|
| - TypeFeedbackId HomeObjectFeedbackId() { return TypeFeedbackId(local_id(0)); }
|
| -
|
| - // Type feedback information.
|
| - virtual FeedbackVectorRequirements ComputeFeedbackRequirements(
|
| - Isolate* isolate, const ICSlotCache* cache) override {
|
| - return FeedbackVectorRequirements(0, FLAG_vector_ics ? 1 : 0);
|
| - }
|
| - void SetFirstFeedbackICSlot(FeedbackVectorICSlot slot,
|
| - ICSlotCache* cache) override {
|
| - homeobject_feedback_slot_ = slot;
|
| - }
|
| - Code::Kind FeedbackICSlotKind(int index) override { return Code::LOAD_IC; }
|
| -
|
| - FeedbackVectorICSlot HomeObjectFeedbackSlot() {
|
| - DCHECK(!FLAG_vector_ics || !homeobject_feedback_slot_.IsInvalid());
|
| - return homeobject_feedback_slot_;
|
| - }
|
| + VariableProxy* home_object_var() const { return home_object_var_; }
|
|
|
| protected:
|
| - SuperReference(Zone* zone, VariableProxy* this_var, int pos)
|
| + SuperReference(Zone* zone, VariableProxy* this_var,
|
| + VariableProxy* home_object_var, int pos)
|
| : Expression(zone, pos),
|
| this_var_(this_var),
|
| - homeobject_feedback_slot_(FeedbackVectorICSlot::Invalid()) {
|
| + home_object_var_(home_object_var) {
|
| DCHECK(this_var->is_this());
|
| + DCHECK(home_object_var->raw_name()->IsOneByteEqualTo(".home_object"));
|
| }
|
| - static int parent_num_ids() { return Expression::num_ids(); }
|
|
|
| private:
|
| - int local_id(int n) const { return base_id() + parent_num_ids() + n; }
|
| -
|
| VariableProxy* this_var_;
|
| - FeedbackVectorICSlot homeobject_feedback_slot_;
|
| + VariableProxy* home_object_var_;
|
| };
|
|
|
|
|
| @@ -3496,8 +3503,9 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return new (zone_) ThisFunction(zone_, pos);
|
| }
|
|
|
| - SuperReference* NewSuperReference(VariableProxy* this_var, int pos) {
|
| - return new (zone_) SuperReference(zone_, this_var, pos);
|
| + SuperReference* NewSuperReference(VariableProxy* this_var,
|
| + VariableProxy* home_object_var, int pos) {
|
| + return new (zone_) SuperReference(zone_, this_var, home_object_var, pos);
|
| }
|
|
|
| private:
|
|
|